Share via


ModuleClient.InvokeMethodAsync Method

Definition

Overloads

InvokeMethodAsync(String, String, MethodRequest, CancellationToken)

Interactively invokes a method from an edge module to a different edge module. Both of the edge modules need to be connected to the same edge hub.

InvokeMethodAsync(String, String, MethodRequest)

Interactively invokes a method from an edge module to a different edge module. Both of the edge modules need to be connected to the same edge hub.

InvokeMethodAsync(String, MethodRequest, CancellationToken)

Interactively invokes a method from an edge module to an edge device. Both the edge module and the edge device need to be connected to the same edge hub.

InvokeMethodAsync(String, MethodRequest)

Interactively invokes a method from an edge module to an edge device. Both the edge module and the edge device need to be connected to the same edge hub.

InvokeMethodAsync(String, String, MethodRequest, CancellationToken)

Interactively invokes a method from an edge module to a different edge module. Both of the edge modules need to be connected to the same edge hub.

public System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.MethodResponse> InvokeMethodAsync (string deviceId, string moduleId, Microsoft.Azure.Devices.Client.MethodRequest methodRequest, System.Threading.CancellationToken cancellationToken);
member this.InvokeMethodAsync : string * string * Microsoft.Azure.Devices.Client.MethodRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.MethodResponse>
Public Function InvokeMethodAsync (deviceId As String, moduleId As String, methodRequest As MethodRequest, cancellationToken As CancellationToken) As Task(Of MethodResponse)

Parameters

deviceId
String

The unique identifier of the device.

moduleId
String

The unique identifier of the edge module to invoke the method on.

methodRequest
MethodRequest

The details of the method to invoke.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

The result of the method invocation.

Exceptions

Thrown when the operation has been canceled.

Applies to

InvokeMethodAsync(String, String, MethodRequest)

Interactively invokes a method from an edge module to a different edge module. Both of the edge modules need to be connected to the same edge hub.

public System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.MethodResponse> InvokeMethodAsync (string deviceId, string moduleId, Microsoft.Azure.Devices.Client.MethodRequest methodRequest);
member this.InvokeMethodAsync : string * string * Microsoft.Azure.Devices.Client.MethodRequest -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.MethodResponse>
Public Function InvokeMethodAsync (deviceId As String, moduleId As String, methodRequest As MethodRequest) As Task(Of MethodResponse)

Parameters

deviceId
String

The unique identifier of the device.

moduleId
String

The unique identifier of the edge module to invoke the method on.

methodRequest
MethodRequest

The details of the method to invoke.

Returns

The result of the method invocation.

Exceptions

Thrown when the operation has been canceled.

Applies to

InvokeMethodAsync(String, MethodRequest, CancellationToken)

Interactively invokes a method from an edge module to an edge device. Both the edge module and the edge device need to be connected to the same edge hub.

public System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.MethodResponse> InvokeMethodAsync (string deviceId, Microsoft.Azure.Devices.Client.MethodRequest methodRequest, System.Threading.CancellationToken cancellationToken);
member this.InvokeMethodAsync : string * Microsoft.Azure.Devices.Client.MethodRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.MethodResponse>
Public Function InvokeMethodAsync (deviceId As String, methodRequest As MethodRequest, cancellationToken As CancellationToken) As Task(Of MethodResponse)

Parameters

deviceId
String

The unique identifier of the edge device to invoke the method on.

methodRequest
MethodRequest

The details of the method to invoke.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

The result of the method invocation.

Exceptions

Thrown when the operation has been canceled.

Applies to

InvokeMethodAsync(String, MethodRequest)

Interactively invokes a method from an edge module to an edge device. Both the edge module and the edge device need to be connected to the same edge hub.

public System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.MethodResponse> InvokeMethodAsync (string deviceId, Microsoft.Azure.Devices.Client.MethodRequest methodRequest);
member this.InvokeMethodAsync : string * Microsoft.Azure.Devices.Client.MethodRequest -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.MethodResponse>
Public Function InvokeMethodAsync (deviceId As String, methodRequest As MethodRequest) As Task(Of MethodResponse)

Parameters

deviceId
String

The unique identifier of the edge device to invoke the method on.

methodRequest
MethodRequest

The details of the method to invoke.

Returns

The result of the method invocation.

Applies to