Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
Obtenez les rapports de recommandation d’appareil pour les PC cloud, tels que le rapport de catégorie d’utilisation. Le rapport de catégorie d’utilisation classe un PC cloud en tant que Undersized, Oversized, Rightsizedou Underutilized, et fournit également la référence SKU recommandée lorsque le PC cloud n’est pas Rightsized.
Spécifie le nom du rapport. Prend en charge un sous-ensemble des valeurs pour cloudPcReportName. Les valeurs prises en charge sont : cloudPcUsageCategoryReports.
recherche
Chaîne
Spécifie une chaîne à rechercher.
select
String collection
Syntaxe OData $select . Colonnes sélectionnées des rapports.
skip
Int32
Nombre d’enregistrements à ignorer.
top
Int32
Nombre d’enregistrements principaux à retourner.
Réponse
Si elle réussit, cette action renvoie un 200 OK code de réponse et un flux dans le corps de la réponse.
Exemples
Exemple 1 : Répertorier les rapports de recommandation par appareil
L’exemple suivant montre comment répertorier les rapports des 50 premiers appareils.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.DeviceManagement.VirtualEndpoint.Reports.GetCloudPcRecommendationReports;
using Microsoft.Graph.Beta.Models;
var requestBody = new GetCloudPcRecommendationReportsPostRequestBody
{
ReportName = CloudPcReportName.CloudPcUsageCategoryReports,
Top = 50,
Skip = 0,
Search = "",
Filter = "",
Select = new List<string>
{
"CloudPcId",
"ManagedDeviceName",
"UserPrincipalName",
"UsageInsight",
"CurrentSize",
"RecommendedSize",
"UsageInHour",
"DevicePerfSummary",
},
OrderBy = new List<string>
{
"ManagedDeviceName",
},
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.DeviceManagement.VirtualEndpoint.Reports.GetCloudPcRecommendationReports.PostAsync(requestBody);
// 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.reports.getcloudpcrecommendationreports.GetCloudPcRecommendationReportsPostRequestBody getCloudPcRecommendationReportsPostRequestBody = new com.microsoft.graph.beta.devicemanagement.virtualendpoint.reports.getcloudpcrecommendationreports.GetCloudPcRecommendationReportsPostRequestBody();
getCloudPcRecommendationReportsPostRequestBody.setReportName(CloudPcReportName.CloudPcUsageCategoryReports);
getCloudPcRecommendationReportsPostRequestBody.setTop(50);
getCloudPcRecommendationReportsPostRequestBody.setSkip(0);
getCloudPcRecommendationReportsPostRequestBody.setSearch("");
getCloudPcRecommendationReportsPostRequestBody.setFilter("");
LinkedList<String> select = new LinkedList<String>();
select.add("CloudPcId");
select.add("ManagedDeviceName");
select.add("UserPrincipalName");
select.add("UsageInsight");
select.add("CurrentSize");
select.add("RecommendedSize");
select.add("UsageInHour");
select.add("DevicePerfSummary");
getCloudPcRecommendationReportsPostRequestBody.setSelect(select);
LinkedList<String> orderBy = new LinkedList<String>();
orderBy.add("ManagedDeviceName");
getCloudPcRecommendationReportsPostRequestBody.setOrderBy(orderBy);
graphClient.deviceManagement().virtualEndpoint().reports().getCloudPcRecommendationReports().post(getCloudPcRecommendationReportsPostRequestBody);
# 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.reports.get_cloud_pc_recommendation_reports.get_cloud_pc_recommendation_reports_post_request_body import GetCloudPcRecommendationReportsPostRequestBody
from msgraph_beta.generated.models.cloud_pc_report_name import CloudPcReportName
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = GetCloudPcRecommendationReportsPostRequestBody(
report_name = CloudPcReportName.CloudPcUsageCategoryReports,
top = 50,
skip = 0,
search = "",
filter = "",
select = [
"CloudPcId",
"ManagedDeviceName",
"UserPrincipalName",
"UsageInsight",
"CurrentSize",
"RecommendedSize",
"UsageInHour",
"DevicePerfSummary",
],
order_by = [
"ManagedDeviceName",
],
)
await graph_client.device_management.virtual_endpoint.reports.get_cloud_pc_recommendation_reports.post(request_body)
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.DeviceManagement.VirtualEndpoint.Reports.GetCloudPcRecommendationReports;
using Microsoft.Graph.Beta.Models;
var requestBody = new GetCloudPcRecommendationReportsPostRequestBody
{
ReportName = CloudPcReportName.CloudPcUsageCategoryReports,
Select = new List<string>
{
"UsageInsight",
},
GroupBy = new List<string>
{
"UsageInsight",
},
Filter = "",
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.DeviceManagement.VirtualEndpoint.Reports.GetCloudPcRecommendationReports.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.NewGetCloudPcRecommendationReportsPostRequestBody()
reportName := graphmodels.CLOUDPCUSAGECATEGORYREPORTS_CLOUDPCREPORTNAME
requestBody.SetReportName(&reportName)
select := []string {
"UsageInsight",
}
requestBody.SetSelect(select)
groupBy := []string {
"UsageInsight",
}
requestBody.SetGroupBy(groupBy)
filter := ""
requestBody.SetFilter(&filter)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.DeviceManagement().VirtualEndpoint().Reports().GetCloudPcRecommendationReports().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.reports.getcloudpcrecommendationreports.GetCloudPcRecommendationReportsPostRequestBody getCloudPcRecommendationReportsPostRequestBody = new com.microsoft.graph.beta.devicemanagement.virtualendpoint.reports.getcloudpcrecommendationreports.GetCloudPcRecommendationReportsPostRequestBody();
getCloudPcRecommendationReportsPostRequestBody.setReportName(CloudPcReportName.CloudPcUsageCategoryReports);
LinkedList<String> select = new LinkedList<String>();
select.add("UsageInsight");
getCloudPcRecommendationReportsPostRequestBody.setSelect(select);
LinkedList<String> groupBy = new LinkedList<String>();
groupBy.add("UsageInsight");
getCloudPcRecommendationReportsPostRequestBody.setGroupBy(groupBy);
getCloudPcRecommendationReportsPostRequestBody.setFilter("");
graphClient.deviceManagement().virtualEndpoint().reports().getCloudPcRecommendationReports().post(getCloudPcRecommendationReportsPostRequestBody);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\DeviceManagement\VirtualEndpoint\Reports\GetCloudPcRecommendationReports\GetCloudPcRecommendationReportsPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\CloudPcReportName;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new GetCloudPcRecommendationReportsPostRequestBody();
$requestBody->setReportName(new CloudPcReportName('cloudPcUsageCategoryReports'));
$requestBody->setSelect(['UsageInsight', ]);
$requestBody->setGroupBy(['UsageInsight', ]);
$requestBody->setFilter('');
$graphServiceClient->deviceManagement()->virtualEndpoint()->reports()->getCloudPcRecommendationReports()->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.reports.get_cloud_pc_recommendation_reports.get_cloud_pc_recommendation_reports_post_request_body import GetCloudPcRecommendationReportsPostRequestBody
from msgraph_beta.generated.models.cloud_pc_report_name import CloudPcReportName
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = GetCloudPcRecommendationReportsPostRequestBody(
report_name = CloudPcReportName.CloudPcUsageCategoryReports,
select = [
"UsageInsight",
],
group_by = [
"UsageInsight",
],
filter = "",
)
await graph_client.device_management.virtual_endpoint.reports.get_cloud_pc_recommendation_reports.post(request_body)