IotHubResourceOperations Class

IotHubResourceOperations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
IotHubResourceOperations

Constructor

IotHubResourceOperations(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

models

Alias to model classes used in this operation group.

Methods

begin_create_or_update

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. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to default, which may lead to unexpected behavior.

begin_delete

Delete an IoT hub.

Delete an IoT hub.

begin_update

Update an existing IoT Hubs tags.

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

check_name_availability

Check if an IoT hub name is available.

Check if an IoT hub name is available.

create_event_hub_consumer_group

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.

delete_event_hub_consumer_group

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.

export_devices

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.

get

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

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

get_endpoint_health

Get the health for routing endpoints.

Get the health for routing endpoints.

get_event_hub_consumer_group

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.

get_job

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.

get_keys_for_key_name

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.

get_quota_metrics

Get the quota metrics for an IoT hub.

Get the quota metrics for an IoT hub.

get_stats

Get the statistics from an IoT hub.

Get the statistics from an IoT hub.

get_valid_skus

Get the list of valid SKUs for an IoT hub.

Get the list of valid SKUs for an IoT hub.

import_devices

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.

list_by_resource_group

Get all the IoT hubs in a resource group.

Get all the IoT hubs in a resource group.

list_by_subscription

Get all the IoT hubs in a subscription.

Get all the IoT hubs in a subscription.

list_event_hub_consumer_groups

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.

list_jobs

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.

list_keys

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.

test_all_routes

Test all routes.

Test all routes configured in this Iot Hub.

test_route

Test the new route.

Test the new route for this Iot Hub.

begin_create_or_update

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. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to default, which may lead to unexpected behavior.

async begin_create_or_update(resource_group_name: str, resource_name: str, iot_hub_description: azure.mgmt.iothub.v2019_11_04.models._models_py3.IotHubDescription, if_match: Optional[str] = None, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.iothub.v2019_11_04.models._models_py3.IotHubDescription]

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

iot_hub_description
IotHubDescription
Required

The IoT hub metadata and security metadata.

if_match
str
Required

ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an existing IoT Hub.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or AsyncPollingMethod

By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response)

Return type

Exceptions

begin_delete

Delete an IoT hub.

Delete an IoT hub.

