Create cloudPcExportJob

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Create a new cloudPcExportJob resource to initiate downloading the entire or specified portion of a report.

Use the GET cloudPcExportJob operation to verify the exportJobStatus property of the cloudPcExportJob resource. When the property result is completed, the report has finished downloading to the location specified by the exportUrl property.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) CloudPC.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application CloudPC.ReadWrite.All Not available.

HTTP request

POST /deviceManagement/virtualEndpoint/reports/exportJobs

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the cloudPcExportJob object.

You can specify the following properties when creating a cloudPcExportJob.

Property Type Description
filter String The filter applied on the report. Optional.
format String The format of the exported report. Optional.
reportName cloudPcReportName The report name. The possible values are: remoteConnectionHistoricalReports, dailyAggregatedRemoteConnectionReports, totalAggregatedRemoteConnectionReports, sharedUseLicenseUsageReport, sharedUseLicenseUsageRealTimeReport, unknownFutureValue, noLicenseAvailableConnectivityFailureReport, frontlineLicenseUsageReport, frontlineLicenseUsageRealTimeReport, remoteConnectionQualityReports, inaccessibleCloudPcReports. You must use the Prefer: include-unknown-enum-members request header to get the following value(s) in this evolvable enum: noLicenseAvailableConnectivityFailureReport, frontlineLicenseUsageReport, frontlineLicenseUsageRealTimeReport, inaccessibleCloudPcReports.
select String collection The selected columns of the report. Optional.

Response

If successful, this method returns a 201 Created response code and a cloudPcExportJob object in the response body.

Examples

Example 1: Create an export job to download the TotalAggregatedRemoteConnectionReports report

The following example shows how to create an export job to download the TotalAggregatedRemoteConnectionReports report.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/reports/exportJobs
Content-Type: application/json
Content-length: 315

{
  "reportName": "TotalAggregatedRemoteConnectionReports",
  "select": [
    "CloudPcId",
    "ManagedDeviceName",
    "UserPrincipalName",
    "DaysSinceLastSignIn",
    "TotalUsageInHour"
  ]
}

Response

The following example shows the response.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement/virtualEndpoint/reports/exportJobs/$entity",
  "id": "TotalAggregatedRemoteConnectionReports__d39979c9-a0a2-4916-a158-1b984742ffff",
  "reportName": "totalAggregatedRemoteConnectionReports",
  "filter": null,
  "select": [
    "CloudPcId",
    "ManagedDeviceName",
    "UserPrincipalName",
    "DaysSinceLastSignIn",
    "TotalUsageInHour"
  ],
  "format": null,
  "expirationDateTime": "0001-01-01T00:00:00Z",
  "requestDateTime": "2022-09-16T12:00:06.5137388Z",
  "exportJobStatus": "inProgress",
  "exportUrl": null
}

Example 2: Create an export job to download the RemoteConnectionQualityReports report.

The following example shows how to create an export job to download the RemoteConnectionQualityReports report.

Request

The following example shows a request.

POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/reports/exportJobs
Content-Type: application/json
Content-length: 315

{
  "reportName": "RemoteConnectionQualityReports",
  "select": [
    "CloudPcId",
    "ManagedDeviceName",
    "AvgRoundTripTimeInMsP50",
    "LastConnectionRoundTripTimeInMs",
    "AvgAvailableBandwidthInMBpsP50",
    "LastConnectionAvailableBandWidthInMSps",
    "AvgRemoteSignInTimeInSecP50",
    "UDPConnectionPercentage",
    "LastConnectionGateway",
    "LastConnectionProtocol",
    "EventDateTime"
  ],
  "filter": "EventDateTime gt datetime'2023-06-14T07:40:41.694Z'"
}

Response

The following example shows the response.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement/virtualEndpoint/reports/exportJobs/$entity",
  "id": "RemoteConnectionQualityReports__85678957-6202-4e29-97e6-eb26ef07f330",
  "reportName": "remoteConnectionQualityReports",
  "filter": "EventDateTime gt datetime'2023-06-14T07:40:41.694Z'",
  "select": [
    "CloudPcId",
    "ManagedDeviceName",
    "AvgRoundTripTimeInMsP50",
    "LastConnectionRoundTripTimeInMs",
    "AvgAvailableBandwidthInMBpsP50",
    "LastConnectionAvailableBandWidthInMSps",
    "AvgRemoteSignInTimeInSecP50",
    "UDPConnectionPercentage",
    "LastConnectionGateway",
    "LastConnectionProtocol",
    "EventDateTime"
  ],
  "format": null,
  "expirationDateTime": null,
  "requestDateTime": "2023-06-14T07:40:41.694Z",
  "exportJobStatus": "inProgress",
  "exportUrl": null
}