IotHubResourceOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

IotHubClient's

<xref:iot_hub_resource> attribute.

Inheritance
builtins.object
IotHubResourceOperations

Constructor

IotHubResourceOperations(*args, **kwargs)

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: _models.IotHubDescription, if_match: str | None = None, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.IotHubDescription]

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

iot_hub_description
Required

The IoT hub metadata and security metadata. Is either a IotHubDescription type or a IO type. Required.

if_match
Required
str

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

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

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

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

Type Description

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

Exceptions

Type Description

begin_delete

Delete an IoT hub.

Delete an IoT hub.

async begin_delete(resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[IotHubDescription]

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

Keyword-Only Parameters

Name Description
cls

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

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

Type Description

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

Exceptions

Type Description

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: _models.TagsResource, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.IotHubDescription]

Parameters

Name Description
resource_group_name
Required
str

Resource group identifier. Required.

resource_name
Required
str

Name of iot hub to update. Required.

iot_hub_tags
Required

Updated tag information to set into the iot hub instance. Is either a TagsResource type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

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

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

Type Description

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

Exceptions

Type Description

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: _models.OperationInputs, *, content_type: str = 'application/json', **kwargs: Any) -> _models.IotHubNameAvailabilityInfo

Parameters

Name Description
operation_inputs
Required

Set the name parameter in the OperationInputs structure to the name of the IoT hub to check. Is either a OperationInputs type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

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

Returns

Type Description

IotHubNameAvailabilityInfo or the result of cls(response)

Exceptions

Type Description

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, consumer_group_body: _models.EventHubConsumerGroupBodyDescription, *, content_type: str = 'application/json', **kwargs: Any) -> _models.EventHubConsumerGroupInfo

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

event_hub_endpoint_name
Required
str

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

name
Required
str

The name of the consumer group to add. Required.

consumer_group_body
Required

The consumer group to add. Is either a EventHubConsumerGroupBodyDescription type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

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

Returns

Type Description

EventHubConsumerGroupInfo or the result of cls(response)

Exceptions

Type Description

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

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

event_hub_endpoint_name
Required
str

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

name
Required
str

The name of the consumer group to delete. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

None or the result of cls(response)

Exceptions

Type Description

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: _models.ExportDevicesRequest, *, content_type: str = 'application/json', **kwargs: Any) -> _models.JobResponse

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

export_devices_parameters
Required

The parameters that specify the export devices operation. Is either a ExportDevicesRequest type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

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

Returns

Type Description

JobResponse or the result of cls(response)

Exceptions

Type Description

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) -> IotHubDescription

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

IotHubDescription or the result of cls(response)

Exceptions

Type Description

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[EndpointHealthData]

Parameters

Name Description
resource_group_name
Required
str

Required.

iot_hub_name
Required
str

Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

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) -> EventHubConsumerGroupInfo

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

event_hub_endpoint_name
Required
str

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

name
Required
str

The name of the consumer group to retrieve. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

EventHubConsumerGroupInfo or the result of cls(response)

Exceptions

Type Description

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) -> JobResponse

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

job_id
Required
str

The job identifier. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

JobResponse or the result of cls(response)

Exceptions

Type Description

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) -> SharedAccessSignatureAuthorizationRule

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

key_name
Required
str

The name of the shared access policy. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

SharedAccessSignatureAuthorizationRule or the result of cls(response)

Exceptions

Type Description

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[IotHubQuotaMetricInfo]

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

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) -> RegistryStatistics

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

RegistryStatistics or the result of cls(response)

Exceptions

Type Description

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[IotHubSkuDescription]

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

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: _models.ImportDevicesRequest, *, content_type: str = 'application/json', **kwargs: Any) -> _models.JobResponse

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

import_devices_parameters
Required

The parameters that specify the import devices operation. Is either a ImportDevicesRequest type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

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

Returns

Type Description

JobResponse or the result of cls(response)

Exceptions

Type Description

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[IotHubDescription]

Parameters

Name Description
resource_group_name
Required
str

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

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

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[IotHubDescription]

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

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[EventHubConsumerGroupInfo]

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

event_hub_endpoint_name
Required
str

The name of the Event Hub-compatible endpoint. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

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[JobResponse]

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

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[SharedAccessSignatureAuthorizationRule]

Parameters

Name Description
resource_group_name
Required
str

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

resource_name
Required
str

The name of the IoT hub. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

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: _models.TestAllRoutesInput, *, content_type: str = 'application/json', **kwargs: Any) -> _models.TestAllRoutesResult

Parameters

Name Description
iot_hub_name
Required
str

IotHub to be tested. Required.

resource_group_name
Required
str

resource group which Iot Hub belongs to. Required.

input
Required

Input for testing all routes. Is either a TestAllRoutesInput type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

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

Returns

Type Description

TestAllRoutesResult or the result of cls(response)

Exceptions

Type Description

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: _models.TestRouteInput, *, content_type: str = 'application/json', **kwargs: Any) -> _models.TestRouteResult

Parameters

Name Description
iot_hub_name
Required
str

IotHub to be tested. Required.

resource_group_name
Required
str

resource group which Iot Hub belongs to. Required.

input
Required

Route that needs to be tested. Is either a TestRouteInput type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

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

Returns

Type Description

TestRouteResult or the result of cls(response)

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.iothub.v2021_07_02.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\iothub\\v2021_07_02\\models\\__init__.py'>