azure.mgmt.iothub.operations module

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 objec model deserializer.
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.
Return type:

IotHubNameAvailabilityInfo

Return type:

ClientRawResponse if raw=true

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.
Return type:

EventHubConsumerGroupInfo

Return type:

ClientRawResponse if raw=true

Raises:

ErrorDetailsException

create_or_update(resource_group_name, resource_name, iot_hub_description, custom_headers=None, raw=False, **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 to create or update.
  • iot_hub_description (IotHubDescription) – The IoT hub metadata and security metadata.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
Return type:

AzureOperationPoller instance that returns IotHubDescription

Return type:

ClientRawResponse if raw=true

Raises:

ErrorDetailsException

delete(resource_group_name, resource_name, custom_headers=None, raw=False, **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 to delete.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
Return type:

AzureOperationPoller instance that returns object

Return type:

ClientRawResponse if raw=true

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.
Return type:

None

Return type:

ClientRawResponse if raw=true

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.
Return type:

JobResponse

Return type:

ClientRawResponse if raw=true

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.
Return type:

IotHubDescription

Return type:

ClientRawResponse if raw=true

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.
Return type:

EventHubConsumerGroupInfo

Return type:

ClientRawResponse if raw=true

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.
Return type:

JobResponse

Return type:

ClientRawResponse if raw=true

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.
Return type:

SharedAccessSignatureAuthorizationRule

Return type:

ClientRawResponse if raw=true

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.
Return type:

IotHubQuotaMetricInfoPaged

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.
Return type:

RegistryStatistics

Return type:

ClientRawResponse if raw=true

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.
Return type:

IotHubSkuDescriptionPaged

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.
Return type:

JobResponse

Return type:

ClientRawResponse if raw=true

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 hubs.
  • 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.
Return type:

IotHubDescriptionPaged

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:
Return type:

IotHubDescriptionPaged

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.
Return type:

StrPaged

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.
Return type:

JobResponsePaged

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.
Return type:

SharedAccessSignatureAuthorizationRulePaged

Raises:

ErrorDetailsException