名前空間: microsoft.graph.cloudLicensing
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
組織内のライセンス 割り当て オブジェクトの一覧を取得します。
API の可用性
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
管理者の 割り当て の一覧を取得するためのアクセス許可:
GET /admin/cloudLicensing/assignments
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
CloudLicensing.Read |
CloudLicensing.Read.All、Directory.Read.All、Directory.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
CloudLicensing.Read.All |
Directory.Read.All、Directory.ReadWrite.All |
ユーザーの 割り当て の一覧を取得するためのアクセス許可:
GET /users/{userId}/cloudLicensing/assignments
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
CloudLicensing.Read |
CloudLicensing.Read.All、User-CloudLicensing.Read.All、User.Read.All、User.ReadWrite.All、Directory.Read.All、Directory.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
CloudLicensing.Read.All |
User-CloudLicensing.Read.All、User.Read.All、User.ReadWrite.All、Directory.Read.All、Directory.ReadWrite.All |
グループの 割り当て の一覧を取得するためのアクセス許可:
GET /groups/{groupId}/cloudLicensing/assignments
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
CloudLicensing.Read |
CloudLicensing.Read.All、Group-CloudLicensing.Read.All、Group.Read.All、Group.ReadWrite.All、Directory.Read.All、Directory.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
CloudLicensing.Read.All |
Group-CloudLicensing.Read.All、Group.Read.All、Group.ReadWrite.All、Directory.Read.All、Directory.ReadWrite.All |
HTTP 要求
GET /admin/cloudLicensing/assignments
GET /users/{userId}/cloudLicensing/assignments
GET /groups/{groupId}/cloudLicensing/assignments
オプションのクエリ パラメーター
このメソッドは、応答をカスタマイズするための $select、$top、$expand、$filter OData クエリ パラメーターをサポートします。 一般的な情報については、「OData クエリ パラメーター」を参照してください。
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
要求本文
このメソッドには、要求本文を指定しません。
応答
成功した場合、このメソッドは 200 OK 応答コードと、応答本文で microsoft.graph.cloudLicensing.assignment オブジェクトのコレクションを返します。
例
例 1: 課題を取得する
次の例は、 割り当て オブジェクトのリストを取得する方法を示しています。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/admin/cloudLicensing/assignments
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Admin.CloudLicensing.Assignments.GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
assignments, err := graphClient.Admin().CloudLicensing().Assignments().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.cloudlicensing.AssignmentCollectionResponse result = graphClient.admin().cloudLicensing().assignments().get();
const options = {
authProvider,
};
const client = Client.init(options);
let assignments = await client.api('/admin/cloudLicensing/assignments')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->admin()->cloudLicensing()->assignments()->get()->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.admin.cloud_licensing.assignments.get()
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.cloudLicensing.assignment",
"id": "405ee855-dd74-f695-8d7e-be35a6788fe8",
"disabledServicePlanIds": [
"5e62787c-c316-451f-b873-1d05acd4d12c"
]
}
]
}
例 2: 割り当てとその割り当てを取得する
次の例は、expand クエリ パラメーターを使用して割り当てオブジェクトとその割り当てのリストを取得する方法を示しています。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/admin/cloudLicensing/assignments?$expand=assignedTo,allotment
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Admin.CloudLicensing.Assignments.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Expand = new string []{ "assignedTo","allotment" };
});
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphadmin "github.com/microsoftgraph/msgraph-beta-sdk-go/admin"
//other-imports
)
requestParameters := &graphadmin.CloudLicensingAssignmentsRequestBuilderGetQueryParameters{
Expand: [] string {"assignedTo","allotment"},
}
configuration := &graphadmin.CloudLicensingAssignmentsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
assignments, err := graphClient.Admin().CloudLicensing().Assignments().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.cloudlicensing.AssignmentCollectionResponse result = graphClient.admin().cloudLicensing().assignments().get(requestConfiguration -> {
requestConfiguration.queryParameters.expand = new String []{"assignedTo", "allotment"};
});
const options = {
authProvider,
};
const client = Client.init(options);
let assignments = await client.api('/admin/cloudLicensing/assignments')
.version('beta')
.expand('assignedTo,allotment')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Assignments\AssignmentsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new AssignmentsRequestBuilderGetRequestConfiguration();
$queryParameters = AssignmentsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->expand = ["assignedTo","allotment"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->admin()->cloudLicensing()->assignments()->get($requestConfiguration)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.admin.cloud_licensing.assignments.assignments_request_builder import AssignmentsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = AssignmentsRequestBuilder.AssignmentsRequestBuilderGetQueryParameters(
expand = ["assignedTo","allotment"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.admin.cloud_licensing.assignments.get(request_configuration = request_configuration)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.cloudLicensing.assignment",
"id": "405ee855-dd74-f695-8d7e-be35a6788fe8",
"disabledServicePlanIds": [
"5e62787c-c316-451f-b873-1d05acd4d12c"
],
"assignedTo": {
"@odata.type": "#microsoft.graph.user",
"id": "a6c034b8-621b-dee3-6abb-52cbce801fe9",
"displayName": "Steve Fred",
"userPrincipalName": "stevefred@contoso.com"
},
"allotment": {
"@odata.type": "#microsoft.graph.cloudLicensing.allotment",
"id": "fde42873-30b6-436b-b361-21af5a6b84ae",
"allottedUnits": 100,
"assignableTo": "user,group",
"consumedUnits": 84,
"services": [
{
"@odata.type": "#microsoft.graph.cloudLicensing.service",
"assignableTo": "user,group",
"planId": "f4f2f6de-6830-442b-a433-e92249faebe2",
"planName": "TeamsEss"
}
],
"skuId": "f245ecc8-75af-4f8e-b61f-27d8114de5f3",
"skuPartNumber": "Teams_Ess"
}
}
]
}
例 3: skuId でフィルター処理された割り当てを取得する
次の例は、skuId プロパティによってフィルター処理された割り当てオブジェクトの一覧を取得する方法を示しています。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/admin/cloudLicensing/assignments?$expand=allotment($filter=skuId in (639dec6b-bb19-468b-871c-c5c441c4b0cb, a403ebcc-fae0-4ca2-8c8c-7a907fd6c235))
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Admin.CloudLicensing.Assignments.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Expand = new string []{ "allotment($filter=skuId in (639dec6b-bb19-468b-871c-c5c441c4b0cb, a403ebcc-fae0-4ca2-8c8c-7a907fd6c235)",")" };
});
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphadmin "github.com/microsoftgraph/msgraph-beta-sdk-go/admin"
//other-imports
)
requestParameters := &graphadmin.CloudLicensingAssignmentsRequestBuilderGetQueryParameters{
Expand: [] string {"allotment($filter=skuId in (639dec6b-bb19-468b-871c-c5c441c4b0cb, a403ebcc-fae0-4ca2-8c8c-7a907fd6c235)",")"},
}
configuration := &graphadmin.CloudLicensingAssignmentsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
assignments, err := graphClient.Admin().CloudLicensing().Assignments().Get(context.Background(), configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.cloudlicensing.AssignmentCollectionResponse result = graphClient.admin().cloudLicensing().assignments().get(requestConfiguration -> {
requestConfiguration.queryParameters.expand = new String []{"allotment($filter=skuId in (639dec6b-bb19-468b-871c-c5c441c4b0cb, a403ebcc-fae0-4ca2-8c8c-7a907fd6c235)", ")"};
});
const options = {
authProvider,
};
const client = Client.init(options);
let assignments = await client.api('/admin/cloudLicensing/assignments')
.version('beta')
.expand('allotment($filter=skuId in (639dec6b-bb19-468b-871c-c5c441c4b0cb, a403ebcc-fae0-4ca2-8c8c-7a907fd6c235))')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Assignments\AssignmentsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new AssignmentsRequestBuilderGetRequestConfiguration();
$queryParameters = AssignmentsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->expand = ["allotment(\$filter=skuId in (639dec6b-bb19-468b-871c-c5c441c4b0cb, a403ebcc-fae0-4ca2-8c8c-7a907fd6c235)",")"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->admin()->cloudLicensing()->assignments()->get($requestConfiguration)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.admin.cloud_licensing.assignments.assignments_request_builder import AssignmentsRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = AssignmentsRequestBuilder.AssignmentsRequestBuilderGetQueryParameters(
expand = ["allotment($filter=skuId in (639dec6b-bb19-468b-871c-c5c441c4b0cb, a403ebcc-fae0-4ca2-8c8c-7a907fd6c235)",")"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.admin.cloud_licensing.assignments.get(request_configuration = request_configuration)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.cloudLicensing.assignment",
"id": "405ee855-dd74-f695-8d7e-be35a6788fe8",
"disabledServicePlanIds": [
"5e62787c-c316-451f-b873-1d05acd4d12c"
],
"allotment": {
"@odata.type": "#microsoft.graph.cloudLicensing.allotment",
"id": "551f1755-0184-9e51-0bc7-f32bae5a1afb",
"allottedUnits": 250,
"assignableTo": "user,group",
"consumedUnits": 224,
"services": [
{
"@odata.type": "microsoft.graph.cloudLicensing.service",
"assignableTo": "user,group",
"planId": "9aaf7827-d63c-4b61-89c3-182f06f82e5c",
"planName": "EXCHANGE_S_STANDARD"
},
{
"@odata.type": "microsoft.graph.cloudLicensing.service",
"assignableTo": "none",
"planId": "6f23d6a9-adbf-481c-8538-b4c095654487",
"planName": "M365_LIGHTHOUSE_CUSTOMER_PLAN1"
},
{
"@odata.type": "microsoft.graph.cloudLicensing.service",
"assignableTo": "none",
"planId": "882e1d05-acd1-4ccb-8708-6ee03664b117",
"planName": "INTUNE_O365"
},
{
"@odata.type": "microsoft.graph.cloudLicensing.service",
"assignableTo": "user,group",
"planId": "5e62787c-c316-451f-b873-1d05acd4d12c",
"planName": "BPOS_S_TODO_1"
}
],
"skuId": "a403ebcc-fae0-4ca2-8c8c-7a907fd6c235",
"skuPartNumber": "EXCHANGESTANDARD"
}
}
]
}