Partager via


DeviceManagementClient Class

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

public final class DeviceManagementClient

Initializes a new instance of the synchronous DeviceUpdateClient type.

Method Summary

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

Import existing devices from IoT Hub.

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

Creates or updates a deployment.

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

Deletes a device class subgroup deployment.

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

Deletes a deployment.

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

Deletes a device class subgroup.

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

Deletes a device class.

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

Deletes a device group.

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.

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

Gets the deployment properties.

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.

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

Gets the deployment properties.

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.

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.

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

Gets device class subgroup details.

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

Gets the properties of a device class.

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.

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.

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

Gets the device group properties.

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

Get log collection with detailed status.

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

Get the device diagnostics log collection.

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

Retrieve operation status.

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.

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.

PagedIterable<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.

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

Gets a list of deployments for a device class subgroup.

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

Gets a list of deployments for a device group.

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

Get the device class subgroups for the group.

PagedIterable<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.

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

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

PagedIterable<BinaryData> listDevices(RequestOptions requestOptions)

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

PagedIterable<BinaryData> listGroups(RequestOptions requestOptions)

Gets a list of all device groups.

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

Get list of device health.

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

Gets a list of installable updates for a device class.

PagedIterable<BinaryData> listLogCollections(RequestOptions requestOptions)

Get all device diagnostics log collections.

PagedIterable<BinaryData> listOperationStatuses(RequestOptions requestOptions)

Get a list of all device import operations.

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

Retries a deployment with failed devices.

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

Start the device diagnostics log collection on specified devices.

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

Stops a deployment.

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

Update device class details.

Methods inherited from java.lang.Object

Method Details

beginImportDevices

public SyncPoller 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 SyncPoller<T,U> for polling of long-running operation.

createOrUpdateDeploymentWithResponse

public Response 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>.

deleteDeploymentForDeviceClassSubgroupWithResponse

public Response 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:

deleteDeploymentWithResponse

public Response 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:

deleteDeviceClassSubgroupWithResponse

public Response 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:

deleteDeviceClassWithResponse

public Response 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:

deleteGroupWithResponse

public Response 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:

getBestUpdatesForDeviceClassSubgroupWithResponse

public Response 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>.

getDeploymentForDeviceClassSubgroupWithResponse

public Response 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>.

getDeploymentStatusWithResponse

public Response 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>.

getDeploymentWithResponse

public Response 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>.

getDeviceClassSubgroupDeploymentStatusWithResponse

public Response 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>.

getDeviceClassSubgroupUpdateComplianceWithResponse

public Response 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>.

getDeviceClassSubgroupWithResponse

public Response 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>.

getDeviceClassWithResponse

public Response 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>.

getDeviceModuleWithResponse

public Response 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>.

getDeviceWithResponse

public Response 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>.

getGroupWithResponse

public Response 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>.

getLogCollectionDetailedStatusWithResponse

public Response 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>.

getLogCollectionWithResponse

public Response 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>.

getOperationStatusWithResponse

public Response 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>.

getUpdateComplianceForGroupWithResponse

public Response 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>.

getUpdateComplianceWithResponse

public Response 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>.

listBestUpdatesForGroup

public PagedIterable 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 PagedIterable<T>.

listDeploymentsForDeviceClassSubgroup

public PagedIterable 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 PagedIterable<T>.

listDeploymentsForGroup

public PagedIterable 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 PagedIterable<T>.

listDeviceClassSubgroupsForGroup

public PagedIterable 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 PagedIterable<T>.

listDeviceClasses

public PagedIterable 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 PagedIterable<T>.

listDeviceStatesForDeviceClassSubgroupDeployment

public PagedIterable 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 PagedIterable<T>.

listDevices

public PagedIterable 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 PagedIterable<T>.

listGroups

public PagedIterable 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 PagedIterable<T>.

listHealthOfDevices

public PagedIterable 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 PagedIterable<T>.

listInstallableUpdatesForDeviceClass

public PagedIterable 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 PagedIterable<T>.

listLogCollections

public PagedIterable 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 PagedIterable<T>.

listOperationStatuses

public PagedIterable 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 PagedIterable<T>.

retryDeploymentWithResponse

public Response 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>.

startLogCollectionWithResponse

public Response 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>.

stopDeploymentWithResponse

public Response 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>.

updateDeviceClassWithResponse

public Response 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>.

Applies to