You can call this operation to modify the parameters and content of a Cloud Assistant command.

Description

You can modify a command during its invocation. After the command is modified, the new command content applies to subsequent invocations.

You cannot modify the command type. For example, you cannot change a shell command (RunShellScript) to a batch command (RunBatScript).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyCommand

The operation that you want to perform. Set the value to ModifyCommand.

CommandId String Yes c-hz01272yr52****

The ID of the command. You can call the DescribeCommands operation to query all available command IDs.

RegionId String Yes cn-hangzhou

The ID of the region. You can call the DescribeRegions operation to query the most recent region list.

Name String No test-CommandName

The name of the command. The name supports all character sets. It cannot exceed 128 characters in length.

Description String No This is description.

The description of the command. The description can be up to 512 characters in length and can contain any characters.

WorkingDir String No /home/

The directory path for command execution.

Timeout Long No 120

The timeout period that is specified for the command to be run on ECS instances. Unit: seconds. When a command cannot run within the specified time range, the command times out. When a command execution times out, the Cloud Assistant client forces the command process to stop by canceling the PID of the command.

Response parameters

Parameter Type Example Description
RequestId String 0DE9B41E-EF0D-40A0-BB43-37749C5BDA9C

The ID of the request.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=ModifyCommand
&CommandId=c-hz01272yr52****
&RegionId=cn-hangzhou
&Name=test-CommandName
&Description=This is description.
&CommandContent=c2VydmljZSB0b21jYXQgc3RhcnQ=
&WorkingDir=/home/
&Timeout=120
&<Common request parameters>

Sample success responses

XML format

<ModifyCommandResponse>
      <RequestId>0DE9B41E-EF0D-40A0-BB43-37749C5BDA9C</RequestId>
</ModifyCommandResponse>

JSON format

{
    "RequestId": "0DE9B41E-EF0D-40A0-BB43-37749C5BDA9C"
}

Error codes

HttpCode Error code Error message Description
404 InvalidCmdId.NotFound The specified command ID does not exist. The error message returned because the specified CommandId parameter is invalid. You can call the DescribeCommands operation to query all available command IDs.
404 InvalidCmdType.NotFound The specified command type does not exist. The error message returned because the specified command type does not exist.

For a list of error codes, visit the API Error Center.