Skip to main content

ecs command

Manage ECS Cloud Assistant command templates and invocations

Run ecctl ecs command <action> -h for usage, or ecctl schema ecs.command.<action> --full for the complete, agent-readable spec of every parameter and behavior.

create

ecctl ecs command create [flags]

Create cloud assistant command template

  • Kind: mutation · Risk: medium
  • Idempotent via ClientToken.
APIWhen calledPurpose
CreateCommandEvery time the command runs.Perform the resource operation.
DescribeCommandsEvery time the command runs.Read the resource view.
ParameterTypeRequiredDescription
--command-contentstringcommand content to run on the instance
--namestringcommand name
--regionstringAlibaba Cloud region
--typestringcommand type
--command-timeoutintegercommand timeout in seconds
--content-encodingstringcommand content encoding
--descriptionstringcommand description
--enable-parameterbooleanenable custom parameters in the command
--launcherstringcommand launcher
--resource-groupstringresource group ID
--tagkey_valuetag assignment key=value
--working-dirstringcommand working directory

update

ecctl ecs command update <id> [flags]

Update command template or invocation attribute

  • Kind: mutation · Risk: medium
APIWhen calledPurpose
ModifyInvocationAttributeWhen --invocation-id is specified.Perform the resource operation.
ModifyCommandWhen &lt;id> is specified.Perform the resource operation.
DescribeInvocationsWhen --invocation-id is specified and --no-wait is not specified.Read the resource view.
DescribeCommandsWhen &lt;id> is specified and --no-wait is not specified.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--command-contentstringcommand content to run on the instance
--command-timeoutintegercommand timeout in seconds
--descriptionstringcommand description
--frequencystringscheduled execution frequency (cron expression)
--invocation-idstringinvocation (execution record) ID
--launcherstringcommand launcher
--namestringcommand name
--repeat-modestringexecution repeat mode
--timedbooleanwhether the invocation is scheduled
--working-dirstringcommand working directory

delete

ecctl ecs command delete <id> [flags]

Delete command template

  • Kind: mutation · Risk: high
  • Synchronous: waits for absent (waiter deleted_after_delete, timeout 120s); use --no-wait to skip.
APIWhen calledPurpose
DeleteCommandEvery time the command runs.Perform the resource operation.
DescribeCommandsWhen --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region

get

ecctl ecs command get <id> [flags]

Get command template, invocation, or invocation results

  • Kind: read · Risk: low
APIWhen calledPurpose
DescribeInvocationsWhen --invocation-id is specified.Read the resource view.
DescribeInvocationResultsWhen --with-results is specified.Read the resource view.
DescribeCommandsWhen &lt;id> is specified.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--fieldsstringcomma-separated resource fields to include
--include-historybooleaninclude historical invocation results
--include-outputbooleaninclude invocation output in the response
--instancestringsingle instance ID filter
--invocation-idstringinvocation (execution record) ID
--invoke-record-statusstringinvocation record status filter
--with-resultsbooleaninclude invocation results in the response

list

ecctl ecs command list <id> [flags]

List command templates or invocation records

  • Kind: read · Risk: low
APIWhen calledPurpose
DescribeInvocationsWhen --invocations is specified.Read the resource view.
DescribeCommandsWhen --invocations is not specified.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--content-encodingstringcommand content encoding
--fieldsstringcomma-separated resource fields to include
--filterkey_valuefilter expression key=value
--include-outputbooleaninclude invocation output in the response
--invocationsbooleanlist invocation records instead of command templates
--limitintegermaximum resources to return (default: 50)
--next-tokenstringtoken for the next result page

invoke

ecctl ecs command invoke <id> [flags]

Invoke a command on target instances

  • Kind: mutation · Risk: high
  • Synchronous: waits for Finished (waiter finished_after_invoke, timeout 600s); use --no-wait to skip.
  • Idempotent via ClientToken.
APIWhen calledPurpose
InvokeCommandEvery time the command runs.Perform the resource operation.
DescribeInvocationsWhen --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
DescribeInvocationResultsWhen --no-wait is not specified.Read the resource view.
ParameterTypeRequiredDescription
--instance-idsarrayinstance IDs to target
--regionstringAlibaba Cloud region
--container-idstringcontainer ID
--container-namestringcontainer name
--frequencystringscheduled execution frequency (cron expression)
--parametersstringcommand parameters as a JSON object
--repeat-modestringexecution repeat mode
--resource-groupstringresource group ID
--tagkey_valuetag assignment key=value
--timedbooleanwhether the invocation is scheduled
--usernamestringusername to run the command as
--windows-password-namestringencrypted Windows password key name

stop

ecctl ecs command stop <invocation-id> [flags]

Stop a running invocation

  • Kind: mutation · Risk: medium
  • Synchronous: waits for Stopped (waiter stopped_after_stop, timeout 300s); use --no-wait to skip.
APIWhen calledPurpose
StopInvocationEvery time the command runs.Perform the resource operation.
DescribeInvocationsWhen --no-wait is not specified.Poll until the resource reaches the target state. (repeated)
DescribeInvocationsWhen --no-wait is not specified.Read the resource view.
DescribeInvocationResultsWhen --no-wait is not specified.Read the resource view.
ParameterTypeRequiredDescription
--regionstringAlibaba Cloud region
--forcebooleanforce stop the invocation when supported by the API (must be set explicitly) (default: false)
--instance-idsarrayinstance IDs to target