DeviceManagementOperations Class
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
<xref:device_management> attribute.
Constructor
DeviceManagementOperations(*args, **kwargs)
Methods
begin_import_devices |
Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header value to check for operation status. |
create_or_update_deployment |
Creates or updates a deployment. |
delete_deployment |
Deletes a deployment. |
delete_deployment_for_device_class_subgroup |
Deletes a device class subgroup deployment. |
delete_device_class |
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. |
delete_device_class_subgroup |
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. |
delete_group |
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. |
get_best_updates_for_device_class_subgroup |
Get the best available update for a device class subgroup and a count of how many devices need this update. |
get_deployment |
Gets the deployment properties. |
get_deployment_for_device_class_subgroup |
Gets the deployment properties. |
get_deployment_status |
Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed. |
get_device |
Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. |
get_device_class |
Gets the properties of a device class. |
get_device_class_subgroup |
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. |
get_device_class_subgroup_deployment_status |
Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed. |
get_device_class_subgroup_update_compliance |
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. |
get_device_module |
Gets the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub. |
get_group |
Gets the device group properties. |
get_log_collection |
Get the device diagnostics log collection. |
get_log_collection_detailed_status |
Get log collection with detailed status. |
get_operation_status |
Retrieve operation status. |
get_update_compliance |
Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates. |
get_update_compliance_for_group |
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. |
list_best_updates_for_group |
Get the best available updates for a device group and a count of how many devices need each update. |
list_deployments_for_device_class_subgroup |
Gets a list of deployments for a device class subgroup. |
list_deployments_for_group |
Gets a list of deployments for a device group. |
list_device_class_subgroups_for_group |
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. |
list_device_classes |
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. |
list_device_states_for_device_class_subgroup_deployment |
Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. |
list_devices |
Gets a list of devices connected to Device Update for IoT Hub. |
list_groups |
Gets a list of all device groups. The $default group will always be returned first. |
list_health_of_devices |
Get list of device health. |
list_installable_updates_for_device_class |
Gets a list of installable updates for a device class. |
list_log_collections |
Get all device diagnostics log collections. |
list_operation_statuses |
Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. |
retry_deployment |
Retries a deployment with failed devices. |
start_log_collection |
Start the device diagnostics log collection on specified devices. |
stop_deployment |
Stops a deployment. |
update_device_class |
Update device class details. |
begin_import_devices
Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header value to check for operation status.
async begin_import_devices(import_type: str, **kwargs: Any) -> AsyncLROPoller[None]
Parameters
Name | Description |
---|---|
import_type
Required
|
The types of devices to import. Known values are: "Devices", "Modules", and "All". Required. |
Keyword-Only Parameters
Name | Description |
---|---|
continuation_token
|
A continuation token to restart a poller from a saved state. |
polling
|
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
|
Default waiting time between two polls for LRO operations if no Retry-After header is present. |
Returns
Type | Description |
---|---|
An instance of AsyncLROPoller that returns None |
Exceptions
Type | Description |
---|---|
create_or_update_deployment
Creates or updates a deployment.
async create_or_update_deployment(group_id: str, deployment_id: str, deployment: JSON, *, content_type: str = 'application/json', **kwargs: Any) -> JSON
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
deployment_id
Required
|
Deployment identifier. Required. |
deployment
Required
|
<xref:JSON> or
IO
The deployment properties. Is either a model type or a IO type. Required. |
Keyword-Only Parameters
Name | Description |
---|---|
content_type
|
Body Parameter content-type. Known values are: 'application/json'. Default value is None. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
}
}
delete_deployment
Deletes a deployment.
async delete_deployment(group_id: str, deployment_id: str, **kwargs: Any) -> None
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
deployment_id
Required
|
Deployment identifier. Required. |
Returns
Type | Description |
---|---|
None |
Exceptions
Type | Description |
---|---|
delete_deployment_for_device_class_subgroup
Deletes a device class subgroup deployment.
async delete_deployment_for_device_class_subgroup(group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) -> None
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
deployment_id
Required
|
Deployment identifier. Required. |
Returns
Type | Description |
---|---|
None |
Exceptions
Type | Description |
---|---|
delete_device_class
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.
async delete_device_class(device_class_id: str, **kwargs: Any) -> None
Parameters
Name | Description |
---|---|
device_class_id
Required
|
Device class identifier. Required. |
Returns
Type | Description |
---|---|
None |
Exceptions
Type | Description |
---|---|
delete_device_class_subgroup
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.
async delete_device_class_subgroup(group_id: str, device_class_id: str, **kwargs: Any) -> None
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
Returns
Type | Description |
---|---|
None |
Exceptions
Type | Description |
---|---|
delete_group
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.
async delete_group(group_id: str, **kwargs: Any) -> None
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
Returns
Type | Description |
---|---|
None |
Exceptions
Type | Description |
---|---|
get_best_updates_for_device_class_subgroup
Get the best available update for a device class subgroup and a count of how many devices need this update.
async get_best_updates_for_device_class_subgroup(group_id: str, device_class_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
}
get_deployment
Gets the deployment properties.
async get_deployment(group_id: str, deployment_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
deployment_id
Required
|
Deployment identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
}
}
get_deployment_for_device_class_subgroup
Gets the deployment properties.
async get_deployment_for_device_class_subgroup(group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
deployment_id
Required
|
Deployment identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
}
}
get_deployment_status
Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed.
async get_deployment_status(group_id: str, deployment_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
deployment_id
Required
|
Deployment identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
}
get_device
Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub.
async get_device(device_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
device_id
Required
|
Device identifier in Azure IoT Hub. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
get_device_class
Gets the properties of a device class.
async get_device_class(device_class_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
device_class_id
Required
|
Device class identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
get_device_class_subgroup
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.
async get_device_class_subgroup(group_id: str, device_class_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
get_device_class_subgroup_deployment_status
Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed.
async get_device_class_subgroup_deployment_status(group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
deployment_id
Required
|
Deployment identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
get_device_class_subgroup_update_compliance
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.
async get_device_class_subgroup_update_compliance(group_id: str, device_class_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
get_device_module
Gets the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub.
async get_device_module(device_id: str, module_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
device_id
Required
|
Device identifier in Azure IoT Hub. Required. |
module_id
Required
|
Device module identifier in Azure IoT Hub. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
get_group
Gets the device group properties.
async get_group(group_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
get_log_collection
Get the device diagnostics log collection.
async get_log_collection(log_collection_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
log_collection_id
Required
|
Log collection identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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".
}
get_log_collection_detailed_status
Get log collection with detailed status.
async get_log_collection_detailed_status(log_collection_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
log_collection_id
Required
|
Log collection identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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".
}
get_operation_status
Retrieve operation status.
async get_operation_status(operation_id: str, *, if_none_match: str | None = None, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
operation_id
Required
|
Operation identifier. Required. |
Keyword-Only Parameters
Name | Description |
---|---|
if_none_match
|
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. Default value: None
|
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
get_update_compliance
Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates.
async get_update_compliance(**kwargs: Any) -> MutableMapping[str, Any]
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
get_update_compliance_for_group
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.
async get_update_compliance_for_group(group_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
Get the best available updates for a device group and a count of how many devices need each update.
list_best_updates_for_group(group_id: str, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
Gets a list of deployments for a device class subgroup.
list_deployments_for_device_class_subgroup(group_id: str, device_class_id: str, *, order_by: str | None = None, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
Keyword-Only Parameters
Name | Description |
---|---|
order_by
|
Orders the set of deployments returned. You can order by start date. Default value is None. Default value: None
|
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
Gets a list of deployments for a device group.
list_deployments_for_group(group_id: str, *, order_by: str | None = None, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
Keyword-Only Parameters
Name | Description |
---|---|
order_by
|
Orders the set of deployments returned. You can order by start date. Default value is None. Default value: None
|
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
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.
list_device_class_subgroups_for_group(group_id: str, *, filter: str | None = None, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
Keyword-Only Parameters
Name | Description |
---|---|
filter
|
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. Default value: None
|
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
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.
list_device_classes(*, filter: str | None = None, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Keyword-Only Parameters
Name | Description |
---|---|
filter
|
Restricts the set of device classes returned. You can filter on friendly name. Default value is None. Default value: None
|
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices.
list_device_states_for_device_class_subgroup_deployment(group_id: str, device_class_id: str, deployment_id: str, *, filter: str | None = None, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
deployment_id
Required
|
Deployment identifier. Required. |
Keyword-Only Parameters
Name | Description |
---|---|
filter
|
Restricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState. Default value is None. Default value: None
|
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
Gets a list of devices connected to Device Update for IoT Hub.
list_devices(*, filter: str | None = None, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Keyword-Only Parameters
Name | Description |
---|---|
filter
|
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. Default value: None
|
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
Gets a list of all device groups. The $default group will always be returned first.
list_groups(*, order_by: str | None = None, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Keyword-Only Parameters
Name | Description |
---|---|
order_by
|
Orders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount. Default value is None. Default value: None
|
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
Get list of device health.
list_health_of_devices(*, filter: str, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Keyword-Only Parameters
Name | Description |
---|---|
filter
|
Restricts the set of devices for which device health is returned. You can filter on status, device id and module id. Required. |
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
Gets a list of installable updates for a device class.
list_installable_updates_for_device_class(device_class_id: str, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Parameters
Name | Description |
---|---|
device_class_id
Required
|
Device class identifier. Required. |
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
Get all device diagnostics log collections.
list_log_collections(**kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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
Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted.
list_operation_statuses(*, filter: str | None = None, top: int | None = None, **kwargs: Any) -> AsyncIterable[MutableMapping[str, Any]]
Keyword-Only Parameters
Name | Description |
---|---|
filter
|
Restricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'". Default value is None. Default value: None
|
top
|
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. Default value: None
|
Returns
Type | Description |
---|---|
AsyncItemPaged[<xref:JSON>]
|
An iterator like instance of JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
retry_deployment
Retries a deployment with failed devices.
async retry_deployment(group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
deployment_id
Required
|
Deployment identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
}
}
start_log_collection
Start the device diagnostics log collection on specified devices.
async start_log_collection(log_collection_id: str, log_collection: JSON, *, content_type: str = 'application/json', **kwargs: Any) -> JSON
Parameters
Name | Description |
---|---|
log_collection_id
Required
|
Log collection identifier. Required. |
log_collection
Required
|
<xref:JSON> or
IO
The log collection properties. Is either a model type or a IO type. Required. |
Keyword-Only Parameters
Name | Description |
---|---|
content_type
|
Body Parameter content-type. Known values are: 'application/json'. Default value is None. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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".
}
stop_deployment
Stops a deployment.
async stop_deployment(group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) -> MutableMapping[str, Any]
Parameters
Name | Description |
---|---|
group_id
Required
|
Group identifier. Required. |
device_class_id
Required
|
Device class identifier. Required. |
deployment_id
Required
|
Deployment identifier. Required. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}
}
}
update_device_class
Update device class details.
async update_device_class(device_class_id: str, device_class_patch: JSON, *, content_type: str = 'application/merge-patch+json', **kwargs: Any) -> JSON
Parameters
Name | Description |
---|---|
device_class_id
Required
|
Device class identifier. Required. |
device_class_patch
Required
|
<xref: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-Only Parameters
Name | Description |
---|---|
content_type
|
Body Parameter content-type. Known values are: 'application/merge-patch+json'. Default value is None. |
Returns
Type | Description |
---|---|
<xref:JSON>
|
JSON object |
Exceptions
Type | Description |
---|---|
Examples
# 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.
}