azure.iot.deviceupdate.aio.operations package¶
-
class
azure.iot.deviceupdate.aio.operations.DeviceManagementOperations(*args, **kwargs)[source]¶ Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
DeviceUpdateClient’sdevice_managementattribute.-
async
begin_import_devices(import_type: str, **kwargs: Any) → azure.core.polling._async_poller.AsyncLROPoller[None][source]¶ Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header value to check for operation status.
- Parameters
import_type (str) – The types of devices to import. Known values are: “Devices”, “Modules”, and “All”. Required.
- Keyword Arguments
continuation_token (str) – A continuation token to restart a poller from a saved state.
polling (bool or AsyncPollingMethod) – By default, your polling method will be AsyncLROBasePolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
polling_interval (int) – Default waiting time between two polls for LRO operations if no Retry-After header is present.
- Returns
An instance of AsyncLROPoller that returns None
- Return type
- Raises
-
async
create_or_update_deployment(group_id: str, deployment_id: str, deployment: JSON, *, content_type: str = "'application/json'", **kwargs: Any) → JSON[source]¶ -
async
create_or_update_deployment(group_id: str, deployment_id: str, deployment: IO, *, content_type: str = "'application/json'", **kwargs: Any) → JSON Creates or updates a deployment.
- Parameters
- Keyword Arguments
content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deploymentId": "str", # The caller-provided deployment identifier. This cannot be longer than 73 characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a GUID for deploymentId when you create a deployment. Required. "groupId": "str", # The group identity for the devices the deployment is intended to update. Required. "startDateTime": "2020-02-20 00:00:00", # The deployment start datetime. Required. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "deviceClassSubgroups": [ "str" # Optional. The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update. ], "isCanceled": bool, # Optional. Boolean flag indicating whether the deployment was canceled. "isCloudInitiatedRollback": bool, # Optional. Boolean flag indicating whether the deployment is a rollback deployment. "isRetried": bool, # Optional. Boolean flag indicating whether the deployment has been retried. "rollbackPolicy": { "failure": { "devicesFailedCount": 0, # Number of devices that failed. Required. "devicesFailedPercentage": 0 # Percentage of devices that failed. Required. }, "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } } }
-
async
delete_deployment(group_id: str, deployment_id: str, **kwargs: Any) → None[source]¶ Deletes a deployment.
- Parameters
- Returns
None
- Return type
- Raises
-
async
delete_deployment_for_device_class_subgroup(group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) → None[source]¶ Deletes a device class subgroup deployment.
- Parameters
- Returns
None
- Return type
- Raises
-
async
delete_device_class(device_class_id: str, **kwargs: Any) → None[source]¶ 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
device_class_id (str) – Device class identifier. Required.
- Returns
None
- Return type
- Raises
-
async
delete_device_class_subgroup(group_id: str, device_class_id: str, **kwargs: Any) → None[source]¶ 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
- Returns
None
- Return type
- Raises
-
async
delete_group(group_id: str, **kwargs: Any) → None[source]¶ 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
group_id (str) – Group identifier. Required.
- Returns
None
- Return type
- Raises
-
async
get_best_updates_for_device_class_subgroup(group_id: str, device_class_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Get the best available update for a device class subgroup and a count of how many devices need this update.
- Parameters
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deviceClassId": "str", # The device class subgroup's device class Id. Required. "deviceCount": 0, # Total number of devices for which the update is applicable. Required. "groupId": "str", # The group Id. Required. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } }
-
async
get_deployment(group_id: str, deployment_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Gets the deployment properties.
- Parameters
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deploymentId": "str", # The caller-provided deployment identifier. This cannot be longer than 73 characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a GUID for deploymentId when you create a deployment. Required. "groupId": "str", # The group identity for the devices the deployment is intended to update. Required. "startDateTime": "2020-02-20 00:00:00", # The deployment start datetime. Required. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "deviceClassSubgroups": [ "str" # Optional. The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update. ], "isCanceled": bool, # Optional. Boolean flag indicating whether the deployment was canceled. "isCloudInitiatedRollback": bool, # Optional. Boolean flag indicating whether the deployment is a rollback deployment. "isRetried": bool, # Optional. Boolean flag indicating whether the deployment has been retried. "rollbackPolicy": { "failure": { "devicesFailedCount": 0, # Number of devices that failed. Required. "devicesFailedPercentage": 0 # Percentage of devices that failed. Required. }, "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } } }
-
async
get_deployment_for_device_class_subgroup(group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Gets the deployment properties.
- Parameters
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deploymentId": "str", # The caller-provided deployment identifier. This cannot be longer than 73 characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a GUID for deploymentId when you create a deployment. Required. "groupId": "str", # The group identity for the devices the deployment is intended to update. Required. "startDateTime": "2020-02-20 00:00:00", # The deployment start datetime. Required. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "deviceClassSubgroups": [ "str" # Optional. The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update. ], "isCanceled": bool, # Optional. Boolean flag indicating whether the deployment was canceled. "isCloudInitiatedRollback": bool, # Optional. Boolean flag indicating whether the deployment is a rollback deployment. "isRetried": bool, # Optional. Boolean flag indicating whether the deployment has been retried. "rollbackPolicy": { "failure": { "devicesFailedCount": 0, # Number of devices that failed. Required. "devicesFailedPercentage": 0 # Percentage of devices that failed. Required. }, "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } } }
-
async
get_deployment_status(group_id: str, deployment_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed.
- Parameters
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deploymentState": "str", # The state of the deployment. Required. Known values are: "Active", "ActiveWithSubgroupFailures", "Failed", "Inactive", and "Canceled". "groupId": "str", # The group identity. Required. "subgroupStatus": [ { "deploymentState": "str", # The state of the subgroup deployment. Required. Known values are: "Active", "Failed", "Inactive", and "Canceled". "deviceClassId": "str", # The device class subgroup identity. Required. "groupId": "str", # The group identity. Required. "devicesCanceledCount": 0, # Optional. The number of devices which have had their deployment canceled. "devicesCompletedFailedCount": 0, # Optional. The number of devices that have completed deployment with a failure. "devicesCompletedSucceededCount": 0, # Optional. The number of devices which have successfully completed deployment. "devicesInProgressCount": 0, # Optional. The number of devices that are currently in deployment. "error": { "code": "str", # Server defined error code. Required. "message": "str", # A human-readable representation of the error. Required. "details": [ ... ], "innererror": { "code": "str", # A more specific error code than what was provided by the containing error. Required. "errorDetail": "str", # Optional. The internal error or exception message. "innerError": ..., "message": "str" # Optional. A human-readable representation of the error. }, "occurredDateTime": "2020-02-20 00:00:00", # Optional. Date and time in UTC when the error occurred. "target": "str" # Optional. The target of the error. }, "totalDevices": 0 # Optional. The total number of devices in the deployment. } ], "error": { "code": "str", # Server defined error code. Required. "message": "str", # A human-readable representation of the error. Required. "details": [ ... ], "innererror": { "code": "str", # A more specific error code than what was provided by the containing error. Required. "errorDetail": "str", # Optional. The internal error or exception message. "innerError": ..., "message": "str" # Optional. A human-readable representation of the error. }, "occurredDateTime": "2020-02-20 00:00:00", # Optional. Date and time in UTC when the error occurred. "target": "str" # Optional. The target of the error. } }
-
async
get_device(device_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub.
- Parameters
device_id (str) – Device identifier in Azure IoT Hub. Required.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deviceClassId": "str", # Device class identity. Required. "deviceId": "str", # Device identity. Required. "onLatestUpdate": bool, # Boolean flag indicating whether the latest update (the best compatible update for the device's device class and group) is installed on the device. Required. "deploymentStatus": "str", # Optional. State of the device in its last deployment. Known values are: "Succeeded", "InProgress", "Canceled", and "Failed". "groupId": "str", # Optional. Device group identity. "installedUpdate": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "lastAttemptedUpdate": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "lastDeploymentId": "str", # Optional. The deployment identifier for the last deployment to the device. "lastInstallResult": { "extendedResultCode": 0, # Install extended result code. Required. "resultCode": 0, # Install result code. Required. "resultDetails": "str", # Optional. A string containing further details about the install result. "stepResults": [ { "extendedResultCode": 0, # Install extended result code. Required. "resultCode": 0, # Install result code. Required. "description": "str", # Optional. Step description. "resultDetails": "str", # Optional. A string containing further details about the install result. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } } ] }, "moduleId": "str" # Optional. Device module identity. }
-
async
get_device_class(device_class_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Gets the properties of a device class.
- Parameters
device_class_id (str) – Device class identifier. Required.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deviceClassId": "str", # The device class identifier. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash. Required. "deviceClassProperties": { "compatProperties": { "str": "str" # The compat properties of the device class. This object can be thought of as a set of key-value pairs where the key is the name of the compatibility property and the value is the value of the compatibility property. There will always be at least 1 compat property. Required. }, "contractModel": { "id": "str", # The Device Update agent contract model Id of the device class. This is also used to calculate the device class Id. Required. "name": "str" # The Device Update agent contract model name of the device class. Intended to be a more readable form of the contract model Id. Required. } }, "bestCompatibleUpdate": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "friendlyName": "str" # Optional. The device class friendly name. This can be updated by callers after the device class has been automatically created. }
-
async
get_device_class_subgroup(group_id: str, device_class_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ 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.
- Parameters
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "createdDateTime": "str", # Date and time when the device class subgroup was created. Required. "deviceClassId": "str", # Device class subgroup identity. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash. Required. "groupId": "str", # Group identity. Required. "deploymentId": "str", # Optional. The active deployment Id for the device class subgroup. "deviceCount": 0 # Optional. The number of devices in the device class subgroup. }
-
async
get_device_class_subgroup_deployment_status(group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed.
- Parameters
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deploymentState": "str", # The state of the subgroup deployment. Required. Known values are: "Active", "Failed", "Inactive", and "Canceled". "deviceClassId": "str", # The device class subgroup identity. Required. "groupId": "str", # The group identity. Required. "devicesCanceledCount": 0, # Optional. The number of devices which have had their deployment canceled. "devicesCompletedFailedCount": 0, # Optional. The number of devices that have completed deployment with a failure. "devicesCompletedSucceededCount": 0, # Optional. The number of devices which have successfully completed deployment. "devicesInProgressCount": 0, # Optional. The number of devices that are currently in deployment. "error": { "code": "str", # Server defined error code. Required. "message": "str", # A human-readable representation of the error. Required. "details": [ ... ], "innererror": { "code": "str", # A more specific error code than what was provided by the containing error. Required. "errorDetail": "str", # Optional. The internal error or exception message. "innerError": ..., "message": "str" # Optional. A human-readable representation of the error. }, "occurredDateTime": "2020-02-20 00:00:00", # Optional. Date and time in UTC when the error occurred. "target": "str" # Optional. The target of the error. }, "totalDevices": 0 # Optional. The total number of devices in the deployment. }
-
async
get_device_class_subgroup_update_compliance(group_id: str, device_class_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ 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.
- Parameters
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "newUpdatesAvailableDeviceCount": 0, # Number of devices with a newer update available. Required. "onLatestUpdateDeviceCount": 0, # Number of devices on the latest update. Required. "totalDeviceCount": 0, # Total number of devices. Required. "updatesInProgressDeviceCount": 0 # Number of devices with update in-progress. Required. }
-
async
get_device_module(device_id: str, module_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Gets the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub.
- Parameters
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deviceClassId": "str", # Device class identity. Required. "deviceId": "str", # Device identity. Required. "onLatestUpdate": bool, # Boolean flag indicating whether the latest update (the best compatible update for the device's device class and group) is installed on the device. Required. "deploymentStatus": "str", # Optional. State of the device in its last deployment. Known values are: "Succeeded", "InProgress", "Canceled", and "Failed". "groupId": "str", # Optional. Device group identity. "installedUpdate": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "lastAttemptedUpdate": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "lastDeploymentId": "str", # Optional. The deployment identifier for the last deployment to the device. "lastInstallResult": { "extendedResultCode": 0, # Install extended result code. Required. "resultCode": 0, # Install result code. Required. "resultDetails": "str", # Optional. A string containing further details about the install result. "stepResults": [ { "extendedResultCode": 0, # Install extended result code. Required. "resultCode": 0, # Install result code. Required. "description": "str", # Optional. Step description. "resultDetails": "str", # Optional. A string containing further details about the install result. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } } ] }, "moduleId": "str" # Optional. Device module identity. }
-
async
get_group(group_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Gets the device group properties.
- Parameters
group_id (str) – Group identifier. Required.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "createdDateTime": "str", # Date and time when the update was created. Required. "groupId": "str", # Group identity. This is created from the value of the ADUGroup tag in the Iot Hub's device/module twin or $default for devices with no tag. Required. "groupType": "str", # Group type. Required. Known values are: "IoTHubTag" and "DefaultNoTag". "deployments": [ "str" # Optional. The active deployment Ids for the group. ], "deviceCount": 0, # Optional. The number of devices in the group. "subgroupsWithNewUpdatesAvailableCount": 0, # Optional. The count of subgroups with new updates available. "subgroupsWithOnLatestUpdateCount": 0, # Optional. The count of subgroups with devices on the latest update. "subgroupsWithUpdatesInProgressCount": 0 # Optional. The count of subgroups with updates in progress. }
-
async
get_log_collection(log_collection_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Get the device diagnostics log collection.
- Parameters
log_collection_id (str) – Log collection identifier. Required.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deviceList": [ { "deviceId": "str", # Device Id. Required. "moduleId": "str" # Optional. Module Id. } ], "createdDateTime": "str", # Optional. The timestamp when the operation was created. "description": "str", # Optional. Description of the diagnostics operation. "lastActionDateTime": "str", # Optional. A timestamp for when the current state was entered. "operationId": "str", # Optional. The log collection id. "status": "str" # Optional. Operation status. Known values are: "NotStarted", "Running", "Succeeded", and "Failed". }
-
async
get_log_collection_detailed_status(log_collection_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Get log collection with detailed status.
- Parameters
log_collection_id (str) – Log collection identifier. Required.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "createdDateTime": "str", # Optional. The timestamp when the operation was created. "description": "str", # Optional. Device diagnostics operation description. "deviceStatus": [ { "deviceId": "str", # Device id. Required. "status": "str", # Log upload status. Required. Known values are: "NotStarted", "Running", "Succeeded", and "Failed". "extendedResultCode": "str", # Optional. Log upload extended result code. "logLocation": "str", # Optional. Log upload location. "moduleId": "str", # Optional. Module id. "resultCode": "str" # Optional. Log upload result code. } ], "lastActionDateTime": "str", # Optional. A timestamp for when the current state was entered. "operationId": "str", # Optional. The device diagnostics operation id. "status": "str" # Optional. Operation status. Known values are: "NotStarted", "Running", "Succeeded", and "Failed". }
-
async
get_operation_status(operation_id: str, *, if_none_match: Optional[str] = None, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Retrieve operation status.
- Parameters
operation_id (str) – Operation identifier. Required.
- Keyword Arguments
if_none_match (str) – Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. Default value is None.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the operation was created. Required. "lastActionDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the operation status was last updated. Required. "operationId": "str", # Operation Id. Required. "status": "str", # Operation status. Required. Known values are: "NotStarted", "Running", "Succeeded", and "Failed". "error": { "code": "str", # Server defined error code. Required. "message": "str", # A human-readable representation of the error. Required. "details": [ ... ], "innererror": { "code": "str", # A more specific error code than what was provided by the containing error. Required. "errorDetail": "str", # Optional. The internal error or exception message. "innerError": ..., "message": "str" # Optional. A human-readable representation of the error. }, "occurredDateTime": "2020-02-20 00:00:00", # Optional. Date and time in UTC when the error occurred. "target": "str" # Optional. The target of the error. }, "etag": "str", # Optional. Operation ETag. "traceId": "str" # Optional. Operation correlation identity that can used by Microsoft Support for troubleshooting. }
-
async
get_update_compliance(**kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "newUpdatesAvailableDeviceCount": 0, # Number of devices with a newer update available. Required. "onLatestUpdateDeviceCount": 0, # Number of devices on the latest update. Required. "totalDeviceCount": 0, # Total number of devices. Required. "updatesInProgressDeviceCount": 0 # Number of devices with update in-progress. Required. }
-
async
get_update_compliance_for_group(group_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ 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.
- Parameters
group_id (str) – Group identifier. Required.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "newUpdatesAvailableDeviceCount": 0, # Number of devices with a newer update available. Required. "onLatestUpdateDeviceCount": 0, # Number of devices on the latest update. Required. "totalDeviceCount": 0, # Total number of devices. Required. "updatesInProgressDeviceCount": 0 # Number of devices with update in-progress. Required. }
-
list_best_updates_for_group(group_id: str, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Get the best available updates for a device group and a count of how many devices need each update.
- Parameters
group_id (str) – Group identifier. Required.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "deviceClassId": "str", # The device class subgroup's device class Id. Required. "deviceCount": 0, # Total number of devices for which the update is applicable. Required. "groupId": "str", # The group Id. Required. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } }
-
list_deployments_for_device_class_subgroup(group_id: str, device_class_id: str, *, order_by: Optional[str] = None, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Gets a list of deployments for a device class subgroup.
- Parameters
- Keyword Arguments
order_by (str) – Orders the set of deployments returned. You can order by start date. Default value is None.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "deploymentId": "str", # The caller-provided deployment identifier. This cannot be longer than 73 characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a GUID for deploymentId when you create a deployment. Required. "groupId": "str", # The group identity for the devices the deployment is intended to update. Required. "startDateTime": "2020-02-20 00:00:00", # The deployment start datetime. Required. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "deviceClassSubgroups": [ "str" # Optional. The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update. ], "isCanceled": bool, # Optional. Boolean flag indicating whether the deployment was canceled. "isCloudInitiatedRollback": bool, # Optional. Boolean flag indicating whether the deployment is a rollback deployment. "isRetried": bool, # Optional. Boolean flag indicating whether the deployment has been retried. "rollbackPolicy": { "failure": { "devicesFailedCount": 0, # Number of devices that failed. Required. "devicesFailedPercentage": 0 # Percentage of devices that failed. Required. }, "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } } }
-
list_deployments_for_group(group_id: str, *, order_by: Optional[str] = None, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Gets a list of deployments for a device group.
- Parameters
group_id (str) – Group identifier. Required.
- Keyword Arguments
order_by (str) – Orders the set of deployments returned. You can order by start date. Default value is None.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "deploymentId": "str", # The caller-provided deployment identifier. This cannot be longer than 73 characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a GUID for deploymentId when you create a deployment. Required. "groupId": "str", # The group identity for the devices the deployment is intended to update. Required. "startDateTime": "2020-02-20 00:00:00", # The deployment start datetime. Required. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "deviceClassSubgroups": [ "str" # Optional. The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update. ], "isCanceled": bool, # Optional. Boolean flag indicating whether the deployment was canceled. "isCloudInitiatedRollback": bool, # Optional. Boolean flag indicating whether the deployment is a rollback deployment. "isRetried": bool, # Optional. Boolean flag indicating whether the deployment has been retried. "rollbackPolicy": { "failure": { "devicesFailedCount": 0, # Number of devices that failed. Required. "devicesFailedPercentage": 0 # Percentage of devices that failed. Required. }, "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } } }
-
list_device_class_subgroups_for_group(group_id: str, *, filter: Optional[str] = None, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ 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.
- Parameters
group_id (str) – Group identifier. Required.
- Keyword Arguments
filter (str) – 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’). Default value is None.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "createdDateTime": "str", # Date and time when the device class subgroup was created. Required. "deviceClassId": "str", # Device class subgroup identity. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash. Required. "groupId": "str", # Group identity. Required. "deploymentId": "str", # Optional. The active deployment Id for the device class subgroup. "deviceCount": 0 # Optional. The number of devices in the device class subgroup. }
-
list_device_classes(*, filter: Optional[str] = None, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ 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.
- Keyword Arguments
filter (str) – Restricts the set of device classes returned. You can filter on friendly name. Default value is None.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "deviceClassId": "str", # The device class identifier. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash. Required. "deviceClassProperties": { "compatProperties": { "str": "str" # The compat properties of the device class. This object can be thought of as a set of key-value pairs where the key is the name of the compatibility property and the value is the value of the compatibility property. There will always be at least 1 compat property. Required. }, "contractModel": { "id": "str", # The Device Update agent contract model Id of the device class. This is also used to calculate the device class Id. Required. "name": "str" # The Device Update agent contract model name of the device class. Intended to be a more readable form of the contract model Id. Required. } }, "bestCompatibleUpdate": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "friendlyName": "str" # Optional. The device class friendly name. This can be updated by callers after the device class has been automatically created. }
-
list_device_states_for_device_class_subgroup_deployment(group_id: str, device_class_id: str, deployment_id: str, *, filter: Optional[str] = None, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices.
- Parameters
- Keyword Arguments
filter (str) – Restricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState. Default value is None.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "deviceId": "str", # Device identity. Required. "deviceState": "str", # Deployment device state. Required. Known values are: "Succeeded", "InProgress", "Canceled", and "Failed". "movedOnToNewDeployment": bool, # Boolean flag indicating whether this device is in a newer deployment and can no longer retry this deployment. Required. "retryCount": 0, # The number of times this deployment has been retried on this device. Required. "moduleId": "str" # Optional. Device module identity. }
-
list_devices(*, filter: Optional[str] = None, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Gets a list of devices connected to Device Update for IoT Hub.
- Keyword Arguments
filter (str) – 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). Default value is None.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "deviceClassId": "str", # Device class identity. Required. "deviceId": "str", # Device identity. Required. "onLatestUpdate": bool, # Boolean flag indicating whether the latest update (the best compatible update for the device's device class and group) is installed on the device. Required. "deploymentStatus": "str", # Optional. State of the device in its last deployment. Known values are: "Succeeded", "InProgress", "Canceled", and "Failed". "groupId": "str", # Optional. Device group identity. "installedUpdate": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "lastAttemptedUpdate": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "lastDeploymentId": "str", # Optional. The deployment identifier for the last deployment to the device. "lastInstallResult": { "extendedResultCode": 0, # Install extended result code. Required. "resultCode": 0, # Install result code. Required. "resultDetails": "str", # Optional. A string containing further details about the install result. "stepResults": [ { "extendedResultCode": 0, # Install extended result code. Required. "resultCode": 0, # Install result code. Required. "description": "str", # Optional. Step description. "resultDetails": "str", # Optional. A string containing further details about the install result. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } } ] }, "moduleId": "str" # Optional. Device module identity. }
-
list_groups(*, order_by: Optional[str] = None, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Gets a list of all device groups. The $default group will always be returned first.
- Keyword Arguments
order_by (str) – Orders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount. Default value is None.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "createdDateTime": "str", # Date and time when the update was created. Required. "groupId": "str", # Group identity. This is created from the value of the ADUGroup tag in the Iot Hub's device/module twin or $default for devices with no tag. Required. "groupType": "str", # Group type. Required. Known values are: "IoTHubTag" and "DefaultNoTag". "deployments": [ "str" # Optional. The active deployment Ids for the group. ], "deviceCount": 0, # Optional. The number of devices in the group. "subgroupsWithNewUpdatesAvailableCount": 0, # Optional. The count of subgroups with new updates available. "subgroupsWithOnLatestUpdateCount": 0, # Optional. The count of subgroups with devices on the latest update. "subgroupsWithUpdatesInProgressCount": 0 # Optional. The count of subgroups with updates in progress. }
-
list_health_of_devices(*, filter: str, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Get list of device health.
- Keyword Arguments
filter (str) – Restricts the set of devices for which device health is returned. You can filter on status, device id and module id. Required.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "deviceId": "str", # Device id. Required. "healthChecks": [ { "name": "str", # Optional. Health check name. "result": "str" # Optional. Health check result. Known values are: "success" and "userError". } ], "state": "str", # Aggregate device health state. Required. Known values are: "healthy" and "unhealthy". "digitalTwinModelId": "str", # Optional. Digital twin model Id. "moduleId": "str" # Optional. Module id. }
-
list_installable_updates_for_device_class(device_class_id: str, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Gets a list of installable updates for a device class.
- Parameters
device_class_id (str) – Device class identifier. Required.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }
-
list_log_collections(**kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Get all device diagnostics log collections.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "deviceList": [ { "deviceId": "str", # Device Id. Required. "moduleId": "str" # Optional. Module Id. } ], "createdDateTime": "str", # Optional. The timestamp when the operation was created. "description": "str", # Optional. Description of the diagnostics operation. "lastActionDateTime": "str", # Optional. A timestamp for when the current state was entered. "operationId": "str", # Optional. The log collection id. "status": "str" # Optional. Operation status. Known values are: "NotStarted", "Running", "Succeeded", and "Failed". }
-
list_operation_statuses(*, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted.
- Keyword Arguments
filter (str) – Restricts the set of operations returned. Only one specific filter is supported: “status eq ‘NotStarted’ or status eq ‘Running’”. Default value is None.
top (int) – 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. Default value is None.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the operation was created. Required. "lastActionDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the operation status was last updated. Required. "operationId": "str", # Operation Id. Required. "status": "str", # Operation status. Required. Known values are: "NotStarted", "Running", "Succeeded", and "Failed". "error": { "code": "str", # Server defined error code. Required. "message": "str", # A human-readable representation of the error. Required. "details": [ ... ], "innererror": { "code": "str", # A more specific error code than what was provided by the containing error. Required. "errorDetail": "str", # Optional. The internal error or exception message. "innerError": ..., "message": "str" # Optional. A human-readable representation of the error. }, "occurredDateTime": "2020-02-20 00:00:00", # Optional. Date and time in UTC when the error occurred. "target": "str" # Optional. The target of the error. }, "etag": "str", # Optional. Operation ETag. "traceId": "str" # Optional. Operation correlation identity that can used by Microsoft Support for troubleshooting. }
-
async
retry_deployment(group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Retries a deployment with failed devices.
- Parameters
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deploymentId": "str", # The caller-provided deployment identifier. This cannot be longer than 73 characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a GUID for deploymentId when you create a deployment. Required. "groupId": "str", # The group identity for the devices the deployment is intended to update. Required. "startDateTime": "2020-02-20 00:00:00", # The deployment start datetime. Required. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "deviceClassSubgroups": [ "str" # Optional. The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update. ], "isCanceled": bool, # Optional. Boolean flag indicating whether the deployment was canceled. "isCloudInitiatedRollback": bool, # Optional. Boolean flag indicating whether the deployment is a rollback deployment. "isRetried": bool, # Optional. Boolean flag indicating whether the deployment has been retried. "rollbackPolicy": { "failure": { "devicesFailedCount": 0, # Number of devices that failed. Required. "devicesFailedPercentage": 0 # Percentage of devices that failed. Required. }, "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } } }
-
async
start_log_collection(log_collection_id: str, log_collection: JSON, *, content_type: str = "'application/json'", **kwargs: Any) → JSON[source]¶ -
async
start_log_collection(log_collection_id: str, log_collection: IO, *, content_type: str = "'application/json'", **kwargs: Any) → JSON Start the device diagnostics log collection on specified devices.
- Parameters
log_collection_id (str) – Log collection identifier. Required.
log_collection (JSON or IO) – The log collection properties. Is either a model type or a IO type. Required.
- Keyword Arguments
content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 201 response == { "deviceList": [ { "deviceId": "str", # Device Id. Required. "moduleId": "str" # Optional. Module Id. } ], "createdDateTime": "str", # Optional. The timestamp when the operation was created. "description": "str", # Optional. Description of the diagnostics operation. "lastActionDateTime": "str", # Optional. A timestamp for when the current state was entered. "operationId": "str", # Optional. The log collection id. "status": "str" # Optional. Operation status. Known values are: "NotStarted", "Running", "Succeeded", and "Failed". }
-
async
stop_deployment(group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Stops a deployment.
- Parameters
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deploymentId": "str", # The caller-provided deployment identifier. This cannot be longer than 73 characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a GUID for deploymentId when you create a deployment. Required. "groupId": "str", # The group identity for the devices the deployment is intended to update. Required. "startDateTime": "2020-02-20 00:00:00", # The deployment start datetime. Required. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "deviceClassSubgroups": [ "str" # Optional. The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update. ], "isCanceled": bool, # Optional. Boolean flag indicating whether the deployment was canceled. "isCloudInitiatedRollback": bool, # Optional. Boolean flag indicating whether the deployment is a rollback deployment. "isRetried": bool, # Optional. Boolean flag indicating whether the deployment has been retried. "rollbackPolicy": { "failure": { "devicesFailedCount": 0, # Number of devices that failed. Required. "devicesFailedPercentage": 0 # Percentage of devices that failed. Required. }, "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } } }
-
async
update_device_class(device_class_id: str, device_class_patch: JSON, *, content_type: str = "'application/merge-patch+json'", **kwargs: Any) → JSON[source]¶ -
async
update_device_class(device_class_id: str, device_class_patch: IO, *, content_type: str = "'application/merge-patch+json'", **kwargs: Any) → JSON Update device class details.
- Parameters
device_class_id (str) – Device class identifier. Required.
device_class_patch (JSON or IO) – The device class json merge patch body. Currently only supports patching friendlyName. Is either a model type or a IO type. Required.
- Keyword Arguments
content_type (str) – Body Parameter content-type. Known values are: ‘application/merge-patch+json’. Default value is None.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "deviceClassId": "str", # The device class identifier. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash. Required. "deviceClassProperties": { "compatProperties": { "str": "str" # The compat properties of the device class. This object can be thought of as a set of key-value pairs where the key is the name of the compatibility property and the value is the value of the compatibility property. There will always be at least 1 compat property. Required. }, "contractModel": { "id": "str", # The Device Update agent contract model Id of the device class. This is also used to calculate the device class Id. Required. "name": "str" # The Device Update agent contract model name of the device class. Intended to be a more readable form of the contract model Id. Required. } }, "bestCompatibleUpdate": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. }, "friendlyName": "str" # Optional. The device class friendly name. This can be updated by callers after the device class has been automatically created. }
-
async
-
class
azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations(*args, **kwargs)[source]¶ Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
DeviceUpdateClient’sdevice_updateattribute.-
async
begin_delete_update(provider: str, name: str, version: str, **kwargs: Any) → azure.core.polling._async_poller.AsyncLROPoller[None][source]¶ Delete a specific update version. This is a long-running-operation; use Operation-Location response header value to check for operation status.
- Parameters
- Keyword Arguments
continuation_token (str) – A continuation token to restart a poller from a saved state.
polling (bool or AsyncPollingMethod) – By default, your polling method will be AsyncLROBasePolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
polling_interval (int) – Default waiting time between two polls for LRO operations if no Retry-After header is present.
- Returns
An instance of AsyncLROPoller that returns None
- Return type
- Raises
-
async
begin_import_update(update_to_import: List[JSON], *, content_type: str = "'application/json'", **kwargs: Any) → AsyncLROPoller[JSON][source]¶ -
async
begin_import_update(update_to_import: IO, *, content_type: str = "'application/json'", **kwargs: Any) → AsyncLROPoller[JSON] Import new update version. This is a long-running-operation; use Operation-Location response header value to check for operation status.
- Parameters
update_to_import (list[JSON] or IO) – The update to be imported (see schema https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for details). Is either a list type or a IO type. Required.
- Keyword Arguments
content_type (str) – Body Parameter content-type. Known values are: ‘application/json’. Default value is None.
continuation_token (str) – A continuation token to restart a poller from a saved state.
polling (bool or AsyncPollingMethod) – By default, your polling method will be AsyncLROBasePolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
polling_interval (int) – Default waiting time between two polls for LRO operations if no Retry-After header is present.
- Returns
An instance of AsyncLROPoller that returns JSON object
- Return type
AsyncLROPoller[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "compatibility": [ { "str": "str" # List of update compatibility information. Required. } ], "createdDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the update was created. Required. "importedDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the update was imported. Required. "manifestVersion": "str", # Schema version of manifest used to import the update. Required. "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description specified by creator. "etag": "str", # Optional. Update ETag. "friendlyName": "str", # Optional. Friendly update name specified by importer. "installedCriteria": "str", # Optional. String interpreted by Device Update client to determine if the update is installed on the device. Deprecated in latest import manifest schema. "instructions": { "steps": [ { "description": "str", # Optional. Step description. "files": [ "str" # Optional. Collection of file names to be passed to handler during execution. Required if step type is inline. ], "handler": "str", # Optional. Identity of handler that will execute this step. Required if step type is inline. "handlerProperties": {}, # Optional. Parameters to be passed to handler during execution. "type": "inline", # Optional. Default value is "inline". Step type. Known values are: "Inline" and "Reference". "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. } } ] }, "isDeployable": True, # Optional. Default value is True. Whether the update can be deployed to a device on its own. "referencedBy": [ { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. } ], "scanResult": "str", # Optional. Update aggregate scan result (calculated from payload file scan results). "updateType": "str" # Optional. Update type. Deprecated in latest import manifest schema. }
-
async
get_file(provider: str, name: str, version: str, file_id: str, *, if_none_match: Optional[str] = None, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Get a specific update file from the version.
- Parameters
- Keyword Arguments
if_none_match (str) – Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. Default value is None.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "fileId": "str", # File identity, generated by server at import time. Required. "fileName": "str", # File name. Required. "hashes": { "str": "str" # Mapping of hashing algorithm to base64 encoded hash values. Required. }, "sizeInBytes": 0, # File size in number of bytes. Required. "downloadHandler": { "id": "str" # Download handler identifier. Required. }, "etag": "str", # Optional. File ETag. "mimeType": "str", # Optional. File MIME type. "properties": { "str": "str" # Optional. Optional file properties (not consumed by service but pass-through to device). }, "relatedFiles": [ { "fileName": "str", # File name. Required. "hashes": { "str": "str" # Mapping of hashing algorithm to base64 encoded hash values. Required. }, "sizeInBytes": 0, # File size in number of bytes. Required. "mimeType": "str", # Optional. File MIME type. "properties": { "str": "str" # Optional. Optional file properties (not consumed by service but pass-through to device). }, "scanDetails": "str", # Optional. Anti-malware scan details. "scanResult": "str" # Optional. Anti-malware scan result. } ], "scanDetails": "str", # Optional. Anti-malware scan details. "scanResult": "str" # Optional. Anti-malware scan result. }
-
async
get_operation_status(operation_id: str, *, if_none_match: Optional[str] = None, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Retrieve operation status.
- Parameters
operation_id (str) – Operation identifier. Required.
- Keyword Arguments
if_none_match (str) – Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. Default value is None.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the operation was created. Required. "lastActionDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the operation status was last updated. Required. "operationId": "str", # Operation Id. Required. "status": "str", # Operation status. Required. Known values are: "NotStarted", "Running", "Succeeded", and "Failed". "error": { "code": "str", # Server defined error code. Required. "message": "str", # A human-readable representation of the error. Required. "details": [ ... ], "innererror": { "code": "str", # A more specific error code than what was provided by the containing error. Required. "errorDetail": "str", # Optional. The internal error or exception message. "innerError": ..., "message": "str" # Optional. A human-readable representation of the error. }, "occurredDateTime": "2020-02-20 00:00:00", # Optional. Date and time in UTC when the error occurred. "target": "str" # Optional. The target of the error. }, "etag": "str", # Optional. Operation ETag. "resourceLocation": "str", # Optional. Location of the imported update when operation is successful. "traceId": "str", # Optional. Operation correlation identity that can used by Microsoft Support for troubleshooting. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } }
-
async
get_update(provider: str, name: str, version: str, *, if_none_match: Optional[str] = None, **kwargs: Any) → collections.abc.MutableMapping[str, Any][source]¶ Get a specific update version.
- Parameters
- Keyword Arguments
if_none_match (str) – Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. Default value is None.
- Returns
JSON object
- Return type
JSON
- Raises
Example
# response body for status code(s): 200 response == { "compatibility": [ { "str": "str" # List of update compatibility information. Required. } ], "createdDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the update was created. Required. "importedDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the update was imported. Required. "manifestVersion": "str", # Schema version of manifest used to import the update. Required. "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description specified by creator. "etag": "str", # Optional. Update ETag. "friendlyName": "str", # Optional. Friendly update name specified by importer. "installedCriteria": "str", # Optional. String interpreted by Device Update client to determine if the update is installed on the device. Deprecated in latest import manifest schema. "instructions": { "steps": [ { "description": "str", # Optional. Step description. "files": [ "str" # Optional. Collection of file names to be passed to handler during execution. Required if step type is inline. ], "handler": "str", # Optional. Identity of handler that will execute this step. Required if step type is inline. "handlerProperties": {}, # Optional. Parameters to be passed to handler during execution. "type": "inline", # Optional. Default value is "inline". Step type. Known values are: "Inline" and "Reference". "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. } } ] }, "isDeployable": True, # Optional. Default value is True. Whether the update can be deployed to a device on its own. "referencedBy": [ { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. } ], "scanResult": "str", # Optional. Update aggregate scan result (calculated from payload file scan results). "updateType": "str" # Optional. Update type. Deprecated in latest import manifest schema. }
-
list_files(provider: str, name: str, version: str, **kwargs: Any) → AsyncIterable[str][source]¶ Get a list of all update file identifiers for the specified version.
- Parameters
- Returns
An iterator like instance of str
- Return type
- Raises
Example
# response body for status code(s): 200 response == "str" # Optional.
-
list_names(provider: str, **kwargs: Any) → AsyncIterable[str][source]¶ Get a list of all update names that match the specified provider.
- Parameters
provider (str) – Update provider. Required.
- Returns
An iterator like instance of str
- Return type
- Raises
Example
# response body for status code(s): 200 response == "str" # Optional.
-
list_operation_statuses(*, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Get a list of all import update operations. Completed operations are kept for 7 days before auto-deleted. Delete operations are not returned by this API version.
- Keyword Arguments
filter (str) – Optional to filter operations by status property. Only one specific filter is supported: “status eq ‘NotStarted’ or status eq ‘Running’”. Default value is None.
top (int) – 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. Default value is None.
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "createdDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the operation was created. Required. "lastActionDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the operation status was last updated. Required. "operationId": "str", # Operation Id. Required. "status": "str", # Operation status. Required. Known values are: "NotStarted", "Running", "Succeeded", and "Failed". "error": { "code": "str", # Server defined error code. Required. "message": "str", # A human-readable representation of the error. Required. "details": [ ... ], "innererror": { "code": "str", # A more specific error code than what was provided by the containing error. Required. "errorDetail": "str", # Optional. The internal error or exception message. "innerError": ..., "message": "str" # Optional. A human-readable representation of the error. }, "occurredDateTime": "2020-02-20 00:00:00", # Optional. Date and time in UTC when the error occurred. "target": "str" # Optional. The target of the error. }, "etag": "str", # Optional. Operation ETag. "resourceLocation": "str", # Optional. Location of the imported update when operation is successful. "traceId": "str", # Optional. Operation correlation identity that can used by Microsoft Support for troubleshooting. "update": { "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description. "friendlyName": "str" # Optional. Friendly update name. } }
-
list_providers(**kwargs: Any) → AsyncIterable[str][source]¶ Get a list of all update providers that have been imported to Device Update for IoT Hub.
- Returns
An iterator like instance of str
- Return type
- Raises
Example
# response body for status code(s): 200 response == "str" # Optional.
-
list_updates(*, search: Optional[str] = None, filter: Optional[str] = None, **kwargs: Any) → AsyncIterable[collections.abc.MutableMapping[str, Any]][source]¶ Get a list of all updates that have been imported to Device Update for IoT Hub.
- Keyword Arguments
- Returns
An iterator like instance of JSON object
- Return type
AsyncItemPaged[JSON]
- Raises
Example
# response body for status code(s): 200 response == { "compatibility": [ { "str": "str" # List of update compatibility information. Required. } ], "createdDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the update was created. Required. "importedDateTime": "2020-02-20 00:00:00", # Date and time in UTC when the update was imported. Required. "manifestVersion": "str", # Schema version of manifest used to import the update. Required. "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. }, "description": "str", # Optional. Update description specified by creator. "etag": "str", # Optional. Update ETag. "friendlyName": "str", # Optional. Friendly update name specified by importer. "installedCriteria": "str", # Optional. String interpreted by Device Update client to determine if the update is installed on the device. Deprecated in latest import manifest schema. "instructions": { "steps": [ { "description": "str", # Optional. Step description. "files": [ "str" # Optional. Collection of file names to be passed to handler during execution. Required if step type is inline. ], "handler": "str", # Optional. Identity of handler that will execute this step. Required if step type is inline. "handlerProperties": {}, # Optional. Parameters to be passed to handler during execution. "type": "inline", # Optional. Default value is "inline". Step type. Known values are: "Inline" and "Reference". "updateId": { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. } } ] }, "isDeployable": True, # Optional. Default value is True. Whether the update can be deployed to a device on its own. "referencedBy": [ { "name": "str", # Update name. Required. "provider": "str", # Update provider. Required. "version": "str" # Update version. Required. } ], "scanResult": "str", # Optional. Update aggregate scan result (calculated from payload file scan results). "updateType": "str" # Optional. Update type. Deprecated in latest import manifest schema. }
-
list_versions(provider: str, name: str, *, filter: Optional[str] = None, **kwargs: Any) → AsyncIterable[str][source]¶ Get a list of all update versions that match the specified provider and name.
- Parameters
- Keyword Arguments
filter (str) – Optional to filter updates by isDeployable property. Default value is None.
- Returns
An iterator like instance of str
- Return type
- Raises
Example
# response body for status code(s): 200 response == "str" # Optional.
-
async