Modifies the parameters of a Cloud Assistant command.

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.

RegionId String Yes cn-hangzhou

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

CommandId String Yes c-hz01272yr52****

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

Name String No test-CommandName

The name of the command. The name supports all character sets and can be up to 128 characters in length.

Description String No This is description.

The description of the command. The description supports all character sets and can be up to 512 characters in length.

CommandContent String No echo
Note This parameter is no longer used and does not take effect.
WorkingDir String No /home/

The execution path of the command: The value can be up to 200 characters in length.

Timeout Long No 120

The maximum timeout period for the command execution on instances. Unit: seconds. When a command cannot run within the specified period of time, a timeout error occurs. When a command execution times out, the Cloud Assistant client forcefully terminates the command process by canceling the process ID (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

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HTTP status code Error code Error message Description
400 RegionId.ApiNotSupported The api is not supported in this region. This operation cannot be performed in the specified region. Check whether the RegionId parameter is valid.
400 InvalidParameter.WorkingDir The specified parameter WorkingDir is not valid. Invalid WorkingDir value.
403 CmdName.Readonly The command name is readonly after publishing. The command is published and cannot have its name changed.
403 CmdName.ExceedLimit The length of the command name exceeds the upper limit. The maximum length of the command name is exceeded.
403 CmdContent.ExceedLimit The length of the command content exceeds the upper limit. The maximum length of command content is exceeded.
403 CmdDesc.ExceedLimit The length of the command description exceeds the upperlimit. The maximum length of the command description is exceeded.
403 Operation.Forbidden The operation is not permitted. The operation is not supported.
404 InvalidCmdId.NotFound The specified command ID does not exist. Invalid CommandId value. You can call the DescribeCommands operation to query all available command IDs.
500 InternalError.Dispatch An error occurred when you dispatched the request. An error occurred while the request was being sent. Try again later.

For a list of error codes, see Service error codes.