名前空間: microsoft.graph.cloudLicensing
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
割り当てオブジェクトとそのプロパティの一覧を取得します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
❌ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
CloudLicensing.Read |
CloudLicensing.Read.All、Directory.Read.All、Directory.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
CloudLicensing.Read.All |
Directory.Read.All、Directory.ReadWrite.All |
HTTP 要求
GET /admin/cloudLicensing/allotments
オプションのクエリ パラメーター
このメソッドは、 $select、 $top、 $expand、 $apply、 $filter OData クエリ パラメーターをサポートし、応答をカスタマイズするのに役立ちます。 一般的な情報については、「OData クエリ パラメーター」を参照してください。
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
要求本文
このメソッドには、要求本文を指定しません。
応答
成功した場合、このメソッドは 200 OK 応答コードと、応答本文の microsoft.graph.cloudLicensing.allotment オブジェクトのコレクションを返します。
例
例 1: 割り当てを取得する
次の例は 、割り当て オブジェクトを取得する方法を示しています。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/admin/cloudLicensing/allotments
// 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.Allotments.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
allotments, err := graphClient.Admin().CloudLicensing().Allotments().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.AllotmentCollectionResponse result = graphClient.admin().cloudLicensing().allotments().get();
const options = {
authProvider,
};
const client = Client.init(options);
let allotments = await client.api('/admin/cloudLicensing/allotments')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->admin()->cloudLicensing()->allotments()->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.allotments.get()
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@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": "4b9405b0-7788-4568-add1-99614e613b69",
"skuPartNumber": "EXCHANGESTANDARD"
}
]
}
例 2: waitingMembers を使用して割り当てを取得する
次の例は、waitingMembers を含む割り当てオブジェクトを取得する方法を示しています。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/admin/cloudLicensing/allotments?$select=id,allottedUnits,consumedUnits,assignableTo&$expand=waitingMembers($select=id,waitingSinceDateTime)
// 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.Allotments.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Select = new string []{ "id","allottedUnits","consumedUnits","assignableTo" };
requestConfiguration.QueryParameters.Expand = new string []{ "waitingMembers($select=id,waitingSinceDateTime)" };
});
// 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.CloudLicensingAllotmentsRequestBuilderGetQueryParameters{
Select: [] string {"id","allottedUnits","consumedUnits","assignableTo"},
Expand: [] string {"waitingMembers($select=id,waitingSinceDateTime)"},
}
configuration := &graphadmin.CloudLicensingAllotmentsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
allotments, err := graphClient.Admin().CloudLicensing().Allotments().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.AllotmentCollectionResponse result = graphClient.admin().cloudLicensing().allotments().get(requestConfiguration -> {
requestConfiguration.queryParameters.select = new String []{"id", "allottedUnits", "consumedUnits", "assignableTo"};
requestConfiguration.queryParameters.expand = new String []{"waitingMembers($select=id,waitingSinceDateTime)"};
});
const options = {
authProvider,
};
const client = Client.init(options);
let allotments = await client.api('/admin/cloudLicensing/allotments')
.version('beta')
.expand('waitingMembers($select=id,waitingSinceDateTime)')
.select('id,allottedUnits,consumedUnits,assignableTo')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\AllotmentsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new AllotmentsRequestBuilderGetRequestConfiguration();
$queryParameters = AllotmentsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->select = ["id","allottedUnits","consumedUnits","assignableTo"];
$queryParameters->expand = ["waitingMembers(\$select=id,waitingSinceDateTime)"];
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->admin()->cloudLicensing()->allotments()->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.allotments.allotments_request_builder import AllotmentsRequestBuilder
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 = AllotmentsRequestBuilder.AllotmentsRequestBuilderGetQueryParameters(
select = ["id","allottedUnits","consumedUnits","assignableTo"],
expand = ["waitingMembers($select=id,waitingSinceDateTime)"],
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.admin.cloud_licensing.allotments.get(request_configuration = request_configuration)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.cloudLicensing.allotment",
"id": "551f1755-0184-9e51-0bc7-f32bae5a1afb",
"allottedUnits": 250,
"assignableTo": "user,group",
"consumedUnits": 224,
"waitingMembers": [
{
"@odata.type": "#microsoft.graph.cloudLicensing.waitingMember",
"id": "49caea1b-ad15-64f1-70c5-5c5e3563d19c",
"waitingSinceDateTime": "2024-11-22T17:11:10.6635939+00:00"
}
]
}
]
}
例 3: 割り当てを取得し、割り当てられたユニットを集計する
次の例は、 割り当て オブジェクトを取得し、割り当てられたユニットを集計する方法を示しています。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/admin/cloudLicensing/allotments?$apply=groupby((skuId,skuPartNumber), aggregate(allottedUnits with sum as totalAllottedUnits, consumedUnits with sum as totalConsumedUnits))
// 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.Allotments.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Apply = "groupby((skuId,skuPartNumber), aggregate(allottedUnits with sum as totalAllottedUnits, consumedUnits with sum as totalConsumedUnits))";
});
// 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
)
requestApply := "groupby((skuId,skuPartNumber), aggregate(allottedUnits with sum as totalAllottedUnits, consumedUnits with sum as totalConsumedUnits))"
requestParameters := &graphadmin.CloudLicensingAllotmentsRequestBuilderGetQueryParameters{
Apply: &requestApply,
}
configuration := &graphadmin.CloudLicensingAllotmentsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
allotments, err := graphClient.Admin().CloudLicensing().Allotments().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.AllotmentCollectionResponse result = graphClient.admin().cloudLicensing().allotments().get(requestConfiguration -> {
requestConfiguration.queryParameters.apply = "groupby((skuId,skuPartNumber), aggregate(allottedUnits with sum as totalAllottedUnits, consumedUnits with sum as totalConsumedUnits))";
});
const options = {
authProvider,
};
const client = Client.init(options);
let allotments = await client.api('/admin/cloudLicensing/allotments')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Admin\CloudLicensing\Allotments\AllotmentsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new AllotmentsRequestBuilderGetRequestConfiguration();
$queryParameters = AllotmentsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->apply = "groupby((skuId,skuPartNumber), aggregate(allottedUnits with sum as totalAllottedUnits, consumedUnits with sum as totalConsumedUnits))";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->admin()->cloudLicensing()->allotments()->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.allotments.allotments_request_builder import AllotmentsRequestBuilder
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 = AllotmentsRequestBuilder.AllotmentsRequestBuilderGetQueryParameters(
apply = "groupby((skuId,skuPartNumber), aggregate(allottedUnits with sum as totalAllottedUnits, consumedUnits with sum as totalConsumedUnits))",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.admin.cloud_licensing.allotments.get(request_configuration = request_configuration)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"skuId": "6fd2c87f-b296-42f0-b197-1e91e994b900",
"skuPartNumber": "ENTERPRISEPACK",
"totalAllottedUnits": 500,
"totalConsumedUnits": 425
},
{
"skuId": "c7df2760-2c81-4ef7-b578-5b5392b571df",
"skuPartNumber": "ENTERPRISEPREMIUM",
"totalAllottedUnits": 200,
"totalConsumedUnits": 150
},
{
"skuId": "a4585165-0533-458a-97e3-c400570268c4",
"skuPartNumber": "SHAREPOINTSTANDARD",
"totalAllottedUnits": 300,
"totalConsumedUnits": 275
}
]
}