azure.mgmt.iothub.operations module

class azure.mgmt.iothub.operations.Operations(client, config, serializer, deserializer)[source]

Bases: object

Operations operations.

Parameters
  • client – Client for service requests.

  • config – Configuration of service client.

  • serializer – An object model serializer.

  • deserializer – An object model deserializer.

Variables

api_version – The version of the API. Constant value: “2018-04-01”.

list(custom_headers=None, raw=False, **operation_config)[source]

Lists all of the available IoT Hub REST API operations.

Parameters
  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

An iterator like instance of Operation

Return type

OperationPaged[Operation]

Raises

ErrorDetailsException

models = <module 'azure.mgmt.iothub.models' from '/usr/lib/python3.7/site-packages/azure/mgmt/iothub/models/__init__.py'>
class azure.mgmt.iothub.operations.IotHubResourceOperations(client, config, serializer, deserializer)[source]

Bases: object

IotHubResourceOperations operations.

Parameters
  • client – Client for service requests.

  • config – Configuration of service client.

  • serializer – An object model serializer.

  • deserializer – An object model deserializer.

Variables

api_version – The version of the API. Constant value: “2018-04-01”.

check_name_availability(name, custom_headers=None, raw=False, **operation_config)[source]

Check if an IoT hub name is available.

Check if an IoT hub name is available.

Parameters
  • name (str) – The name of the IoT hub to check.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

IotHubNameAvailabilityInfo or ClientRawResponse if raw=true

Return type

IotHubNameAvailabilityInfo or ClientRawResponse

Raises

ErrorDetailsException

create_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers=None, raw=False, **operation_config)[source]

Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.

Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • event_hub_endpoint_name (str) – The name of the Event Hub-compatible endpoint in the IoT hub.

  • name (str) – The name of the consumer group to add.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

EventHubConsumerGroupInfo or ClientRawResponse if raw=true

Return type

EventHubConsumerGroupInfo or ClientRawResponse

Raises

ErrorDetailsException

create_or_update(resource_group_name, resource_name, iot_hub_description, if_match=None, custom_headers=None, raw=False, polling=True, **operation_config)[source]

Create or update the metadata of an IoT hub.

Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • iot_hub_description (IotHubDescription) – The IoT hub metadata and security metadata.

  • if_match (str) – ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – The poller return type is ClientRawResponse, the direct response alongside the deserialized response

  • polling – True for ARMPolling, False for no polling, or a polling object for personal polling strategy

Returns

An instance of LROPoller that returns IotHubDescription or ClientRawResponse<IotHubDescription> if raw==True

Return type

AzureOperationPoller[IotHubDescription] or AzureOperationPoller[ClientRawResponse[IotHubDescription]]

Raises

ErrorDetailsException

delete(resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config)[source]

Delete an IoT hub.

Delete an IoT hub.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – The poller return type is ClientRawResponse, the direct response alongside the deserialized response

  • polling – True for ARMPolling, False for no polling, or a polling object for personal polling strategy

Returns

An instance of LROPoller that returns object or ClientRawResponse<object> if raw==True

Return type

AzureOperationPoller[object] or AzureOperationPoller[ClientRawResponse[object]]

Raises

ErrorDetailsException

delete_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers=None, raw=False, **operation_config)[source]

Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.

Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • event_hub_endpoint_name (str) – The name of the Event Hub-compatible endpoint in the IoT hub.

  • name (str) – The name of the consumer group to delete.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None or ClientRawResponse

Raises

ErrorDetailsException

export_devices(resource_group_name, resource_name, export_blob_container_uri, exclude_keys, custom_headers=None, raw=False, **operation_config)[source]

Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • export_blob_container_uri (str) – The export blob container URI.

  • exclude_keys (bool) – The value indicating whether keys should be excluded during export.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

JobResponse or ClientRawResponse if raw=true

Return type

JobResponse or ClientRawResponse

Raises

ErrorDetailsException

get(resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config)[source]

Get the non-security related metadata of an IoT hub.

Get the non-security related metadata of an IoT hub.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

IotHubDescription or ClientRawResponse if raw=true

Return type

IotHubDescription or ClientRawResponse

