Dela via


ModulesClient.GetAsync(String, String, CancellationToken) Method

Definition

Get a module identity by its Id and by the Id of the device it is registered on.

public virtual System.Threading.Tasks.Task<Microsoft.Azure.Devices.Module> GetAsync (string deviceId, string moduleId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Module>
override this.GetAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Module>
Public Overridable Function GetAsync (deviceId As String, moduleId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Module)

Parameters

deviceId
String

The unique identifier of the device identity that the module is registered on.

moduleId
String

The unique identifier of the module identity to retrieve.

cancellationToken
CancellationToken

The token which allows the operation to be canceled.

Returns

The retrieved module identity.

Exceptions

Thrown when the provided device Id or module Id is null.

Thrown when the provided device Id or module Id is empty or whitespace.

Thrown if IoT hub responded to the request with a non-successful status code. For example, if the provided request was throttled, IotHubServiceException with ThrottlingException is thrown. For a complete list of possible error cases, see IotHubServiceErrorCode.

If the HTTP request fails due to an underlying issue such as network connectivity, DNS failure, or server certificate validation.

If the provided cancellation token has requested cancellation.

Applies to