Compartilhar via


DeviceManagementAsyncClient Class

  • java.lang.Object
    • com.azure.iot.deviceupdate.DeviceManagementAsyncClient

public final class DeviceManagementAsyncClient

Initializes a new instance of the asynchronous DeviceUpdateClient type.

Method Summary

Modifier and Type Method and Description
PollerFlux<BinaryData,BinaryData> beginImportDevices(BinaryData importType, RequestOptions requestOptions)

Import existing devices from IoT Hub.

Mono<Response<BinaryData>> createOrUpdateDeploymentWithResponse(String groupId, String deploymentId, BinaryData deployment, RequestOptions requestOptions)

Creates or updates a deployment.

Mono<Response<Void>> deleteDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Deletes a device class subgroup deployment.

Mono<Response<Void>> deleteDeploymentWithResponse(String groupId, String deploymentId, RequestOptions requestOptions)

Deletes a deployment.

Mono<Response<Void>> deleteDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions)

Deletes a device class subgroup.

Mono<Response<Void>> deleteDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions)

Deletes a device class.

Mono<Response<Void>> deleteGroupWithResponse(String groupId, RequestOptions requestOptions)

Deletes a device group.

Mono<Response<BinaryData>> getBestUpdatesForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions)

Get the best available update for a device class subgroup and a count of how many devices need this update.

Mono<Response<BinaryData>> getDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Gets the deployment properties.

Mono<Response<BinaryData>> getDeploymentStatusWithResponse(String groupId, String deploymentId, RequestOptions requestOptions)

Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed.

Mono<Response<BinaryData>> getDeploymentWithResponse(String groupId, String deploymentId, RequestOptions requestOptions)

Gets the deployment properties.

Mono<Response<BinaryData>> getDeviceClassSubgroupDeploymentStatusWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed.

Mono<Response<BinaryData>> getDeviceClassSubgroupUpdateComplianceWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions)

Get device class subgroup update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update.

Mono<Response<BinaryData>> getDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions)

Gets device class subgroup details.

Mono<Response<BinaryData>> getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions)

Gets the properties of a device class.

Mono<Response<BinaryData>> getDeviceModuleWithResponse(String deviceId, String moduleId, RequestOptions requestOptions)

Gets the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub.

Mono<Response<BinaryData>> getDeviceWithResponse(String deviceId, RequestOptions requestOptions)

Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub.

Mono<Response<BinaryData>> getGroupWithResponse(String groupId, RequestOptions requestOptions)

Gets the device group properties.

Mono<Response<BinaryData>> getLogCollectionDetailedStatusWithResponse(String logCollectionId, RequestOptions requestOptions)

Get log collection with detailed status.

Mono<Response<BinaryData>> getLogCollectionWithResponse(String logCollectionId, RequestOptions requestOptions)

Get the device diagnostics log collection.

Mono<Response<BinaryData>> getOperationStatusWithResponse(String operationId, RequestOptions requestOptions)

Retrieve operation status.

Mono<Response<BinaryData>> getUpdateComplianceForGroupWithResponse(String groupId, RequestOptions requestOptions)

Get device group update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update.

Mono<Response<BinaryData>> getUpdateComplianceWithResponse(RequestOptions requestOptions)

Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates.

PagedFlux<BinaryData> listBestUpdatesForGroup(String groupId, RequestOptions requestOptions)

Get the best available updates for a device group and a count of how many devices need each update.

PagedFlux<BinaryData> listDeploymentsForDeviceClassSubgroup(String groupId, String deviceClassId, RequestOptions requestOptions)

Gets a list of deployments for a device class subgroup.

PagedFlux<BinaryData> listDeploymentsForGroup(String groupId, RequestOptions requestOptions)

Gets a list of deployments for a device group.

PagedFlux<BinaryData> listDeviceClassSubgroupsForGroup(String groupId, RequestOptions requestOptions)

Get the device class subgroups for the group.

PagedFlux<BinaryData> listDeviceClasses(RequestOptions requestOptions)

Gets a list of all device classes (sets of devices compatible with the same updates based on the model Id and compat properties reported in the Device Update PnP interface in IoT Hub) for all devices connected to Device Update for IoT Hub.

