最近更新时间:2024.03.25 11:04:10
首次发布时间:2022.05.13 10:42:45
调用 SetInstancesProtection 将伸缩组中不希望被自动删除/移出的实例设置为保护状态,操作说明和注意事项请参见设置实例保护。
名字 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | SetInstancesProtection | 要执行的操作,取值:SetInstancesProtection。 |
Version | String | 是 | 2020-01-01 | API的版本,取值为:2020-01-01。 |
ScalingGroupId | String | 是 | scg-ybmssdnnhn5pkgyd**** | 伸缩组ID。您可以调用DescribeScalingGroups查询伸缩组ID。 |
InstanceIds.N | String | 是 | InstanceIds.1=i-ybmike5l70l8j1ha****& | 实例ID。您可以调用DescribeScalingInstances查询指定伸缩组中的实例ID。
|
ProtectedFromScaleIn | Boolean | 否 | true | 实例保护状态:
|
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
InstanceProtectionResults | Array of struct | - | 各实例设置保护实例的结果。具体请参见下表“ProtectionResult结构”。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
InstanceId | String | x | 实例ID。 |
Result | String | Success | 实例开启或停止保护的结果。取值:
|
Code | String | InvalidInstance.NotFound | 实例开启或停止保护失败的错误码。
|
Message | String | 指定实例[%s]不存在 | 实例开启或停止保护失败的错误信息。取值:
说明 仅当 |
GET /?Action=SetInstancesProtection&ScalingGroupId=scg-ybmssdnnhn5pkgyd****&InstanceIds.1=i-ybmike5l70l8j1ha****&ProtectedFromScaleIn=true&Version=2020-01-01 HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing Service: auto_scaling
{ "ResponseMetadata": { "RequestId": "202204201727490102250990080521****", "Action": "SetInstancesProtection", "Version": "2020-01-01", "Service": "auto_scaling", "Region": "cn-beijing" }, "Result": { "InstanceProtectionResults": [ { "InstanceId": "i-ybmssxidd2l8j1e5****", "Result": "Success", "Code": "", "Message": "" } ] } }