RegistryManagerOperations Class

RegistryManagerOperations operations.

Inheritance
builtins.object
RegistryManagerOperations

Constructor

RegistryManagerOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

api_version

The API version to use for the request. Constant value: "2020-05-31-preview".

Methods

bulk_device_crud

Create, update, or delete the identities of multiple devices from the IoT hub identity registry.

Create, update, or delete the identiies of multiple devices from the IoT hub identity registry. A device identity can be specified only once in the list. Different operations (create, update, delete) on different devices are allowed. A maximum of 100 devices can be specified per invocation. For large scale operations, consider using the import feature using blob storage(https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities).

create_or_update_device

Create or update the identity of a device in the identity registry of an IoT hub.

Create or update the identity of a device in the identity registry of an IoT hub. An ETag must not be specified for the create operation. An ETag must be specified for the update operation. Note that generationId and deviceId cannot be updated by the user.

create_or_update_module

Create or update the module identity for device in IoT hub. An ETag must not be specified for the create operation. An ETag must be specified for the update operation. Note that moduleId and generation cannot be updated by the user.

delete_device

Delete the identity of a device from the identity registry of an IoT hub.

Delete the identity of a device from the identity registry of an IoT hub. This request requires the If-Match header. The client may specify the ETag for the device identity on the request in order to compare to the ETag maintained by the service for the purpose of optimistic concurrency. The delete operation is performed only if the ETag sent by the client matches the value maintained by the server, indicating that the device identity has not been modified since it was retrieved by the client. To force an unconditional delete, set If-Match to the wildcard character (*).

delete_module

Delete the module identity for device of an IoT hub. This request requires the If-Match header. The client may specify the ETag for the device identity on the request in order to compare to the ETag maintained by the service for the purpose of optimistic concurrency. The delete operation is performed only if the ETag sent by the client matches the value maintained by the server, indicating that the device identity has not been modified since it was retrieved by the client. To force an unconditional delete, set If-Match to the wildcard character (*).

get_device

Retrieve a device from the identity registry of an IoT hub.

Retrieve a device from the identity registry of an IoT hub.

get_device_statistics

Retrieves statistics about device identities in the IoT hub’s identity registry.

get_devices

Get the identities of multiple devices from the IoT hub identity registry. Not recommended. Use the IoT Hub query language to retrieve device twin and device identity information. See https://docs.microsoft.com/rest/api/iothub/service/registrymanager/queryiothub and https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language for more information.

get_module

Retrieve the specified module identity on the device.

get_modules_on_device

Retrieve all the module identities on the device.

get_service_statistics

Retrieves service statistics for this IoT hub’s identity registry.

purge_command_queue

Deletes all the pending commands for this device from the IoT hub.

Deletes all the pending commands for this device from the IoT hub.

query_iot_hub

Query an IoT hub to retrieve information regarding device twins using a SQL-like language.

Query an IoT hub to retrieve information regarding device twins using a SQL-like language. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language for more information. Pagination of results is supported. This returns information about device twins only.

bulk_device_crud

Create, update, or delete the identities of multiple devices from the IoT hub identity registry.

Create, update, or delete the identiies of multiple devices from the IoT hub identity registry. A device identity can be specified only once in the list. Different operations (create, update, delete) on different devices are allowed. A maximum of 100 devices can be specified per invocation. For large scale operations, consider using the import feature using blob storage(https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities).

bulk_device_crud(devices, custom_headers=None, raw=False, **operation_config)

Parameters

devices
list[<xref:protocol.models.ExportImportDevice>]
Required
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

BulkRegistryOperationResult or ClientRawResponse if raw=true

Return type

<xref:protocol.models.BulkRegistryOperationResult>,

Exceptions

create_or_update_device

Create or update the identity of a device in the identity registry of an IoT hub.

Create or update the identity of a device in the identity registry of an IoT hub. An ETag must not be specified for the create operation. An ETag must be specified for the update operation. Note that generationId and deviceId cannot be updated by the user.

