ModifyInvocationAttribute_云服务器 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.

接口说明

  • 支持修改以下执行方式的任务(参见 DescribeInvocations 返回的RepeatMode值):
    • Period:周期执行。
    • NextRebootOnly:当实例下一次启动时,自动执行命令。
    • EveryReboot:实例每一次启动都将自动执行命令。
  • 支持修改以下状态的任务(参见 DescribeInvocations 返回的InvocationStatus值):
    • Pending:系统正在校验或发送命令。存在至少一台实例的命令执行状态为 Pending,则总执行状态为 Pending。
    • Running:命令正在实例上运行。存在至少一台实例的命令执行状态为 Running,则总执行状态为 Running。
    • Scheduled:定时执行的命令已发送,等待运行。存在至少一台实例的命令执行状态为 Scheduled,则总执行状态为 Scheduled。
    • Stopping:正在停止任务。存在至少一台实例的命令执行状态为 Stopping,则总执行状态为 Stopping。
  • 修改定时任务执行信息(包括命令内容、自定义参数、执行频率)前,已执行的 ECS 实例或托管实例的云助手 Agent 版本需要高于以下对应的版本。
    • Linux:2.2.3.541
    • Windows:2.1.3.541
    • 如果调用结果返回InvalidOperation.CloudAssistantVersionUnsupported错误码,请将云助手 Agent 更新至最新版本。
  • 当您执行一个云助手公共命令时,无法修改命令内容CommandContent
  • 当您修改了命令内容CommandContent,且调用 InvokeCommand 或调用 RunCommand 时设置KeepCommandtrue创建任务,将会新增一条命令并长期保留,并占用云助手命令配额;在一个地域下,您最多可以保有 500~50,000 条云助手命令。您也可以申请提升配额,关于如何查询及提升配额,请参见配额管理

流控信息

请求速率为1000/60(s)。

授权信息

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

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
ecs:ModifyInvocationAttribute
Update
Invocation
acs:ecs:{#regionId}:{#accountId}:invocation/{#invocationId}
Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

请求参数

字段名称字段详情
RegionIdstring

地域 ID。

示例值:cn-hangzhou参考取值来源:
    DescribeRegions
InstanceIdarray<string>

待加入任务的 ECS 实例 ID 或托管实例 ID。

子级条数 <= 201
InvokeIdstring

待修改任务的命令执行 ID。

示例值:t-hz0jdfwd9f****参考取值来源:
    InvokeCommand
CommandContentstring

待修改后的命令内容。命令内容可以是明文内容或 Base64 编码后的内容。您需要注意:展开详情

示例值:ZWNobyAxMjM=
EnableParameterboolean

修改命令中是否包含自定义参数。展开详情

示例值:false
Parametersobject

命令中包含自定义参数时,修改执行命令时传入的自定义参数的键值对。展开详情

示例值:{"name":"Jack", "accessKey":"LTAI*************"}
Frequencystring

待修改的定时执行频率。仅当RepeatModePeriod时生效。目前支持三种定时执行方式:固定时间间隔执行(基于 Rate 表达式)、仅在指定时间执行一次、基于时钟定时执行(基于 Cron 表达式)。展开详情

示例值:0 */20 * * * *
ContentEncodingstring

命令内容(CommandContent)的编码方式。取值范围(不区分大小写):展开详情

示例值:PlainText

返回参数

字段名称字段详情
RequestIdstring

请求 ID。

示例值:473469C7-AA6F-4DC5-B3DB-A3DC0DE3****
CommandIdstring

命令 ID。展开详情

示例值:c-hz01272yr52****

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
InvalidParameter.Frequency
The specified parameter Frequency is not valid.诊断
400
InvalidParameters.KeyDuplicate
The key in the parameter Parameters cannot be duplicated.诊断
400
InvalidParameters.KeyNotMatch
The key in the parameter Parameters do not match those defined when creating the command.诊断
400
InvalidParameters.KeyMalformed
The key in the parameter Parameters is not valid.诊断
400
InvalidParameters.KeyEmpty
The key in the parameter Parameters cannot be empty.诊断
400
InvalidCommandContent.DecodeError
The specified parameter CommandContent can not be Base64 decoded.诊断
403
InvalidInstanceId.OSTypeUnsupported
The OS type of the instance corresponding to the parameter InstanceId does not support the specified command type.诊断
403
InvalidOperation.RepeatModeUnsupported
The operation is not supported for current repeat mode of invocation.诊断
403
InvalidOperation.InvokeAlreadyFinished
The operation is not supported for finished invocation.诊断
403
InvalidOperation.CloudAssistantVersionUnsupported
The operation is not supported for current CloudAssistant version of instance.诊断
403
InvalidOperation.ModifyPublicCommandUnsupported
Modification of the content of Public Command is not supported.诊断
403
InvalidCommandContent.LengthLimitExceeded
The length of the parameter CommandContent exceeds the limit of %s KB characters.诊断
403
InvalidParameters.CountLimitExceeded
The count of the parameter Parameters exceeds the limit of 10.诊断
403
InvalidParameters.KeyLengthLimitExceeded
The length of the key in the parameter Parameters exceeds the limit of 64 characters.诊断
403
InvalidInstanceId.CountLimitExceeded
The count of the parameter InstanceId exceeds the limit of %s.诊断
403
CommandLimitExceeded
The count of command in current region exceeds the limit of %s.诊断
403
InvalidParameters.ValueTypeUnsupported
The type of the value in the parameter Parameters is not supported.诊断
404
InvalidInvokeId.NotFound
The specified parameter InvokeId does not exist.诊断
404
InvalidInstanceId.NotFound
The specified parameter InstanceId does not exist.诊断
404
InvalidRegionId.NotFound
The specified parameter RegionId does not exist.诊断
500
InternalError
An error occurred when you dispatched the request.诊断

变更历史

变更时间变更内容概要操作
2024-12-05
变更错误码403
2024-04-03
变更错误码403

相关示例