Raises

ErrorDetailsException

get_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers=None, raw=False, **operation_config)[source]

Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.

Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • event_hub_endpoint_name (str) – The name of the Event Hub-compatible endpoint in the IoT hub.

  • name (str) – The name of the consumer group to retrieve.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

EventHubConsumerGroupInfo or ClientRawResponse if raw=true

Return type

EventHubConsumerGroupInfo or ClientRawResponse

Raises

ErrorDetailsException

get_job(resource_group_name, resource_name, job_id, custom_headers=None, raw=False, **operation_config)[source]

Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get the details of a job from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • job_id (str) – The job identifier.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

JobResponse or ClientRawResponse if raw=true

Return type

JobResponse or ClientRawResponse

Raises

ErrorDetailsException

get_keys_for_key_name(resource_group_name, resource_name, key_name, custom_headers=None, raw=False, **operation_config)[source]

Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get a shared access policy by name from an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • key_name (str) – The name of the shared access policy.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

SharedAccessSignatureAuthorizationRule or ClientRawResponse if raw=true

Return type

SharedAccessSignatureAuthorizationRule or ClientRawResponse

Raises

ErrorDetailsException

get_quota_metrics(resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config)[source]

Get the quota metrics for an IoT hub.

Get the quota metrics for an IoT hub.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

An iterator like instance of IotHubQuotaMetricInfo

Return type

IotHubQuotaMetricInfoPaged[IotHubQuotaMetricInfo]

Raises

ErrorDetailsException

get_stats(resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config)[source]

Get the statistics from an IoT hub.

Get the statistics from an IoT hub.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

RegistryStatistics or ClientRawResponse if raw=true

Return type

RegistryStatistics or ClientRawResponse

Raises

ErrorDetailsException

get_valid_skus(resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config)[source]

Get the list of valid SKUs for an IoT hub.

Get the list of valid SKUs for an IoT hub.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

An iterator like instance of IotHubSkuDescription

Return type

IotHubSkuDescriptionPaged[IotHubSkuDescription]

Raises

ErrorDetailsException

import_devices(resource_group_name, resource_name, input_blob_container_uri, output_blob_container_uri, custom_headers=None, raw=False, **operation_config)[source]

Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • input_blob_container_uri (str) – The input blob container URI.

  • output_blob_container_uri (str) – The output blob container URI.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

JobResponse or ClientRawResponse if raw=true

Return type

JobResponse or ClientRawResponse

Raises

ErrorDetailsException

list_by_resource_group(resource_group_name, custom_headers=None, raw=False, **operation_config)[source]

Get all the IoT hubs in a resource group.

Get all the IoT hubs in a resource group.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

An iterator like instance of IotHubDescription

Return type

IotHubDescriptionPaged[IotHubDescription]

Raises

ErrorDetailsException

list_by_subscription(custom_headers=None, raw=False, **operation_config)[source]

Get all the IoT hubs in a subscription.

Get all the IoT hubs in a subscription.

Parameters
  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

An iterator like instance of IotHubDescription

Return type

IotHubDescriptionPaged[IotHubDescription]

Raises

ErrorDetailsException

list_event_hub_consumer_groups(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers=None, raw=False, **operation_config)[source]

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • event_hub_endpoint_name (str) – The name of the Event Hub-compatible endpoint.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

An iterator like instance of EventHubConsumerGroupInfo

Return type

EventHubConsumerGroupInfoPaged[EventHubConsumerGroupInfo]

Raises

ErrorDetailsException

list_jobs(resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config)[source]

Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get a list of all the jobs in an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

An iterator like instance of JobResponse

Return type

JobResponsePaged[JobResponse]

Raises

ErrorDetailsException

list_keys(resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config)[source]

Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

An iterator like instance of SharedAccessSignatureAuthorizationRule

Return type

SharedAccessSignatureAuthorizationRulePaged[SharedAccessSignatureAuthorizationRule]

Raises

ErrorDetailsException

models = <module 'azure.mgmt.iothub.models' from '/usr/lib/python3.7/site-packages/azure/mgmt/iothub/models/__init__.py'>
update(resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config)[source]