PagedFlux<BinaryData> listDeviceStatesForDeviceClassSubgroupDeployment(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Gets a list of devices in a deployment along with their state.

PagedFlux<BinaryData> listDevices(RequestOptions requestOptions)

Gets a list of devices connected to Device Update for IoT Hub.

PagedFlux<BinaryData> listGroups(RequestOptions requestOptions)

Gets a list of all device groups.

PagedFlux<BinaryData> listHealthOfDevices(String filter, RequestOptions requestOptions)

Get list of device health.

PagedFlux<BinaryData> listInstallableUpdatesForDeviceClass(String deviceClassId, RequestOptions requestOptions)

Gets a list of installable updates for a device class.

PagedFlux<BinaryData> listLogCollections(RequestOptions requestOptions)

Get all device diagnostics log collections.

PagedFlux<BinaryData> listOperationStatuses(RequestOptions requestOptions)

Get a list of all device import operations.

Mono<Response<BinaryData>> retryDeploymentWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Retries a deployment with failed devices.

Mono<Response<BinaryData>> startLogCollectionWithResponse(String logCollectionId, BinaryData logCollection, RequestOptions requestOptions)

Start the device diagnostics log collection on specified devices.

Mono<Response<BinaryData>> stopDeploymentWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Stops a deployment.

Mono<Response<BinaryData>> updateDeviceClassWithResponse(String deviceClassId, BinaryData deviceClassPatch, RequestOptions requestOptions)

Update device class details.

Methods inherited from java.lang.Object

Method Details

beginImportDevices

public PollerFlux beginImportDevices(BinaryData importType, RequestOptions requestOptions)

Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header value to check for operation status.

Request Body Schema

String(Devices/Modules/All)

Parameters:

importType - The types of devices to import.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the PollerFlux<T,U> for polling of long-running operation.

createOrUpdateDeploymentWithResponse

public Mono> createOrUpdateDeploymentWithResponse(String groupId, String deploymentId, BinaryData deployment, RequestOptions requestOptions)

Creates or updates a deployment.

Request Body Schema

{
     deploymentId: String (Required)
     startDateTime: OffsetDateTime (Required)
     update (Required): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
     groupId: String (Required)
     deviceClassSubgroups (Optional): [
         String (Optional)
     ]
     isCanceled: Boolean (Optional)
     isRetried: Boolean (Optional)
     rollbackPolicy (Optional): {
         update (Required): (recursive schema, see update above)
         failure (Required): {
             devicesFailedPercentage: int (Required)
             devicesFailedCount: int (Required)
         }
     }
     isCloudInitiatedRollback: Boolean (Optional)
 }

Response Body Schema

{
     deploymentId: String (Required)
     startDateTime: OffsetDateTime (Required)
     update (Required): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
     groupId: String (Required)
     deviceClassSubgroups (Optional): [
         String (Optional)
     ]
     isCanceled: Boolean (Optional)
     isRetried: Boolean (Optional)
     rollbackPolicy (Optional): {
         update (Required): (recursive schema, see update above)
         failure (Required): {
             devicesFailedPercentage: int (Required)
             devicesFailedCount: int (Required)
         }
     }
     isCloudInitiatedRollback: Boolean (Optional)
 }

Parameters:

groupId - Group identifier.
deploymentId - Deployment identifier.
deployment - The deployment properties.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

deployment metadata along with Response<T> on successful completion of Mono.

deleteDeploymentForDeviceClassSubgroupWithResponse

public Mono> deleteDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Deletes a device class subgroup deployment.

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
deploymentId - Deployment identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the Response<T> on successful completion of Mono.

deleteDeploymentWithResponse

public Mono> deleteDeploymentWithResponse(String groupId, String deploymentId, RequestOptions requestOptions)

Deletes a deployment.

Parameters:

groupId - Group identifier.
deploymentId - Deployment identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the Response<T> on successful completion of Mono.

deleteDeviceClassSubgroupWithResponse

public Mono> deleteDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions)

Deletes a device class subgroup. This subgroup is automatically created when a Device Update-enabled device is connected to the hub and reports its properties. Groups, subgroups, and deployments are not automatically cleaned up but are retained for history purposes. Users can call this method to delete a subgroup if they do not need to retain any of the history of the subgroup and no longer need it. If a device is ever connected again for this subgroup after the subgroup was deleted it will be automatically re-created but there will be no history.

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the Response<T> on successful completion of Mono.

deleteDeviceClassWithResponse

public Mono> deleteDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions)

Deletes a device class. Device classes are created automatically when Device Update-enabled devices are connected to the hub but are not automatically cleaned up since they are referenced by DeviceClassSubgroups. If the user has deleted all DeviceClassSubgroups for a device class they can also delete the device class to remove the records from the system and to stop checking the compatibility of this device class with new updates. If a device is ever reconnected for this device class it will be re-created.

Parameters:

deviceClassId - Device class identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the Response<T> on successful completion of Mono.

deleteGroupWithResponse

public Mono> deleteGroupWithResponse(String groupId, RequestOptions requestOptions)

