You need to enable JavaScript to run this app.
导航

SetInstancesProtection - 开始或停止保护伸缩组内实例

最近更新时间2024.05.16 10:34:05

首次发布时间2022.05.13 10:42:45

将伸缩组中不希望被自动删除/移出的实例设置为保护状态,操作说明和注意事项请参见设置实例保护

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

SetInstancesProtection

要执行的操作,取值:SetInstancesProtection。

Version
String

2020-01-01

API的版本,取值:2020-01-01。

ScalingGroupId
String

scg-ybmssdnnhn5pkgyd****

伸缩组ID。您可以调用DescribeScalingGroups查询伸缩组ID。

InstanceIds.N
Array of String

i-ybmike5l70l8j1ha****

实例ID列表。您可以调用DescribeScalingInstances查询指定伸缩组中的实例ID。

  • 参数 - N:表示伸缩组的序号,取值1 ~ 20。
  • 多个实例ID之间用&分隔。
ProtectedFromScaleIn
Boolean

true

实例保护状态:

  • true:开启保护实例。
  • false(默认):停止保护实例。

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
InstanceProtectionResults
Array of InstanceProtectionResult

--

各实例设置保护实例的结果。

请求示例

GET /?Action=SetInstancesProtection&InstanceIds.1=i-ybmike5l70l8j1ha****&ScalingGroupId=scg-ybmssdnnhn5pkgyd****&Version=2020-01-01 HTTP/1.1
Host: open.volcengineapi.com
X-Date: 20240507T112722Z
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240507/cn-beijing/auto_scaling/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f


返回示例

{
  "ResponseMetadata": {
    "RequestId": "202405071927290150451670784B245B",
    "Version": "2020-01-01",
    "Service": "auto_scaling",
    "Region": "cn-beijing"
  },
  "Result": {
    "InstanceProtectionResults": [
      {
        "Code": "InvalidInstance.NotFound",
        "InstanceId": "i-ybmike5l70l8j1ha",
        "Message": "指定实例[i-ybmike5l70l8j1ha****]不存在。",
        "Result": "Success"
      }
    ]
  }
}

错误码

您可访问公共错误码,获取更多错误码信息。