Share via


DigitalTwinClient.InvokeCommandAsync Method

Definition

Invoke a command on a digital twin.

public virtual System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Azure.Devices.DigitalTwinCommandResponse,Microsoft.Azure.Devices.DigitalTwinInvokeCommandHeaders>> InvokeCommandAsync (string digitalTwinId, string commandName, string payload = default, Microsoft.Azure.Devices.DigitalTwinInvokeCommandRequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member InvokeCommandAsync : string * string * string * Microsoft.Azure.Devices.DigitalTwinInvokeCommandRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Azure.Devices.DigitalTwinCommandResponse, Microsoft.Azure.Devices.DigitalTwinInvokeCommandHeaders>>
override this.InvokeCommandAsync : string * string * string * Microsoft.Azure.Devices.DigitalTwinInvokeCommandRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Azure.Devices.DigitalTwinCommandResponse, Microsoft.Azure.Devices.DigitalTwinInvokeCommandHeaders>>
Public Overridable Function InvokeCommandAsync (digitalTwinId As String, commandName As String, Optional payload As String = Nothing, Optional requestOptions As DigitalTwinInvokeCommandRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpOperationResponse(Of DigitalTwinCommandResponse, DigitalTwinInvokeCommandHeaders))

Parameters

digitalTwinId
String

The Id of the digital twin.

commandName
String

The command to be invoked.

payload
String

The command payload.

requestOptions
DigitalTwinInvokeCommandRequestOptions

The optional settings for this request.

cancellationToken
CancellationToken

The cancellationToken.

Returns

The application/json command invocation response and the http response.

Applies to