Update an existing IoT Hubs tags.

Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method.

Parameters
  • resource_group_name (str) – Resource group identifier.

  • resource_name (str) – Name of iot hub to update.

  • tags (dict[str, str]) – Resource tags

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – The poller return type is ClientRawResponse, the direct response alongside the deserialized response

  • polling – True for ARMPolling, False for no polling, or a polling object for personal polling strategy

Returns

An instance of LROPoller that returns IotHubDescription or ClientRawResponse<IotHubDescription> if raw==True

Return type

AzureOperationPoller[IotHubDescription] or AzureOperationPoller[ClientRawResponse[IotHubDescription]]

Raises

CloudError

class azure.mgmt.iothub.operations.CertificatesOperations(client, config, serializer, deserializer)[source]

Bases: object

CertificatesOperations operations.

Parameters
  • client – Client for service requests.

  • config – Configuration of service client.

  • serializer – An object model serializer.

  • deserializer – An object model deserializer.

Variables

api_version – The version of the API. Constant value: “2018-04-01”.

create_or_update(resource_group_name, resource_name, certificate_name, if_match=None, certificate=None, custom_headers=None, raw=False, **operation_config)[source]

Upload the certificate to the IoT hub.

Adds new or replaces existing certificate.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • certificate_name (str) – The name of the certificate

  • if_match (str) – ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate.

  • certificate (str) – base-64 representation of the X509 leaf certificate .cer file or just .pem file content.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

CertificateDescription or ClientRawResponse if raw=true

Return type

CertificateDescription or ClientRawResponse

Raises

ErrorDetailsException

delete(resource_group_name, resource_name, certificate_name, if_match, custom_headers=None, raw=False, **operation_config)[source]

Delete an X509 certificate.

Deletes an existing X509 certificate or does nothing if it does not exist.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • certificate_name (str) – The name of the certificate

  • if_match (str) – ETag of the Certificate.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

None or ClientRawResponse if raw=true

Return type

None or ClientRawResponse

Raises

ErrorDetailsException

generate_verification_code(resource_group_name, resource_name, certificate_name, if_match, custom_headers=None, raw=False, **operation_config)[source]

Generate verification code for proof of possession flow.

Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • certificate_name (str) – The name of the certificate

  • if_match (str) – ETag of the Certificate.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

CertificateWithNonceDescription or ClientRawResponse if raw=true

Return type

CertificateWithNonceDescription or ClientRawResponse

Raises

ErrorDetailsException

get(resource_group_name, resource_name, certificate_name, custom_headers=None, raw=False, **operation_config)[source]

Get the certificate.

Returns the certificate.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • certificate_name (str) – The name of the certificate

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

CertificateDescription or ClientRawResponse if raw=true

Return type

CertificateDescription or ClientRawResponse

Raises

ErrorDetailsException

list_by_iot_hub(resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config)[source]

Get the certificate list.

Returns the list of certificates.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

CertificateListDescription or ClientRawResponse if raw=true

Return type

CertificateListDescription or ClientRawResponse

Raises

ErrorDetailsException

models = <module 'azure.mgmt.iothub.models' from '/usr/lib/python3.7/site-packages/azure/mgmt/iothub/models/__init__.py'>
verify(resource_group_name, resource_name, certificate_name, if_match, certificate=None, custom_headers=None, raw=False, **operation_config)[source]

Verify certificate’s private key possession.

Verifies the certificate’s private key possession by providing the leaf cert issued by the verifying pre uploaded certificate.

Parameters
  • resource_group_name (str) – The name of the resource group that contains the IoT hub.

  • resource_name (str) – The name of the IoT hub.

  • certificate_name (str) – The name of the certificate

  • if_match (str) – ETag of the Certificate.

  • certificate (str) – base-64 representation of X509 certificate .cer file or just .pem file content.

  • custom_headers (dict) – headers that will be added to the request

  • raw (bool) – returns the direct response alongside the deserialized response

  • operation_configOperation configuration overrides.

Returns

CertificateDescription or ClientRawResponse if raw=true

Return type

CertificateDescription or ClientRawResponse

Raises

ErrorDetailsException