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

AttachServerGroups - 添加负载均衡后端服务器组

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

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

为伸缩组关联一个或多个负载均衡后端服务器组。

调试

请求参数

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

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

AttachServerGroups

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

Version
String

2020-01-01

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

ScalingGroupId
String

scg-ybmssdnnhn5pkgyd****

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

ServerGroupAttributes.N.ServerGroupId
Array of String

rsp-12b2z5fnxvhts17q7y2fj****

负载均衡后端服务器组的ID。您可以调用DescribeServerGroups接口查询后端服务器组ID。

  • 参数 - N:表示服务器组的序号,取值 1 ~ 5。
  • 参数 - ServerGroupId:服务器组ID。
  • 多个服务器组的ID之间用&分隔。
ClientToken
String

333456899ff****

保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。取值:

  • 仅支持ASCII字符,且不能超过64个字符。
ServerGroupAttributes.N.Type
Array of String

CLB

负载均衡服务器组类型:

  • 参数 - N:表示负载均衡服务器组的序号,取值 1 ~ 40。单类型的服务器组则最多可选择20个。
  • 参数 - Type:表示负载均衡服务器组的类型。
    • ALB:应用型负载均衡。
    • CLB:传统型型负载均衡。
  • 多个服务器组的ID之间用&分隔。
  • 如传入本参数但不传入取值,则默认选择CLB。
ServerGroupAttributes.N.Port
Array of Integer

80

负载均衡后端服务器组中服务器的端口号。

  • 参数 - N:表示服务器组的序号,取值 1 ~ 5。
  • 参数 - Port:端口号,取值1 ~ 65535。
  • 多个服务器组的端口号之间用&分隔。
ServerGroupAttributes.N.Weight
Array of Integer

20

负载均衡后端服务器组中服务器的权重。

  • 参数 - N:表示服务器组的序号,取值 1 ~ 5。
  • 参数 - Weight:权重,取值0 ~100。
  • 多个服务器组的权重之间用&分隔。
  • 如不填,则表示暂不绑定负载均衡。

返回参数

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

参数
类型
示例值
描述
ScalingGroupId
String

scg-ybmssdnnhn5pkgyd****

伸缩组ID。

请求示例

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


返回示例

{
  "ResponseMetadata": {
    "RequestId": "202405071743461880532151539D7BBA",
    "Version": "2020-01-01",
    "Service": "auto_scaling",
    "Region": "cn-beijing"
  },
  "Result": {
    "ScalingGroupId": "scg-ybmssdnnhn5pkgyd****"
  }
}

错误码

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