Deletes a device group. This group is automatically created when a Device Update-enabled device is connected to the hub and reports its properties. Groups, subgroups, and deployments are not automatically cleaned up but are retained for history purposes. Users can call this method to delete a group if they do not need to retain any of the history of the group and no longer need it. If a device is ever connected again for this group after the group was deleted it will be automatically re-created but there will be no history.

Parameters:

groupId - Group identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the Response<T> on successful completion of Mono.

getBestUpdatesForDeviceClassSubgroupWithResponse

public Mono> getBestUpdatesForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions)

Get the best available update for a device class subgroup and a count of how many devices need this update.

Response Body Schema

{
     groupId: String (Required)
     deviceClassId: String (Required)
     update (Required): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
     deviceCount: int (Required)
 }

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the best available update for a device class subgroup and a count of how many devices need this update along with Response<T> on successful completion of Mono.

getDeploymentForDeviceClassSubgroupWithResponse

public Mono> getDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Gets the deployment properties.

Response Body Schema

{
     deploymentId: String (Required)
     startDateTime: OffsetDateTime (Required)
     update (Required): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
     groupId: String (Required)
     deviceClassSubgroups (Optional): [
         String (Optional)
     ]
     isCanceled: Boolean (Optional)
     isRetried: Boolean (Optional)
     rollbackPolicy (Optional): {
         update (Required): (recursive schema, see update above)
         failure (Required): {
             devicesFailedPercentage: int (Required)
             devicesFailedCount: int (Required)
         }
     }
     isCloudInitiatedRollback: Boolean (Optional)
 }

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
deploymentId - Deployment identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the deployment properties along with Response<T> on successful completion of Mono.

getDeploymentStatusWithResponse

public Mono> getDeploymentStatusWithResponse(String groupId, String deploymentId, RequestOptions requestOptions)

Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed.

Response Body Schema

{
     groupId: String (Required)
     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled) (Required)
     error (Optional): {
         code: String (Required)
         message: String (Required)
         target: String (Optional)
         details (Optional): [
             (recursive schema, see above)
         ]
         innererror (Optional): {
             code: String (Required)
             message: String (Optional)
             errorDetail: String (Optional)
             innerError (Optional): (recursive schema, see innerError above)
         }
         occurredDateTime: OffsetDateTime (Optional)
     }
     subgroupStatus (Required): [
          (Required){
             groupId: String (Required)
             deviceClassId: String (Required)
             deploymentState: String(Active/Failed/Inactive/Canceled) (Required)
             error (Optional): (recursive schema, see error above)
             totalDevices: Integer (Optional)
             devicesInProgressCount: Integer (Optional)
             devicesCompletedFailedCount: Integer (Optional)
             devicesCompletedSucceededCount: Integer (Optional)
             devicesCanceledCount: Integer (Optional)
         }
     ]
 }

Parameters:

groupId - Group identifier.
deploymentId - Deployment identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed along with Response<T> on successful completion of Mono.

getDeploymentWithResponse

public Mono> getDeploymentWithResponse(String groupId, String deploymentId, RequestOptions requestOptions)

Gets the deployment properties.

Response Body Schema

{
     deploymentId: String (Required)
     startDateTime: OffsetDateTime (Required)
     update (Required): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
     groupId: String (Required)
     deviceClassSubgroups (Optional): [
         String (Optional)
     ]
     isCanceled: Boolean (Optional)
     isRetried: Boolean (Optional)
     rollbackPolicy (Optional): {
         update (Required): (recursive schema, see update above)
         failure (Required): {
             devicesFailedPercentage: int (Required)
             devicesFailedCount: int (Required)
         }
     }
     isCloudInitiatedRollback: Boolean (Optional)
 }

Parameters:

groupId - Group identifier.
deploymentId - Deployment identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the deployment properties along with Response<T> on successful completion of Mono.

getDeviceClassSubgroupDeploymentStatusWithResponse

public Mono> getDeviceClassSubgroupDeploymentStatusWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed.

Response Body Schema

{
     groupId: String (Required)
     deviceClassId: String (Required)
     deploymentState: String(Active/Failed/Inactive/Canceled) (Required)
     error (Optional): {
         code: String (Required)
         message: String (Required)
         target: String (Optional)
         details (Optional): [
             (recursive schema, see above)
         ]
         innererror (Optional): {
             code: String (Required)
             message: String (Optional)
             errorDetail: String (Optional)
             innerError (Optional): (recursive schema, see innerError above)
         }
         occurredDateTime: OffsetDateTime (Optional)
     }
     totalDevices: Integer (Optional)
     devicesInProgressCount: Integer (Optional)
     devicesCompletedFailedCount: Integer (Optional)
     devicesCompletedSucceededCount: Integer (Optional)
     devicesCanceledCount: Integer (Optional)
 }

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
deploymentId - Deployment identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed along with Response<T> on successful completion of Mono.

