Namespace: microsoft.graph
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.
Abrufen von Cloud-PC-Empfehlungsberichten zur Nutzungsoptimierung und Kosteneinsparung. Der Nutzungskategoriebericht kategorisiert einen Cloud-PC als , , oder Underutilizedund enthält auch die empfohlene SKU, wenn der Cloud-PC nicht RightsizedRightsizedist. OversizedUndersized
API-Verfügbarkeit
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) |
CloudPC.ReadWrite.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
CloudPC.ReadWrite.All |
Nicht verfügbar. |
HTTP-Anforderung
POST /deviceManagement/virtualEndpoint/report/retrieveCloudPcRecommendationReports
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung der Parameter an.
Die folgende Tabelle zeigt die Parameter, die Sie bei dieser Aktion verwenden können.
| Parameter |
Typ |
Beschreibung |
| filter |
Zeichenfolge |
OData-Syntax $filter Unterstützte Filter sind: and, or, lt, le, gtge, und eq. Optional. |
| groupBy |
String collection |
Gibt die Gruppierung der Berichte an. Wenn verwendet, muss er denselben Inhalt wie der select-Parameter haben. Optional. |
| orderBy |
String collection |
Gibt die Sortierung der Berichte an Optional. |
| reportType |
cloudPcRecommendationReportType |
Der Berichtstyp. Unterstützt eine Teilmenge der Werte für cloudPcRecommendationReportType. Der unterstützte Wert ist cloudPcUsageCategoryReport. Erforderlich. |
| search |
Zeichenfolge |
Gibt eine Zeichenfolge an, die durchsucht werden soll. Optional. |
| select |
String collection |
OData-Syntax $select Die ausgewählten Spalten der Berichte. Optional. |
| skip |
Int32 |
Anzahl der zu überspringenden Datensätze Optional. |
| Nach oben |
Int32 |
Die Anzahl der Top-Datensätze, die zurückgegeben werden sollen. Optional. |
Antwort
Bei erfolgreicher Ausführung gibt diese Aktion einen 200 OK Antwortcode und einen Stream im Antworttext zurück.
Beispiele
Beispiel 1: Abrufen von Berichten zu Geräteempfehlungen, gruppiert nach Serviceplan und Nutzungskategorie
Das folgende Beispiel zeigt, wie Sie Geräteempfehlungsberichte erhalten, die nach Serviceplan und Nutzungskategorie gruppiert sind.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/report/retrieveCloudPcRecommendationReports
Content-Type: application/json
{
"reportType": "cloudPcUsageCategoryReport",
"select": [
"ServicePlanId",
"ServicePlanName",
"UsageInsight"
],
"groupBy": [
"ServicePlanId",
"ServicePlanName",
"UsageInsight"
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.DeviceManagement.VirtualEndpoint.Report.RetrieveCloudPcRecommendationReports;
using Microsoft.Graph.Beta.Models;
var requestBody = new RetrieveCloudPcRecommendationReportsPostRequestBody
{
ReportType = CloudPcRecommendationReportType.CloudPcUsageCategoryReport,
Select = new List<string>
{
"ServicePlanId",
"ServicePlanName",
"UsageInsight",
},
GroupBy = new List<string>
{
"ServicePlanId",
"ServicePlanName",
"UsageInsight",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.DeviceManagement.VirtualEndpoint.Report.RetrieveCloudPcRecommendationReports.PostAsync(requestBody);
// 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"
graphdevicemanagement "github.com/microsoftgraph/msgraph-beta-sdk-go/devicemanagement"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphdevicemanagement.NewRetrieveCloudPcRecommendationReportsPostRequestBody()
reportType := graphmodels.CLOUDPCUSAGECATEGORYREPORT_CLOUDPCRECOMMENDATIONREPORTTYPE
requestBody.SetReportType(&reportType)
select := []string {
"ServicePlanId",
"ServicePlanName",
"UsageInsight",
}
requestBody.SetSelect(select)
groupBy := []string {
"ServicePlanId",
"ServicePlanName",
"UsageInsight",
}
requestBody.SetGroupBy(groupBy)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.DeviceManagement().VirtualEndpoint().Report().RetrieveCloudPcRecommendationReports().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.devicemanagement.virtualendpoint.report.retrievecloudpcrecommendationreports.RetrieveCloudPcRecommendationReportsPostRequestBody retrieveCloudPcRecommendationReportsPostRequestBody = new com.microsoft.graph.beta.devicemanagement.virtualendpoint.report.retrievecloudpcrecommendationreports.RetrieveCloudPcRecommendationReportsPostRequestBody();
retrieveCloudPcRecommendationReportsPostRequestBody.setReportType(CloudPcRecommendationReportType.CloudPcUsageCategoryReport);
LinkedList<String> select = new LinkedList<String>();
select.add("ServicePlanId");
select.add("ServicePlanName");
select.add("UsageInsight");
retrieveCloudPcRecommendationReportsPostRequestBody.setSelect(select);
LinkedList<String> groupBy = new LinkedList<String>();
groupBy.add("ServicePlanId");
groupBy.add("ServicePlanName");
groupBy.add("UsageInsight");
retrieveCloudPcRecommendationReportsPostRequestBody.setGroupBy(groupBy);
graphClient.deviceManagement().virtualEndpoint().report().retrieveCloudPcRecommendationReports().post(retrieveCloudPcRecommendationReportsPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const stream = {
reportType: 'cloudPcUsageCategoryReport',
select: [
'ServicePlanId',
'ServicePlanName',
'UsageInsight'
],
groupBy: [
'ServicePlanId',
'ServicePlanName',
'UsageInsight'
]
};
await client.api('/deviceManagement/virtualEndpoint/report/retrieveCloudPcRecommendationReports')
.version('beta')
.post(stream);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\DeviceManagement\VirtualEndpoint\Report\RetrieveCloudPcRecommendationReports\RetrieveCloudPcRecommendationReportsPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\CloudPcRecommendationReportType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new RetrieveCloudPcRecommendationReportsPostRequestBody();
$requestBody->setReportType(new CloudPcRecommendationReportType('cloudPcUsageCategoryReport'));
$requestBody->setSelect(['ServicePlanId', 'ServicePlanName', 'UsageInsight', ]);
$requestBody->setGroupBy(['ServicePlanId', 'ServicePlanName', 'UsageInsight', ]);
$graphServiceClient->deviceManagement()->virtualEndpoint()->report()->retrieveCloudPcRecommendationReports()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.devicemanagement.virtualendpoint.report.retrieve_cloud_pc_recommendation_reports.retrieve_cloud_pc_recommendation_reports_post_request_body import RetrieveCloudPcRecommendationReportsPostRequestBody
from msgraph_beta.generated.models.cloud_pc_recommendation_report_type import CloudPcRecommendationReportType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RetrieveCloudPcRecommendationReportsPostRequestBody(
report_type = CloudPcRecommendationReportType.CloudPcUsageCategoryReport,
select = [
"ServicePlanId",
"ServicePlanName",
"UsageInsight",
],
group_by = [
"ServicePlanId",
"ServicePlanName",
"UsageInsight",
],
)
await graph_client.device_management.virtual_endpoint.report.retrieve_cloud_pc_recommendation_reports.post(request_body)
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/octet-stream
{
"TotalRowCount": 15,
"Schema": [
{
"Column": "__Count",
"PropertyType": "Int32"
},
{
"Column": "ServicePlanId",
"PropertyType": "String"
},
{
"Column": "ServicePlanName",
"PropertyType": "String"
},
{
"Column": "UsageInsight",
"PropertyType": "String"
}
],
"Values": [
[
26,
"d3468c8c-3545-4f44-a32f-b465934d2498",
"Cloud PC Enterprise 2vCPU/8GB/256GB",
"Undersized"
],
[
12,
"d3468c8c-3545-4f44-a32f-b465934d2498",
"Cloud PC Enterprise 2vCPU/8GB/256GB",
"Oversized"
],
[
300,
"d3468c8c-3545-4f44-a32f-b465934d2498",
"Cloud PC Enterprise 2vCPU/8GB/256GB",
"Rightsized"
],
[
4,
"d3468c8c-3545-4f44-a32f-b465934d2498",
"Cloud PC Enterprise 2vCPU/8GB/256GB",
"Underutilized"
]
]
}
Beispiel 2: Abrufen von Berichten über die Kategorie "Gerätenutzung" für Cloud-PCs
Das folgende Beispiel zeigt, wie Sie detaillierte Berichte über die Nutzungskategorie für einzelne Cloud-PCs erhalten.
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/report/retrieveCloudPcRecommendationReports
Content-Type: application/json
{
"reportType": "cloudPcUsageCategoryReport",
"filter": "",
"select": [
"CloudPcId",
"ManagedDeviceName",
"UserPrincipalName",
"ServicePlanId",
"ServicePlanName",
"UsageInsight",
"RecommendedPlanId",
"RecommendedPlanName"
],
"search": "",
"skip": 0,
"top": 15
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.DeviceManagement.VirtualEndpoint.Report.RetrieveCloudPcRecommendationReports;
using Microsoft.Graph.Beta.Models;
var requestBody = new RetrieveCloudPcRecommendationReportsPostRequestBody
{
ReportType = CloudPcRecommendationReportType.CloudPcUsageCategoryReport,
Filter = "",
Select = new List<string>
{
"CloudPcId",
"ManagedDeviceName",
"UserPrincipalName",
"ServicePlanId",
"ServicePlanName",
"UsageInsight",
"RecommendedPlanId",
"RecommendedPlanName",
},
Search = "",
Skip = 0,
Top = 15,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.DeviceManagement.VirtualEndpoint.Report.RetrieveCloudPcRecommendationReports.PostAsync(requestBody);
// 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"
graphdevicemanagement "github.com/microsoftgraph/msgraph-beta-sdk-go/devicemanagement"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphdevicemanagement.NewRetrieveCloudPcRecommendationReportsPostRequestBody()
reportType := graphmodels.CLOUDPCUSAGECATEGORYREPORT_CLOUDPCRECOMMENDATIONREPORTTYPE
requestBody.SetReportType(&reportType)
filter := ""
requestBody.SetFilter(&filter)
select := []string {
"CloudPcId",
"ManagedDeviceName",
"UserPrincipalName",
"ServicePlanId",
"ServicePlanName",
"UsageInsight",
"RecommendedPlanId",
"RecommendedPlanName",
}
requestBody.SetSelect(select)
search := ""
requestBody.SetSearch(&search)
skip := int32(0)
requestBody.SetSkip(&skip)
top := int32(15)
requestBody.SetTop(&top)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.DeviceManagement().VirtualEndpoint().Report().RetrieveCloudPcRecommendationReports().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.devicemanagement.virtualendpoint.report.retrievecloudpcrecommendationreports.RetrieveCloudPcRecommendationReportsPostRequestBody retrieveCloudPcRecommendationReportsPostRequestBody = new com.microsoft.graph.beta.devicemanagement.virtualendpoint.report.retrievecloudpcrecommendationreports.RetrieveCloudPcRecommendationReportsPostRequestBody();
retrieveCloudPcRecommendationReportsPostRequestBody.setReportType(CloudPcRecommendationReportType.CloudPcUsageCategoryReport);
retrieveCloudPcRecommendationReportsPostRequestBody.setFilter("");
LinkedList<String> select = new LinkedList<String>();
select.add("CloudPcId");
select.add("ManagedDeviceName");
select.add("UserPrincipalName");
select.add("ServicePlanId");
select.add("ServicePlanName");
select.add("UsageInsight");
select.add("RecommendedPlanId");
select.add("RecommendedPlanName");
retrieveCloudPcRecommendationReportsPostRequestBody.setSelect(select);
retrieveCloudPcRecommendationReportsPostRequestBody.setSearch("");
retrieveCloudPcRecommendationReportsPostRequestBody.setSkip(0);
retrieveCloudPcRecommendationReportsPostRequestBody.setTop(15);
graphClient.deviceManagement().virtualEndpoint().report().retrieveCloudPcRecommendationReports().post(retrieveCloudPcRecommendationReportsPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const stream = {
reportType: 'cloudPcUsageCategoryReport',
filter: '',
select: [
'CloudPcId',
'ManagedDeviceName',
'UserPrincipalName',
'ServicePlanId',
'ServicePlanName',
'UsageInsight',
'RecommendedPlanId',
'RecommendedPlanName'
],
search: '',
skip: 0,
top: 15
};
await client.api('/deviceManagement/virtualEndpoint/report/retrieveCloudPcRecommendationReports')
.version('beta')
.post(stream);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\DeviceManagement\VirtualEndpoint\Report\RetrieveCloudPcRecommendationReports\RetrieveCloudPcRecommendationReportsPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\CloudPcRecommendationReportType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new RetrieveCloudPcRecommendationReportsPostRequestBody();
$requestBody->setReportType(new CloudPcRecommendationReportType('cloudPcUsageCategoryReport'));
$requestBody->setFilter('');
$requestBody->setSelect(['CloudPcId', 'ManagedDeviceName', 'UserPrincipalName', 'ServicePlanId', 'ServicePlanName', 'UsageInsight', 'RecommendedPlanId', 'RecommendedPlanName', ]);
$requestBody->setSearch('');
$requestBody->setSkip(0);
$requestBody->setTop(15);
$graphServiceClient->deviceManagement()->virtualEndpoint()->report()->retrieveCloudPcRecommendationReports()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.devicemanagement.virtualendpoint.report.retrieve_cloud_pc_recommendation_reports.retrieve_cloud_pc_recommendation_reports_post_request_body import RetrieveCloudPcRecommendationReportsPostRequestBody
from msgraph_beta.generated.models.cloud_pc_recommendation_report_type import CloudPcRecommendationReportType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RetrieveCloudPcRecommendationReportsPostRequestBody(
report_type = CloudPcRecommendationReportType.CloudPcUsageCategoryReport,
filter = "",
select = [
"CloudPcId",
"ManagedDeviceName",
"UserPrincipalName",
"ServicePlanId",
"ServicePlanName",
"UsageInsight",
"RecommendedPlanId",
"RecommendedPlanName",
],
search = "",
skip = 0,
top = 15,
)
await graph_client.device_management.virtual_endpoint.report.retrieve_cloud_pc_recommendation_reports.post(request_body)
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/octet-stream
{
"TotalRowCount": 15,
"Schema": [
{
"Column": "CloudPcId",
"PropertyType": "String"
},
{
"Column": "ManagedDeviceName",
"PropertyType": "String"
},
{
"Column": "UserPrincipalName",
"PropertyType": "String"
},
{
"Column": "ServicePlanId",
"PropertyType": "String"
},
{
"Column": "ServicePlanName",
"PropertyType": "String"
},
{
"Column": "UsageInsight",
"PropertyType": "String"
},
{
"Column": "RecommendedPlanId",
"PropertyType": "String"
},
{
"Column": "RecommendedPlanName",
"PropertyType": "String"
}
],
"Values": [
[
"1f574bb6-ac68-4f27-be1e-b810ae5e3b52",
"CPC-Test-001",
"test001@fabrikam.com",
"d3468c8c-3545-4f44-a32f-b465934d2498",
"Cloud PC Enterprise 2vCPU/8GB/256GB",
"Undersized",
"2de9c682-ca3f-4f2b-b360-dfc4775db133",
"Cloud PC Enterprise 4vCPU/16GB/128GB"
],
[
"37ea6497-83fb-474b-b07b-54f0ac16f3ed",
"CPC-Test-002",
"test002@fabrikam.com",
"d3468c8c-3545-4f44-a32f-b465934d2498",
"Cloud PC Enterprise 2vCPU/8GB/256GB",
"Oversized",
"0d143570-9b92-4f57-adb5-e4efcd23b3bb",
"Cloud PC Enterprise 2vCPU/4GB/256GB"
],
[
"4c6a1fb2-1ac7-40fc-a213-fb0eaec872f3",
"CPC-Test-003",
"test003@fabrikam.com",
"d3468c8c-3545-4f44-a32f-b465934d2498",
"Cloud PC Enterprise 2vCPU/8GB/256GB",
"Rightsized",
null,
null
],
[
"632dbe76-2fe3-4a2f-8b91-8514ecfe9d8c",
"CPC-Test-004",
"test004@fabrikam.com",
"d3468c8c-3545-4f44-a32f-b465934d2498",
"Cloud PC Enterprise 2vCPU/8GB/256GB",
"Underutilized",
null,
null
]
]
}