Namespace: microsoft.graph.cloudLicensing
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Rufen Sie eine Liste der Zuteilungsobjekte und ihrer Eigenschaften ab.
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
❌ |
❌ |
❌ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
CloudLicensing.Read |
CloudLicensing.Read.All, Directory.Read.All, Directory.ReadWrite.All |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
CloudLicensing.Read.All |
Directory.Read.All, Directory.ReadWrite.All |
HTTP-Anforderung
GET /admin/cloudLicensing/allotments
Optionale Abfrageparameter
Diese Methode unterstützt die $selectAbfrageparameter , $top, $expand, $applyund $filter OData, um die Antwort anzupassen. Allgemeine Informationen finden Sie unter OData-Abfrageparameter.
Anforderungstext
Geben Sie keinen Anforderungstext für diese Methode an.
Antwort
Bei erfolgreicher Ausführung gibt diese Methode einen 200 OK Antwortcode und eine Auflistung der Objekte microsoft.graph.cloudLicensing.allotment im Antworttext zurück.
Beispiele
Beispiel 1: Zuteilungen abrufen
Das folgende Beispiel zeigt, wie Sie Zuteilungsobjekte abrufen.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
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()
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
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"
}
]
}
Beispiel 2: Zuteilungen mit wartenden Mitgliedern erhalten
Das folgende Beispiel zeigt, wie Sie Zuteilungsobjekte abrufen, einschließlich ihrer waitingMembers.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
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)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
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"
}
]
}
]
}
Beispiel 3: Zuteilungen abrufen und zugeteilte Einheiten aggregieren
Das folgende Beispiel zeigt, wie Sie Zuteilungsobjekte abrufen und zugewiesene Einheiten aggregieren.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
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)
Antwort
Das folgende Beispiel zeigt die Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
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
}
]
}