getDeviceClassSubgroupUpdateComplianceWithResponse

public Mono> getDeviceClassSubgroupUpdateComplianceWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions)

Get device class subgroup update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update.

Response Body Schema

{
     totalDeviceCount: int (Required)
     onLatestUpdateDeviceCount: int (Required)
     newUpdatesAvailableDeviceCount: int (Required)
     updatesInProgressDeviceCount: int (Required)
 }

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

device class subgroup update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update along with Response<T> on successful completion of Mono.

getDeviceClassSubgroupWithResponse

public Mono> getDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions)

Gets device class subgroup details. A device class subgroup is the set of devices within the group that share the same device class. All devices within the same device class are compatible with the same updates.

Response Body Schema

{
     deviceClassId: String (Required)
     groupId: String (Required)
     createdDateTime: String (Required)
     deviceCount: Integer (Optional)
     deploymentId: String (Optional)
 }

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

device class subgroup details along with Response<T> on successful completion of Mono.

getDeviceClassWithResponse

public Mono> getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions)

Gets the properties of a device class.

Response Body Schema

{
     deviceClassId: String (Required)
     friendlyName: String (Optional)
     deviceClassProperties (Required): {
         contractModel (Optional): {
             id: String (Required)
             name: String (Required)
         }
         compatProperties (Required): {
             String: String (Required)
         }
     }
     bestCompatibleUpdate (Optional): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
 }

Parameters:

deviceClassId - Device class identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the properties of a device class along with Response<T> on successful completion of Mono.

getDeviceModuleWithResponse

public Mono> getDeviceModuleWithResponse(String deviceId, String moduleId, RequestOptions requestOptions)

Gets the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub.

Response Body Schema

{
     deviceId: String (Required)
     moduleId: String (Optional)
     deviceClassId: String (Required)
     groupId: String (Optional)
     lastAttemptedUpdate (Optional): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed) (Optional)
     installedUpdate (Optional): (recursive schema, see installedUpdate above)
     onLatestUpdate: boolean (Required)
     lastDeploymentId: String (Optional)
     lastInstallResult (Optional): {
         resultCode: int (Required)
         extendedResultCode: int (Required)
         resultDetails: String (Optional)
         stepResults (Optional): [
              (Optional){
                 update (Optional): (recursive schema, see update above)
                 description: String (Optional)
                 resultCode: int (Required)
                 extendedResultCode: int (Required)
                 resultDetails: String (Optional)
             }
         ]
     }
 }

Parameters:

deviceId - Device identifier in Azure IoT Hub.
moduleId - Device module identifier in Azure IoT Hub.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub along with Response<T> on successful completion of Mono.

getDeviceWithResponse

public Mono> getDeviceWithResponse(String deviceId, RequestOptions requestOptions)

Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub.

Response Body Schema

{
     deviceId: String (Required)
     moduleId: String (Optional)
     deviceClassId: String (Required)
     groupId: String (Optional)
     lastAttemptedUpdate (Optional): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed) (Optional)
     installedUpdate (Optional): (recursive schema, see installedUpdate above)
     onLatestUpdate: boolean (Required)
     lastDeploymentId: String (Optional)
     lastInstallResult (Optional): {
         resultCode: int (Required)
         extendedResultCode: int (Required)
         resultDetails: String (Optional)
         stepResults (Optional): [
              (Optional){
                 update (Optional): (recursive schema, see update above)
                 description: String (Optional)
                 resultCode: int (Required)
                 extendedResultCode: int (Required)
                 resultDetails: String (Optional)
             }
         ]
     }
 }

Parameters:

deviceId - Device identifier in Azure IoT Hub.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the device properties and latest deployment status for a device connected to Device Update for IoT Hub along with Response<T> on successful completion of Mono.

getGroupWithResponse

public Mono> getGroupWithResponse(String groupId, RequestOptions requestOptions)

Gets the device group properties.

Response Body Schema

{
     groupId: String (Required)
     groupType: String(IoTHubTag/DefaultNoTag) (Required)
     createdDateTime: String (Required)
     deviceCount: Integer (Optional)
     subgroupsWithNewUpdatesAvailableCount: Integer (Optional)
     subgroupsWithUpdatesInProgressCount: Integer (Optional)
     subgroupsWithOnLatestUpdateCount: Integer (Optional)
     deployments (Optional): [
         String (Optional)
     ]
 }

Parameters:

