名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
使用状況の最適化とコスト削減のためのクラウド PC 推奨 レポート を取得します。 使用状況カテゴリ レポートは、クラウド PC を Undersized、 Oversized、 Rightsized、または Underutilized に分類し、クラウド PC が Rightsizedしていない場合に推奨される SKU も提供します。
API の可用性
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
CloudPC.ReadWrite.All |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
CloudPC.ReadWrite.All |
注意事項なし。 |
HTTP 要求
POST /deviceManagement/virtualEndpoint/report/retrieveCloudPcRecommendationReports
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、パラメーターの JSON 表現を指定します。
次の表に、このアクションで使用できるパラメーターを示します。
| パラメーター |
型 |
説明 |
| filter |
文字列 |
OData $filter 構文。 サポートされているフィルターは、 and、 or、 lt、 le、 gt、 ge、 eq です。 省略可能。 |
| groupBy |
String collection |
レポートをグループ化する方法を指定します。 使用する場合は、 select パラメーターと同じ内容である必要があります。 省略可能。 |
| orderBy |
String collection |
レポートの並べ替えの方法を指定します。 省略可能。 |
| reportType |
cloudPcRecommendationReportType |
レポートの種類。
cloudPcRecommendationReportType の値のサブセットをサポートします。 サポートされている値は cloudPcUsageCategoryReport です。 必須です。 |
| search |
文字列 |
検索する文字列を指定します。 省略可能。 |
| select |
String collection |
OData $select 構文。 レポートの選択された列。 省略可能。 |
| skip |
Int32 |
スキップするレコードの数。 省略可能。 |
| top |
Int32 |
返される上位レコードの数。 省略可能。 |
応答
成功した場合、このアクションは 200 OK 応答コードと応答本文のストリームを返します。
例
例 1: サービス プランと使用状況カテゴリごとにグループ化されたデバイスの推奨事項レポートを取得する
次の例は、サービス プランと使用状況カテゴリ別にグループ化されたデバイスの推奨事項レポートを取得する方法を示しています。
要求
次の例は要求を示しています。
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)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
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"
]
]
}
例 2: クラウド PC のデバイス使用状況カテゴリ レポートを取得する
次の例は、個々のクラウド PC の詳細な使用状況カテゴリ レポートを取得する方法を示しています。
要求
次の例は要求を示しています。
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)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
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
]
]
}