IoTHubConfigurationManager Class

A class to provide convenience APIs for IoTHub Configuration Manager operations, based on top of the auto generated IotHub REST APIs

Inheritance
builtins.object
IoTHubConfigurationManager

Constructor

IoTHubConfigurationManager(connection_string=None, host=None, auth=None)

Parameters

connection_string
default value: None
host
default value: None
auth
default value: None

Methods

apply_configuration_on_edge_device

Applies the provided configuration content to the specified edge device. Modules content is mandantory.

create_configuration

Creates a configuration for devices or modules of an IoTHub.

delete_configuration

Deletes a configuration from an IoTHub.

from_connection_string

Classmethod initializer for a IoTHubConfigurationManager Service client. Creates IoTHubConfigurationManager class from connection string.

After a successful creation the class has been authenticated with IoTHub and it is ready to call the member APIs to communicate with IoTHub.

from_token_credential

Classmethod initializer for a IoTHubConfigurationManager Service client. Creates IoTHubConfigurationManager class from host name url and Azure token credential.

After a successful creation the class has been authenticated with IoTHub and it is ready to call the member APIs to communicate with IoTHub.

get_configuration

Retrieves the IoTHub configuration for a particular device.

get_configurations

Retrieves multiple configurations for device and modules of an IoTHub. Returns the specified number of configurations. Pagination is not supported.

test_configuration_queries

Validates the target condition query and custom metric queries for a configuration.

update_configuration

Updates a configuration for devices or modules of an IoTHub. Note: that configuration Id and Content cannot be updated by the user.

apply_configuration_on_edge_device

Applies the provided configuration content to the specified edge device. Modules content is mandantory.

apply_configuration_on_edge_device(device_id, configuration_content)

Parameters

configuration_content
ConfigurationContent
Required

The name (Id) of the edge device.

configuration_content
Required

Returns

An object.

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

create_configuration

Creates a configuration for devices or modules of an IoTHub.

create_configuration(configuration)

Parameters

configuration_id
str
Required

The id of the configuration.

configuration
Configuration
Required

The configuration to create.

Returns

Configuration object containing the created configuration.

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

delete_configuration

Deletes a configuration from an IoTHub.

delete_configuration(configuration_id, etag=None)

Parameters

configuration_id
str
Required

The id of the configuration.

configuration
Configuration
default value: None

The configuration to create.

etag
str
Required

The etag (if_match) value to use for the delete operation.

Returns

Configuration object containing the updated configuration.

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

from_connection_string

Classmethod initializer for a IoTHubConfigurationManager Service client. Creates IoTHubConfigurationManager class from connection string.

After a successful creation the class has been authenticated with IoTHub and it is ready to call the member APIs to communicate with IoTHub.

from_connection_string(connection_string)

Parameters

connection_string
str
Required

The IoTHub connection string used to authenticate connection with IoTHub.

connection_string
Required

Return type

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

from_token_credential

Classmethod initializer for a IoTHubConfigurationManager Service client. Creates IoTHubConfigurationManager class from host name url and Azure token credential.

After a successful creation the class has been authenticated with IoTHub and it is ready to call the member APIs to communicate with IoTHub.

from_token_credential(url, token_credential)

Parameters

url
str
Required

The Azure service url (host name).

token_credential
str
Required

The Azure token credential object.

token_credential
Required

Return type

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

get_configuration

Retrieves the IoTHub configuration for a particular device.

get_configuration(configuration_id)

Parameters

configuration_id
str
Required

The id of the configuration.

Returns

The Configuration object.

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

get_configurations

Retrieves multiple configurations for device and modules of an IoTHub. Returns the specified number of configurations. Pagination is not supported.

get_configurations(max_count=None)

Parameters

max_count
int
default value: None

The maximum number of configurations requested.

Returns

The list[Configuration] object.

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

test_configuration_queries

Validates the target condition query and custom metric queries for a configuration.

test_configuration_queries(configuration_queries_test_input)

Parameters

configuration_queries_test_input
ConfigurationQueriesTestInput
Required

The queries test input.

Returns

The ConfigurationQueriesTestResponse object.

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

update_configuration

Updates a configuration for devices or modules of an IoTHub. Note: that configuration Id and Content cannot be updated by the user.

update_configuration(configuration, etag)

Parameters

configuration_id
str
Required

The id of the configuration.

configuration
Configuration
Required

The configuration contains the updated configuration.

etag
str
Required

The etag (if_match) value to use for the update operation.

Returns

Configuration object containing the updated configuration.

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>