groupId - Group identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the device group properties along with Response<T> on successful completion of Mono.

getLogCollectionDetailedStatusWithResponse

public Mono> getLogCollectionDetailedStatusWithResponse(String logCollectionId, RequestOptions requestOptions)

Get log collection with detailed status.

Response Body Schema

{
     operationId: String (Optional)
     createdDateTime: String (Optional)
     lastActionDateTime: String (Optional)
     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
     deviceStatus (Optional): [
          (Optional){
             deviceId: String (Required)
             moduleId: String (Optional)
             status: String(NotStarted/Running/Succeeded/Failed) (Required)
             resultCode: String (Optional)
             extendedResultCode: String (Optional)
             logLocation: String (Optional)
         }
     ]
     description: String (Optional)
 }

Parameters:

logCollectionId - Log collection identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

log collection with detailed status along with Response<T> on successful completion of Mono.

getLogCollectionWithResponse

public Mono> getLogCollectionWithResponse(String logCollectionId, RequestOptions requestOptions)

Get the device diagnostics log collection.

Response Body Schema

{
     operationId: String (Optional)
     deviceList (Required): [
          (Required){
             deviceId: String (Required)
             moduleId: String (Optional)
         }
     ]
     description: String (Optional)
     createdDateTime: String (Optional)
     lastActionDateTime: String (Optional)
     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
 }

Parameters:

logCollectionId - Log collection identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the device diagnostics log collection along with Response<T> on successful completion of Mono.

getOperationStatusWithResponse

public Mono> getOperationStatusWithResponse(String operationId, RequestOptions requestOptions)

Retrieve operation status.

Header Parameters

| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Name          | Type   | Required | Description                                                                                                                    |
| If-None-Match | String | No       | Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. |

You can add these to a request with RequestOptions#addHeader

Response Body Schema

{
     operationId: String (Required)
     status: String(NotStarted/Running/Succeeded/Failed) (Required)
     error (Optional): {
         code: String (Required)
         message: String (Required)
         target: String (Optional)
         details (Optional): [
             (recursive schema, see above)
         ]
         innererror (Optional): {
             code: String (Required)
             message: String (Optional)
             errorDetail: String (Optional)
             innerError (Optional): (recursive schema, see innerError above)
         }
         occurredDateTime: OffsetDateTime (Optional)
     }
     traceId: String (Optional)
     lastActionDateTime: OffsetDateTime (Required)
     createdDateTime: OffsetDateTime (Required)
     etag: String (Optional)
 }

Parameters:

operationId - Operation identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

operation metadata along with Response<T> on successful completion of Mono.

getUpdateComplianceForGroupWithResponse

public Mono> getUpdateComplianceForGroupWithResponse(String groupId, RequestOptions requestOptions)

Get device group update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update.

Response Body Schema

{
     totalDeviceCount: int (Required)
     onLatestUpdateDeviceCount: int (Required)
     newUpdatesAvailableDeviceCount: int (Required)
     updatesInProgressDeviceCount: int (Required)
 }

Parameters:

groupId - Group identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

device group update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update along with Response<T> on successful completion of Mono.

getUpdateComplianceWithResponse

public Mono> getUpdateComplianceWithResponse(RequestOptions requestOptions)

Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates.

Response Body Schema

{
     totalDeviceCount: int (Required)
     onLatestUpdateDeviceCount: int (Required)
     newUpdatesAvailableDeviceCount: int (Required)
     updatesInProgressDeviceCount: int (Required)
 }

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates along with Response<T> on successful completion of Mono.

listBestUpdatesForGroup

public PagedFlux listBestUpdatesForGroup(String groupId, RequestOptions requestOptions)

Get the best available updates for a device group and a count of how many devices need each update.

Response Body Schema

