Espacio de nombres: microsoft.graph
Importante
Las API de la versión /beta de Microsoft Graph están sujetas a cambios. No se admite el uso de estas API en aplicaciones de producción. Para determinar si una API está disponible en la versión 1.0, use el selector de Versión.
Recupera los informes de recomendaciones de PC en la nube para optimizar el uso y ahorrar costos. El informe de categorías de uso clasifica un PC en la nube como Undersized, Oversized, Rightsized, o , y Underutilizedtambién proporciona la SKU recomendada cuando el PC en la nube no Rightsizedlo es.
Disponibilidad de API
Esta API está disponible en las siguientes implementaciones en la nube nacional.
| Servicio global |
Administración pública de EE. UU. |
Gobierno de EE. UU. L5 (DOD) |
China operado por 21Vianet |
| ✅ |
✅ |
❌ |
❌ |
Permissions
Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use uno o varios permisos con privilegios más altos solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
| Tipo de permiso |
Permisos con privilegios mínimos |
Permisos con privilegios más altos |
| Delegado (cuenta profesional o educativa) |
CloudPC. ReadWrite. All |
No disponible. |
| Delegado (cuenta personal de Microsoft) |
No admitida. |
No admitida. |
| Aplicación |
CloudPC. ReadWrite. All |
No disponible. |
Solicitud HTTP
POST /deviceManagement/virtualEndpoint/report/retrieveCloudPcRecommendationReports
| Nombre |
Descripción |
| Authorization |
{token} de portador. Obligatorio. Obtenga más información sobre autenticación y autorización. |
| Content-Type |
application/json. Obligatorio. |
Cuerpo de la solicitud
En el cuerpo de la solicitud, proporcione una representación JSON de los parámetros.
La tabla siguiente muestra los parámetros que puede usar con esta acción.
| Parámetro |
Tipo |
Descripción |
| filter |
Cadena |
Sintaxis de $filter OData. Los filtros admitidos son: and, or, lt, gelegty .eq Opcional. |
| groupBy |
Colección string |
Especifica cómo agrupar los informes. Si se usa, debe tener el mismo contenido que el parámetro de selección . Opcional. |
| orderBy |
Colección string |
Especifica cómo ordenar los informes. Opcional. |
| reportType |
cloudPcRecommendationReportType |
El tipo de informe. Admite un subconjunto de los valores de cloudPcRecommendationReportType. El valor admitido es cloudPcUsageCategoryReport. Obligatorio. |
| buscar |
Cadena |
Especifica una cadena para buscar. Opcional. |
| select |
Colección string |
Sintaxis de $select OData. Las columnas seleccionadas de los informes. Opcional. |
| skip |
Int32 |
Número de registros que se van a omitir. Opcional. |
| top |
Int32 |
El número de registros principales que se van a devolver. Opcional. |
Respuesta
Si se realiza correctamente, esta acción devuelve un 200 OK código de respuesta y una secuencia en el cuerpo de la respuesta.
Ejemplos
Ejemplo 1: Obtener informes de recomendaciones de dispositivos agrupados por plan de servicio y categoría de uso
En el ejemplo siguiente se muestra cómo obtener informes de recomendaciones de dispositivos agrupados por plan de servicio y categoría de uso.
Solicitud
En el ejemplo siguiente se muestra la solicitud.
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)
Respuesta
En el ejemplo siguiente se muestra la respuesta.
Nota: Se puede acortar el objeto de respuesta que se muestra aquí para mejorar la legibilidad.
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"
]
]
}
Ejemplo 2: Obtener informes de categorías de uso de dispositivos para equipos en la nube
En el ejemplo siguiente se muestra cómo obtener informes detallados de categorías de uso para PC en la nube individuales.
Solicitud
En el ejemplo siguiente se muestra la solicitud.
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)
Respuesta
En el ejemplo siguiente se muestra la respuesta.
Nota: Se puede acortar el objeto de respuesta que se muestra aquí para mejorar la legibilidad.
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
]
]
}