create_or_update_device(id, device, if_match=None, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

device
<xref:protocol.models.Device>
Required
if_match
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Device or ClientRawResponse if raw=true

Return type

<xref:protocol.models.Device>,

Exceptions

create_or_update_module

Create or update the module identity for device in IoT hub. An ETag must not be specified for the create operation. An ETag must be specified for the update operation. Note that moduleId and generation cannot be updated by the user.

create_or_update_module(id, mid, module, if_match=None, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

mid
str
Required

Module ID.

module
<xref:protocol.models.Module>
Required
if_match
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Module or ClientRawResponse if raw=true

Return type

<xref:protocol.models.Module>,

Exceptions

delete_device

Delete the identity of a device from the identity registry of an IoT hub.

Delete the identity of a device from the identity registry of an IoT hub. This request requires the If-Match header. The client may specify the ETag for the device identity on the request in order to compare to the ETag maintained by the service for the purpose of optimistic concurrency. The delete operation is performed only if the ETag sent by the client matches the value maintained by the server, indicating that the device identity has not been modified since it was retrieved by the client. To force an unconditional delete, set If-Match to the wildcard character (*).

delete_device(id, if_match=None, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

if_match
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

delete_module

Delete the module identity for device of an IoT hub. This request requires the If-Match header. The client may specify the ETag for the device identity on the request in order to compare to the ETag maintained by the service for the purpose of optimistic concurrency. The delete operation is performed only if the ETag sent by the client matches the value maintained by the server, indicating that the device identity has not been modified since it was retrieved by the client. To force an unconditional delete, set If-Match to the wildcard character (*).

delete_module(id, mid, if_match=None, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

mid
str
Required

Module ID.

if_match
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None,

Exceptions

get_device

Retrieve a device from the identity registry of an IoT hub.

Retrieve a device from the identity registry of an IoT hub.

get_device(id, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Device or ClientRawResponse if raw=true

Return type

<xref:protocol.models.Device>,

Exceptions

get_device_statistics

Retrieves statistics about device identities in the IoT hub’s identity registry.

get_device_statistics(custom_headers=None, raw=False, **operation_config)

Parameters

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

RegistryStatistics or ClientRawResponse if raw=true

Return type

<xref:protocol.models.RegistryStatistics>,

Exceptions

get_devices

Get the identities of multiple devices from the IoT hub identity registry. Not recommended. Use the IoT Hub query language to retrieve device twin and device identity information. See https://docs.microsoft.com/rest/api/iothub/service/registrymanager/queryiothub and https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language for more information.

get_devices(top=None, custom_headers=None, raw=False, **operation_config)

Parameters

top
int
default value: None

This parameter when specified, defines the maximum number of device identities that are returned. Any value outside the range of 1-1000 is considered to be 1000.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

list or ClientRawResponse if raw=true

Return type

list[<xref:protocol.models.Device>],

Exceptions

get_module

Retrieve the specified module identity on the device.

get_module(id, mid, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

mid
str
Required

Module ID.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Module or ClientRawResponse if raw=true

Return type

<xref:protocol.models.Module>,

Exceptions

get_modules_on_device

Retrieve all the module identities on the device.

get_modules_on_device(id, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

list or ClientRawResponse if raw=true

Return type

list[<xref:protocol.models.Module>],

Exceptions

get_service_statistics

Retrieves service statistics for this IoT hub’s identity registry.

get_service_statistics(custom_headers=None, raw=False, **operation_config)

Parameters

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

ServiceStatistics or ClientRawResponse if raw=true

Return type

<xref:protocol.models.ServiceStatistics>,

Exceptions

purge_command_queue

Deletes all the pending commands for this device from the IoT hub.

Deletes all the pending commands for this device from the IoT hub.

purge_command_queue(id, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

PurgeMessageQueueResult or ClientRawResponse if raw=true

Return type

<xref:protocol.models.PurgeMessageQueueResult>,

Exceptions

query_iot_hub

Query an IoT hub to retrieve information regarding device twins using a SQL-like language.

Query an IoT hub to retrieve information regarding device twins using a SQL-like language. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language for more information. Pagination of results is supported. This returns information about device twins only.

query_iot_hub(query_specification, x_ms_continuation=None, x_ms_max_item_count=None, custom_headers=None, raw=False, **operation_config)

Parameters

query_specification
<xref:protocol.models.QuerySpecification>
Required
x_ms_continuation
str
default value: None
x_ms_max_item_count
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

list or ClientRawResponse if raw=true

Return type

list[<xref:protocol.models.Twin>],

Exceptions

Attributes

models

models = <module 'azure.iot.hub.protocol.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.6.8\\x64\\lib\\site-packages\\azure\\iot\\hub\\protocol\\models\\__init__.py'>