{
     value (Required): [
          (Required){
             groupId: String (Required)
             deviceClassId: String (Required)
             update (Required): {
                 updateId (Required): {
                     provider: String (Required)
                     name: String (Required)
                     version: String (Required)
                 }
                 description: String (Optional)
                 friendlyName: String (Optional)
             }
             deviceCount: int (Required)
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

groupId - Group identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the best available updates for a device group and a count of how many devices need each update as paginated response with PagedFlux<T>.

listDeploymentsForDeviceClassSubgroup

public PagedFlux listDeploymentsForDeviceClassSubgroup(String groupId, String deviceClassId, RequestOptions requestOptions)

Gets a list of deployments for a device class subgroup.

Query Parameters

| ------- | ------ | -------- | -------------------------------------------------------------------- |
| Name    | Type   | Required | Description                                                          |
| orderby | String | No       | Orders the set of deployments returned. You can order by start date. |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     value (Required): [
          (Required){
             deploymentId: String (Required)
             startDateTime: OffsetDateTime (Required)
             update (Required): {
                 updateId (Required): {
                     provider: String (Required)
                     name: String (Required)
                     version: String (Required)
                 }
                 description: String (Optional)
                 friendlyName: String (Optional)
             }
             groupId: String (Required)
             deviceClassSubgroups (Optional): [
                 String (Optional)
             ]
             isCanceled: Boolean (Optional)
             isRetried: Boolean (Optional)
             rollbackPolicy (Optional): {
                 update (Required): (recursive schema, see update above)
                 failure (Required): {
                     devicesFailedPercentage: int (Required)
                     devicesFailedCount: int (Required)
                 }
             }
             isCloudInitiatedRollback: Boolean (Optional)
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

a list of deployments for a device class subgroup as paginated response with PagedFlux<T>.

listDeploymentsForGroup

public PagedFlux listDeploymentsForGroup(String groupId, RequestOptions requestOptions)

Gets a list of deployments for a device group.

Query Parameters

| ------- | ------ | -------- | -------------------------------------------------------------------- |
| Name    | Type   | Required | Description                                                          |
| orderby | String | No       | Orders the set of deployments returned. You can order by start date. |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     value (Required): [
          (Required){
             deploymentId: String (Required)
             startDateTime: OffsetDateTime (Required)
             update (Required): {
                 updateId (Required): {
                     provider: String (Required)
                     name: String (Required)
                     version: String (Required)
                 }
                 description: String (Optional)
                 friendlyName: String (Optional)
             }
             groupId: String (Required)
             deviceClassSubgroups (Optional): [
                 String (Optional)
             ]
             isCanceled: Boolean (Optional)
             isRetried: Boolean (Optional)
             rollbackPolicy (Optional): {
                 update (Required): (recursive schema, see update above)
                 failure (Required): {
                     devicesFailedPercentage: int (Required)
                     devicesFailedCount: int (Required)
                 }
             }
             isCloudInitiatedRollback: Boolean (Optional)
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

groupId - Group identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

a list of deployments for a device group as paginated response with PagedFlux<T>.

listDeviceClassSubgroupsForGroup

public PagedFlux listDeviceClassSubgroupsForGroup(String groupId, RequestOptions requestOptions)

Get the device class subgroups for the group. A device class subgroup is the set of devices within the group that share the same device class. All devices within the same device class are compatible with the same updates.

Query Parameters

| ------ | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name   | Type   | Required | Description                                                                                                                                                                                                          |
| filter | String | No       | Restricts the set of device class subgroups returned. You can filter on compat properties by name and value. (i.e. filter=compatProperties/propertyName1 eq 'value1' and compatProperties/propertyName2 eq 'value2') |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     value (Required): [
          (Required){
             deviceClassId: String (Required)
             groupId: String (Required)
             createdDateTime: String (Required)
             deviceCount: Integer (Optional)
             deploymentId: String (Optional)
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

groupId - Group identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

the device class subgroups for the group as paginated response with PagedFlux<T>.

listDeviceClasses

public PagedFlux listDeviceClasses(RequestOptions requestOptions)

Gets a list of all device classes (sets of devices compatible with the same updates based on the model Id and compat properties reported in the Device Update PnP interface in IoT Hub) for all devices connected to Device Update for IoT Hub.

Query Parameters

| ------ | ------ | -------- | ------------------------------------------------------------------------------ |
| Name   | Type   | Required | Description                                                                    |
| filter | String | No       | Restricts the set of device classes returned. You can filter on friendly name. |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     value (Required): [
          (Required){
             deviceClassId: String (Required)
             friendlyName: String (Optional)
             deviceClassProperties (Required): {
                 contractModel (Optional): {
                     id: String (Required)
                     name: String (Required)
                 }
                 compatProperties (Required): {
                     String: String (Required)
                 }
             }
             bestCompatibleUpdate (Optional): {
                 updateId (Required): {
                     provider: String (Required)
                     name: String (Required)
                     version: String (Required)
                 }
                 description: String (Optional)
                 friendlyName: String (Optional)
             }
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

a list of all device classes (sets of devices compatible with the same updates based on the model Id and compat properties reported in the Device Update PnP interface in IoT Hub) for all devices connected to Device Update for IoT Hub as paginated response with PagedFlux<T>.

listDeviceStatesForDeviceClassSubgroupDeployment

public PagedFlux listDeviceStatesForDeviceClassSubgroupDeployment(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices.

Query Parameters

| ------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------- |
| Name   | Type   | Required | Description                                                                                                         |
| filter | String | No       | Restricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState. |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     value (Required): [
          (Required){
             deviceId: String (Required)
             moduleId: String (Optional)
             retryCount: int (Required)
             movedOnToNewDeployment: boolean (Required)
             deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
deploymentId - Deployment identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

a list of devices in a deployment along with their state as paginated response with PagedFlux<T>.

listDevices

public PagedFlux listDevices(RequestOptions requestOptions)

Gets a list of devices connected to Device Update for IoT Hub.

Query Parameters

| ------ | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name   | Type   | Required | Description                                                                                                                                                                                                                       |
| filter | String | No       | Restricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to query for devices with no deployment status (that have never been deployed to). |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     value (Required): [
          (Required){
             deviceId: String (Required)
             moduleId: String (Optional)
             deviceClassId: String (Required)
             groupId: String (Optional)
             lastAttemptedUpdate (Optional): {
                 updateId (Required): {
                     provider: String (Required)
                     name: String (Required)
                     version: String (Required)
                 }
                 description: String (Optional)
                 friendlyName: String (Optional)
             }
             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed) (Optional)
             installedUpdate (Optional): (recursive schema, see installedUpdate above)
             onLatestUpdate: boolean (Required)
             lastDeploymentId: String (Optional)
             lastInstallResult (Optional): {
                 resultCode: int (Required)
                 extendedResultCode: int (Required)
                 resultDetails: String (Optional)
                 stepResults (Optional): [
                      (Optional){
                         update (Optional): (recursive schema, see update above)
                         description: String (Optional)
                         resultCode: int (Required)
                         extendedResultCode: int (Required)
                         resultDetails: String (Optional)
                     }
                 ]
             }
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

a list of devices connected to Device Update for IoT Hub as paginated response with PagedFlux<T>.

listGroups

public PagedFlux listGroups(RequestOptions requestOptions)

Gets a list of all device groups. The $default group will always be returned first.

Query Parameters

| ------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name    | Type   | Required | Description                                                                                                                                                                                         |
| orderby | String | No       | Orders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount. |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     value (Required): [
          (Required){
             groupId: String (Required)
             groupType: String(IoTHubTag/DefaultNoTag) (Required)
             createdDateTime: String (Required)
             deviceCount: Integer (Optional)
             subgroupsWithNewUpdatesAvailableCount: Integer (Optional)
             subgroupsWithUpdatesInProgressCount: Integer (Optional)
             subgroupsWithOnLatestUpdateCount: Integer (Optional)
             deployments (Optional): [
                 String (Optional)
             ]
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

a list of all device groups as paginated response with PagedFlux<T>.

listHealthOfDevices

public PagedFlux listHealthOfDevices(String filter, RequestOptions requestOptions)

Get list of device health.

Response Body Schema

{
     value (Required): [
          (Required){
             deviceId: String (Required)
             moduleId: String (Optional)
             state: String(healthy/unhealthy) (Required)
             digitalTwinModelId: String (Optional)
             healthChecks (Required): [
                  (Required){
                     name: String (Optional)
                     result: String(success/userError) (Optional)
                 }
             ]
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

filter - Restricts the set of devices for which device health is returned. You can filter on status, device id and module id.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

list of device health as paginated response with PagedFlux<T>.

listInstallableUpdatesForDeviceClass

public PagedFlux listInstallableUpdatesForDeviceClass(String deviceClassId, RequestOptions requestOptions)

Gets a list of installable updates for a device class.

Response Body Schema

{
     value (Required): [
          (Required){
             updateId (Required): {
                 provider: String (Required)
                 name: String (Required)
                 version: String (Required)
             }
             description: String (Optional)
             friendlyName: String (Optional)
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

deviceClassId - Device class identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

a list of installable updates for a device class as paginated response with PagedFlux<T>.

listLogCollections

public PagedFlux listLogCollections(RequestOptions requestOptions)

Get all device diagnostics log collections.

Response Body Schema

{
     value (Required): [
          (Required){
             operationId: String (Optional)
             deviceList (Required): [
                  (Required){
                     deviceId: String (Required)
                     moduleId: String (Optional)
                 }
             ]
             description: String (Optional)
             createdDateTime: String (Optional)
             lastActionDateTime: String (Optional)
             status: String(NotStarted/Running/Succeeded/Failed) (Optional)
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

all device diagnostics log collections as paginated response with PagedFlux<T>.

listOperationStatuses

public PagedFlux listOperationStatuses(RequestOptions requestOptions)

Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted.

Query Parameters

| ------ | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name   | Type    | Required | Description                                                                                                                                                                                        |
| filter | String  | No       | Restricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"                                                                   |
| top    | Integer | No       | Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. |

You can add these to a request with RequestOptions#addQueryParam

Response Body Schema

{
     value (Required): [
          (Required){
             operationId: String (Required)
             status: String(NotStarted/Running/Succeeded/Failed) (Required)
             error (Optional): {
                 code: String (Required)
                 message: String (Required)
                 target: String (Optional)
                 details (Optional): [
                     (recursive schema, see above)
                 ]
                 innererror (Optional): {
                     code: String (Required)
                     message: String (Optional)
                     errorDetail: String (Optional)
                     innerError (Optional): (recursive schema, see innerError above)
                 }
                 occurredDateTime: OffsetDateTime (Optional)
             }
             traceId: String (Optional)
             lastActionDateTime: OffsetDateTime (Required)
             createdDateTime: OffsetDateTime (Required)
             etag: String (Optional)
         }
     ]
     nextLink: String (Optional)
 }

Parameters:

requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

a list of all device import operations as paginated response with PagedFlux<T>.

retryDeploymentWithResponse

public Mono> retryDeploymentWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Retries a deployment with failed devices.

Response Body Schema

{
     deploymentId: String (Required)
     startDateTime: OffsetDateTime (Required)
     update (Required): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
     groupId: String (Required)
     deviceClassSubgroups (Optional): [
         String (Optional)
     ]
     isCanceled: Boolean (Optional)
     isRetried: Boolean (Optional)
     rollbackPolicy (Optional): {
         update (Required): (recursive schema, see update above)
         failure (Required): {
             devicesFailedPercentage: int (Required)
             devicesFailedCount: int (Required)
         }
     }
     isCloudInitiatedRollback: Boolean (Optional)
 }

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
deploymentId - Deployment identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

deployment metadata along with Response<T> on successful completion of Mono.

startLogCollectionWithResponse

public Mono> startLogCollectionWithResponse(String logCollectionId, BinaryData logCollection, RequestOptions requestOptions)

Start the device diagnostics log collection on specified devices.

Request Body Schema

{
     operationId: String (Optional)
     deviceList (Required): [
          (Required){
             deviceId: String (Required)
             moduleId: String (Optional)
         }
     ]
     description: String (Optional)
     createdDateTime: String (Optional)
     lastActionDateTime: String (Optional)
     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
 }

Response Body Schema

{
     operationId: String (Optional)
     deviceList (Required): [
          (Required){
             deviceId: String (Required)
             moduleId: String (Optional)
         }
     ]
     description: String (Optional)
     createdDateTime: String (Optional)
     lastActionDateTime: String (Optional)
     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
 }

Parameters:

logCollectionId - Log collection identifier.
logCollection - The log collection properties.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

diagnostics request body along with Response<T> on successful completion of Mono.

stopDeploymentWithResponse

public Mono> stopDeploymentWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions)

Stops a deployment.

Response Body Schema

{
     deploymentId: String (Required)
     startDateTime: OffsetDateTime (Required)
     update (Required): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
     groupId: String (Required)
     deviceClassSubgroups (Optional): [
         String (Optional)
     ]
     isCanceled: Boolean (Optional)
     isRetried: Boolean (Optional)
     rollbackPolicy (Optional): {
         update (Required): (recursive schema, see update above)
         failure (Required): {
             devicesFailedPercentage: int (Required)
             devicesFailedCount: int (Required)
         }
     }
     isCloudInitiatedRollback: Boolean (Optional)
 }

Parameters:

groupId - Group identifier.
deviceClassId - Device class identifier.
deploymentId - Deployment identifier.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

deployment metadata along with Response<T> on successful completion of Mono.

updateDeviceClassWithResponse

public Mono> updateDeviceClassWithResponse(String deviceClassId, BinaryData deviceClassPatch, RequestOptions requestOptions)

Update device class details.

Request Body Schema

{
     friendlyName: String (Required)
 }

Response Body Schema

{
     deviceClassId: String (Required)
     friendlyName: String (Optional)
     deviceClassProperties (Required): {
         contractModel (Optional): {
             id: String (Required)
             name: String (Required)
         }
         compatProperties (Required): {
             String: String (Required)
         }
     }
     bestCompatibleUpdate (Optional): {
         updateId (Required): {
             provider: String (Required)
             name: String (Required)
             version: String (Required)
         }
         description: String (Optional)
         friendlyName: String (Optional)
     }
 }

Parameters:

deviceClassId - Device class identifier.
deviceClassPatch - The device class json merge patch body. Currently only supports patching friendlyName.
requestOptions - The options to configure the HTTP request before HTTP client sends it.

Returns:

device class metadata along with Response<T> on successful completion of Mono.

Applies to