ModifyCommand_云服务器 ECS_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

流控信息

请求速率为1000/60(s)。更多流控信息,请前往配额中心查看

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
ecs:ModifyCommand
Update
Command
acs:ecs:{#regionId}:{#accountId}:command/{#commandId}

请求参数

字段名称字段详情
RegionIdstring

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

示例值:cn-hangzhou参考取值来源:
    DescribeRegions
CommandIdstring

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

示例值:c-hz01272yr52****参考取值来源:
    RunCommand
    CreateCommand
    DescribeCommands
Namestring

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

示例值:test-CommandName
Descriptionstring

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

示例值:This is description.
CommandContentstring
说明 该参数已废弃,传入该参数不会生效。
示例值:echo
WorkingDirstring

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

示例值:/home/
Timeoutinteger<int64>

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

注意 该字段类型为 Long,在序列化/反序列化的过程中可能导致精度丢失,请注意数值不得大于 9007199254740991。
示例值:120
Launcherstring

脚本执行的引导程序。长度不能超过 1 KB。

示例值:python3 -u {{ACS::ScriptFileName|Ext(".py")}}

返回参数

字段名称字段详情
RequestIdstring

请求 ID。

示例值:0DE9B41E-EF0D-40A0-BB43-37749C5BDA9C

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
RegionId.ApiNotSupported
The api is not supported in this region.诊断
400
InvalidParameter.WorkingDir
The specified parameter WorkingDir is not valid.诊断
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.诊断
403
InvalidParameterCharacter.CommandName
The command Name contains illegal characters.诊断
403
InvalidParameterCharacter.CommandDescription
The command Description contains illegal characters.诊断
403
InvalidParameterCharacter.CommandWorkingDir
The command WorkingDir contains illegal characters.诊断
403
InvalidLauncher.LengthLimitExceeded
The length of the parameter Launcher exceeds the limit of 1 KB characters.诊断
404
InvalidRegionId.NotFound
The RegionId provided does not exist in our records.诊断
404
InvalidCmdId.NotFound
The specified command ID does not exist.诊断
500
InternalError.Dispatch
An error occurred when you dispatched the request.诊断

变更历史

变更时间变更内容概要操作
2024-10-29
变更错误码403
新增请求参数Launcher
2024-05-11
变更错误码403
2023-05-12
变更错误码400
2022-02-23
变更错误码403
变更错误码404
新增错误码500

相关示例