Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ResourceCommandService

Handle
📦 Aspire.Hosting v17.0.0

A service to execute resource commands.

type ResourceCommandService interface{}

Methods

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).