IoTHubDigitalTwinManager Class

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

Inheritance
builtins.object
IoTHubDigitalTwinManager

Constructor

IoTHubDigitalTwinManager(connection_string)

Parameters

connection_string

Methods

get_digital_twin

Retrieve the Digital Twin of a given device. :param str digital_twin__id: The digital twin Id of the given device.

invoke_command

Invoke a command on a particular device and get the result of it. :param str digital_twin__id: The digital twin Id of the given device. :param str command_name: The command's name. :param str payload: The argument of a command. :param int connect_timeout_in_seconds: Maximum interval of time, in seconds, that the digital twin command will wait for the answer. :param int response_timeout_in_seconds: Maximum interval of time, in seconds, that the digital twin command will wait for the response. The value must be within 5-300.

invoke_component_command

Invoke a command on an component of a particular device and get the result of it. :param str digital_twin__id: The digital twin Id of the given device. :param str component_path: The component's name. :param str command_name: The command's name. :param str payload: The argument of a command. :param int connect_timeout_in_seconds: Maximum interval of time, in seconds, that the digital twin command will wait for the answer. :param int response_timeout_in_seconds: Maximum interval of time, in seconds, that the digital twin command will wait for the response. The value must be within 5-300. :type response_timeout_in_seconds: int

update_digital_twin

Update the Digital Twin Component of a given device using a patch object. :param str digital_twin__id: The digital twin Id of the given device. :param list[object]: The json-patch object to update the Digital Twin. :param str etag: The etag (if_match) value to use for the update operation.

get_digital_twin

Retrieve the Digital Twin of a given device. :param str digital_twin__id: The digital twin Id of the given device.

get_digital_twin(digital_twin_id)

Parameters

digital_twin_id
Required

Returns

The return object containing the Digital Twin.

Exceptions

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

invoke_command

Invoke a command on a particular device and get the result of it. :param str digital_twin__id: The digital twin Id of the given device. :param str command_name: The command's name. :param str payload: The argument of a command. :param int connect_timeout_in_seconds: Maximum interval of time, in seconds, that the digital twin command will wait for the answer. :param int response_timeout_in_seconds: Maximum interval of time, in seconds, that the digital twin command will wait for the response. The value must be within 5-300.

invoke_command(digital_twin_id, command_name, payload, connect_timeout_in_seconds=None, response_timeout_in_seconds=None)

Parameters

digital_twin_id
Required
command_name
Required
payload
Required
connect_timeout_in_seconds
default value: None
response_timeout_in_seconds
default value: None

Returns

The result of the invoked command.

Exceptions

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

invoke_component_command

Invoke a command on an component of a particular device and get the result of it. :param str digital_twin__id: The digital twin Id of the given device. :param str component_path: The component's name. :param str command_name: The command's name. :param str payload: The argument of a command. :param int connect_timeout_in_seconds: Maximum interval of time, in seconds, that the digital twin command will wait for the answer. :param int response_timeout_in_seconds: Maximum interval of time, in seconds, that the digital twin command will wait for the response. The value must be within 5-300. :type response_timeout_in_seconds: int

invoke_component_command(digital_twin_id, component_path, command_name, payload, connect_timeout_in_seconds=None, response_timeout_in_seconds=None)

Parameters

digital_twin_id
Required
component_path
Required
command_name
Required
payload
Required
connect_timeout_in_seconds
default value: None
response_timeout_in_seconds
default value: None

Returns

The result of the invoked command.

Exceptions

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

update_digital_twin

Update the Digital Twin Component of a given device using a patch object. :param str digital_twin__id: The digital twin Id of the given device. :param list[object]: The json-patch object to update the Digital Twin. :param str etag: The etag (if_match) value to use for the update operation.

update_digital_twin(digital_twin_id, digital_twin_patch, etag=None)

Parameters

digital_twin_id
Required
digital_twin_patch
Required
etag
default value: None

Returns

The return object containing the updated Digital Twin.

Exceptions

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