调用ModifyCommand修改一条云助手命令相关参数。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String ModifyCommand

系统规定参数。取值:ModifyCommand

RegionId String cn-hangzhou

地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。

CommandId String c-hz01272yr52****

命令ID。您可以通过接口DescribeCommands查询所有可用的CommandId。

Name String test-CommandName

命令名称。支持全字符集,长度不得超过128个字符。

Description String This is description.

命令描述。支持全字符集,长度不得超过512个字符。

CommandContent String echo
说明 该参数已废弃,传入该参数不会生效。
WorkingDir String /home/

执行路径。长度不得超过200个字符。

Timeout Long 120

您创建的命令在ECS实例中执行时最大的超时时间,单位为秒。当无法在配置的时间内运行并完成您创建的命令时,会出现超时现象。超时后,会强制终止命令进程,即取消命令的PID。

返回数据

名称 类型 示例值 描述
RequestId String 0DE9B41E-EF0D-40A0-BB43-37749C5BDA9C

请求ID。

示例

请求示例

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
&<公共请求参数>

正常返回示例

XML格式

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

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

JSON格式

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

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

错误码

HttpCode 错误码 错误信息 描述
400 RegionId.ApiNotSupported The api is not supported in this region. 指定地域下不支持调用 API。请检查 RegionId 参数取值是否正确。
400 InvalidParameter.WorkingDir The specified parameter WorkingDir is not valid. 指定的参数WorkingDir不合法。
403 CmdName.Readonly The command name is readonly after publishing. 命令已经发布,禁止修改。
403 CmdName.ExceedLimit The length of the command name exceeds the upper limit. 命令名称长度超过上限。
403 CmdContent.ExceedLimit The length of the command content exceeds the upper limit. 命令内容长度超过上限。
403 CmdDesc.ExceedLimit The length of the command description exceeds the upperlimit. 命令描述长度超过上限。
403 Operation.Forbidden The operation is not permitted. 该操作是不被允许的。
404 InvalidCmdId.NotFound The specified command ID does not exist. 指定的 CommandId 参数有误,请检查参数值是否正确。您可以通过接口 DescribeCommands 查询所有可用的 CommandId。
500 InternalError.Dispatch An error occurred when you dispatched the request. 发送请求时发生错误,请稍后重试。

访问错误中心查看更多错误码。