async begin_delete(resource_group_name: str, resource_name: str, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[Union[azure.mgmt.iothub.v2019_11_04.models._models_py3.IotHubDescription, azure.mgmt.iothub.v2019_11_04.models._models_py3.ErrorDetails]]

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or AsyncPollingMethod

By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of AsyncLROPoller that returns either IotHubDescription or ErrorDetails or the result of cls(response)

Return type

Exceptions

begin_update

Update an existing IoT Hubs tags.

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

async begin_update(resource_group_name: str, resource_name: str, iot_hub_tags: azure.mgmt.iothub.v2019_11_04.models._models_py3.TagsResource, **kwargs: Any) -> azure.core.polling._async_poller.AsyncLROPoller[azure.mgmt.iothub.v2019_11_04.models._models_py3.IotHubDescription]

Parameters

resource_group_name
str
Required

Resource group identifier.

resource_name
str
Required

Name of iot hub to update.

iot_hub_tags
TagsResource
Required

Updated tag information to set into the iot hub instance.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or AsyncPollingMethod

By default, your polling method will be AsyncARMPolling. Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of AsyncLROPoller that returns either IotHubDescription or the result of cls(response)

Return type

Exceptions

check_name_availability

Check if an IoT hub name is available.

Check if an IoT hub name is available.

async check_name_availability(operation_inputs: azure.mgmt.iothub.v2019_11_04.models._models_py3.OperationInputs, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.IotHubNameAvailabilityInfo

Parameters

operation_inputs
OperationInputs
Required

Set the name parameter in the OperationInputs structure to the name of the IoT hub to check.

cls
callable

A custom type or function that will be passed the direct response

Returns

IotHubNameAvailabilityInfo, or the result of cls(response)

Return type

Exceptions

create_event_hub_consumer_group

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.

async create_event_hub_consumer_group(resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, name: str, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.EventHubConsumerGroupInfo

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

event_hub_endpoint_name
str
Required

The name of the Event Hub-compatible endpoint in the IoT hub.

name
str
Required

The name of the consumer group to add.

cls
callable

A custom type or function that will be passed the direct response

Returns

EventHubConsumerGroupInfo, or the result of cls(response)

Return type

Exceptions

delete_event_hub_consumer_group

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.

async delete_event_hub_consumer_group(resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, name: str, **kwargs: Any) -> None

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

event_hub_endpoint_name
str
Required

The name of the Event Hub-compatible endpoint in the IoT hub.

name
str
Required

The name of the consumer group to delete.

cls
callable

A custom type or function that will be passed the direct response

Returns

None, or the result of cls(response)

Return type

Exceptions

export_devices

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.

async export_devices(resource_group_name: str, resource_name: str, export_devices_parameters: azure.mgmt.iothub.v2019_11_04.models._models_py3.ExportDevicesRequest, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.JobResponse

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

export_devices_parameters
ExportDevicesRequest
Required

The parameters that specify the export devices operation.

cls
callable

A custom type or function that will be passed the direct response

Returns

JobResponse, or the result of cls(response)

Return type

Exceptions

get

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

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

async get(resource_group_name: str, resource_name: str, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.IotHubDescription

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

cls
callable

A custom type or function that will be passed the direct response

Returns

IotHubDescription, or the result of cls(response)

Return type

Exceptions

get_endpoint_health

Get the health for routing endpoints.

Get the health for routing endpoints.

get_endpoint_health(resource_group_name: str, iot_hub_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.iothub.v2019_11_04.models._models_py3.EndpointHealthDataListResult]

Parameters

resource_group_name
str
Required
iot_hub_name
str
Required
cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either EndpointHealthDataListResult or the result of cls(response)

Return type

Exceptions

get_event_hub_consumer_group

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.

async get_event_hub_consumer_group(resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, name: str, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.EventHubConsumerGroupInfo

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

event_hub_endpoint_name
str
Required

The name of the Event Hub-compatible endpoint in the IoT hub.

name
str
Required

The name of the consumer group to retrieve.

cls
callable

A custom type or function that will be passed the direct response

Returns

EventHubConsumerGroupInfo, or the result of cls(response)

Return type

Exceptions

get_job

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.

async get_job(resource_group_name: str, resource_name: str, job_id: str, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.JobResponse

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

job_id
str
Required

The job identifier.

cls
callable

A custom type or function that will be passed the direct response

Returns

JobResponse, or the result of cls(response)

Return type

Exceptions

get_keys_for_key_name

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.

async get_keys_for_key_name(resource_group_name: str, resource_name: str, key_name: str, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.SharedAccessSignatureAuthorizationRule

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

key_name
str
Required

The name of the shared access policy.

cls
callable

A custom type or function that will be passed the direct response

Returns

SharedAccessSignatureAuthorizationRule, or the result of cls(response)

Return type

Exceptions

get_quota_metrics

Get the quota metrics for an IoT hub.

Get the quota metrics for an IoT hub.

get_quota_metrics(resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.iothub.v2019_11_04.models._models_py3.IotHubQuotaMetricInfoListResult]

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either IotHubQuotaMetricInfoListResult or the result of cls(response)

Return type

Exceptions

get_stats

Get the statistics from an IoT hub.

Get the statistics from an IoT hub.

async get_stats(resource_group_name: str, resource_name: str, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.RegistryStatistics

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

cls
callable

A custom type or function that will be passed the direct response

Returns

RegistryStatistics, or the result of cls(response)

Return type

Exceptions

get_valid_skus

Get the list of valid SKUs for an IoT hub.

Get the list of valid SKUs for an IoT hub.

get_valid_skus(resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.iothub.v2019_11_04.models._models_py3.IotHubSkuDescriptionListResult]

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either IotHubSkuDescriptionListResult or the result of cls(response)

Return type

Exceptions

import_devices

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.

async import_devices(resource_group_name: str, resource_name: str, import_devices_parameters: azure.mgmt.iothub.v2019_11_04.models._models_py3.ImportDevicesRequest, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.JobResponse

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

import_devices_parameters
ImportDevicesRequest
Required

The parameters that specify the import devices operation.

cls
callable

A custom type or function that will be passed the direct response

Returns

JobResponse, or the result of cls(response)

Return type

Exceptions

list_by_resource_group

Get all the IoT hubs in a resource group.

Get all the IoT hubs in a resource group.

list_by_resource_group(resource_group_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.iothub.v2019_11_04.models._models_py3.IotHubDescriptionListResult]

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either IotHubDescriptionListResult or the result of cls(response)

Return type

Exceptions

list_by_subscription

Get all the IoT hubs in a subscription.

Get all the IoT hubs in a subscription.

list_by_subscription(**kwargs: Any) -> AsyncIterable[azure.mgmt.iothub.v2019_11_04.models._models_py3.IotHubDescriptionListResult]

Parameters

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either IotHubDescriptionListResult or the result of cls(response)

Return type

Exceptions

list_event_hub_consumer_groups

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.

list_event_hub_consumer_groups(resource_group_name: str, resource_name: str, event_hub_endpoint_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.iothub.v2019_11_04.models._models_py3.EventHubConsumerGroupsListResult]

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

event_hub_endpoint_name
str
Required

The name of the Event Hub-compatible endpoint.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either EventHubConsumerGroupsListResult or the result of cls(response)

Return type

Exceptions

list_jobs

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.

list_jobs(resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.iothub.v2019_11_04.models._models_py3.JobResponseListResult]

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either JobResponseListResult or the result of cls(response)

Return type

Exceptions

list_keys

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.

list_keys(resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.iothub.v2019_11_04.models._models_py3.SharedAccessSignatureAuthorizationRuleListResult]

Parameters

resource_group_name
str
Required

The name of the resource group that contains the IoT hub.

resource_name
str
Required

The name of the IoT hub.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either SharedAccessSignatureAuthorizationRuleListResult or the result of cls(response)

Return type

Exceptions

test_all_routes

Test all routes.

Test all routes configured in this Iot Hub.

async test_all_routes(iot_hub_name: str, resource_group_name: str, input: azure.mgmt.iothub.v2019_11_04.models._models_py3.TestAllRoutesInput, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.TestAllRoutesResult

Parameters

iot_hub_name
str
Required

IotHub to be tested.

resource_group_name
str
Required

resource group which Iot Hub belongs to.

input
TestAllRoutesInput
Required

Input for testing all routes.

cls
callable

A custom type or function that will be passed the direct response

Returns

TestAllRoutesResult, or the result of cls(response)

Return type

Exceptions

test_route

Test the new route.

Test the new route for this Iot Hub.

async test_route(iot_hub_name: str, resource_group_name: str, input: azure.mgmt.iothub.v2019_11_04.models._models_py3.TestRouteInput, **kwargs: Any) -> azure.mgmt.iothub.v2019_11_04.models._models_py3.TestRouteResult

Parameters

iot_hub_name
str
Required

IotHub to be tested.

resource_group_name
str
Required

resource group which Iot Hub belongs to.

input
TestRouteInput
Required

Route that needs to be tested.

cls
callable

A custom type or function that will be passed the direct response

Returns

TestRouteResult, or the result of cls(response)

Return type

Exceptions

Attributes

models

models = <module 'azure.mgmt.iothub.v2019_11_04.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\iothub\\v2019_11_04\\models\\__init__.py'>