Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ResourceCommandService.ExecuteCommandAsync

Method
📦 Aspire.Hosting v17.0.0
type ResourceCommandService interface {
// ... omitted for brevity
ExecuteCommandAsync(
resource any,
commandName string,
options ...*ExecuteCommandAsyncOptions,
) (*ExecuteCommandResult, error)
}

Signature

methodExecuteCommandAsync
Executes a command for the specified resource.
ExecuteCommandAsync(
resource any,
commandName string,
options ...*ExecuteCommandAsyncOptions,
) (*ExecuteCommandResult, error)
resourceanyThe resource id or resource handle. A resource id can either exactly match the unique id of the resource or the displayed resource name if the resource name doesn't have duplicates.
commandNamestringThe command name.
options...*ExecuteCommandAsyncOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*ExecuteCommandAsyncOptions argument.

Argumentsmap[string]stringThe optional invocation arguments supplied to the command callback.
CancellationToken*CancellationTokenThe cancellation token.
(*ExecuteCommandResult, error)

The command execution result.

Returns (*ExecuteCommandResult, error).

Defined on

This method is defined on the following type: