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

AddServerGroupBackendServers

最近更新时间2024.02.29 14:48:19

首次发布时间2022.05.20 22:33:51

API说明

API 名称:AddServerGroupBackendServers。
API 域名:open.volcengineapi.com 。
API 描述:为指定服务器组添加后端服务器,每个服务器组内最多添加 200 个后端服务器。

使用限制

节流限制:每秒最多提交 5 个 API 请求。

快速调试

URI 参数

在使用该部分 API 提交请求时必须包含以下 URI 参数。

除了 URI 参数,该 API 请求还需要包含签名参数。关于更多签名参数的信息,参见公共请求参数

名称类型是否必选格式说明
Action
string
[a-zA-Z]+
API 名称,如 AddServerGroupBackendServers。
VersionstringYYYY-MM-DDAPI 版本信息。该参数的取值是 2020-04-01 。
X-Expiresint900表示签名的有效时间,单位是秒,默认值是900。

请求正文

在使用该 API 提交请求时,请求正文中可以包含的参数如下。

参数类型是否必选参数说明示例值
ServerGroupId
String
后端服务器组ID。
rsp-bp1o94dp5i6ea****
ServersArray修改服务器的相关信息。具体参见下表 Servers-

Servers

参数类型是否必选示例值参数说明
Servers.N.InstanceId
List of Struct

云服务器实例ID或已绑定云服务器实例的网卡ID。

  • - N:表示后端服务器的序号。取值范围为1 ~ 20。

  • 多个后端服务器ID间使用“&”分隔。

  • 当服务器组为 instance 类型时,本字段为 ecs、eni 的资源 ID。

  • 当服务器组为 ip 类型时,本字段为 IP 地址。

Servers.1.InstanceId=i-3tkuehz8oa3vj0wz****&Servers.2.InstanceId=i-&2feo5qd3orri85oxruvxv****
Servers.N.Type
List of Struct

后端服务器的类型,- N:表示后端服务器的序号。取值范围为1 ~ 20。支持参数:

  • ecs:云服务器实例。

  • eni:辅助网卡,不支持主网卡。

  • ip:IP地址(仅 ip 类型服务器组有效)。

Servers.1.Type=ecs&Servers.2.Type=ecs

Servers.N.RemoteEnabled

String

是否开启远端IP功能。当后端服务器实例类型为IP地址,即 Type 取值为 ip 时,此字段有效。取值:

  • on:开启。

  • off(默认值):不开启。

off

Servers.N.Weight
List of Struct

后端服务器的权重,取值:0 ~ 100。

  • 如果权重设置为0,表示不会将请求转发给该后端服务器。
  • - N:表示后端服务器的序号。取值范围为1 ~ 20。
  • 不传入该参数或该参数不传入数值时,默认为0。
Servers.1.Weight=100&Servers.2.Weight=100
Servers.N.Ip
List of Struct

后端服务器的私网IP地址。
- N:表示后端服务器的序号。取值范围为1~20。

Servers.1.Ip=192.XX.XX.2&Servers.2.Ip=192.XX.XX.3
Servers.N.Port
List of Struct
后端服务器接收请求的端口号,取值:1-65535。 - N:表示后端服务器的序号。取值范围为1~20。
Servers.1.Port=88&Servers.2.Port=443
Servers.N.Description
List of Struct

后端服务器描述。

  • - N:表示后端服务器的序号。取值范围为1 ~ 20。
  • 必须以字母或中文开头,可包含数字、英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
  • 长度限制为1 ~ 255个字符。
Servers.1.Description=ecs1&Servers.2.Description=ecs2

响应正文

参数类型参数说明示例值
RequestId
String
请求ID。
20210811152539010225146063030****
ServerIdsArray返回添加的后端服务器ID。-

示例

请求示例

GET /?Action=AddServerGroupBackendServers&ServerGroupId=rsp-2ff2u22****ww5oxruwe33hdz&Servers.1.InstanceId=i-3tli51****3vj0wuvaeh&Servers.1.Ip=172.**.**.242&Servers.1.Port=1&Servers.1.Type=ecs&Servers.1.Weight=100&Version=2020-04-01 HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
ServiceName: alb

响应示例

{
    "ResponseMetadata": {
        "RequestId": "20210816110638****2514606306AF947C",
        "Action": "AddServerGroupBackendServers",
        "Version": "2020-04-01",
        "Service": "alb",
        "Region": "cn-beijing"
    },
    "Result": {
        "RequestId": "202108161106****22514606306AF947C",
        "ServerIds": [
            "rs-3ciynux6i1x4w****rszh49sj"
        ]
    }
}

错误码

如果响应正文包含 Error 字段,则表示 API 请求失败。此处仅展示当前 API 的错误码,更多错误码请参见公共错误码

HTTP Code

错误码

错误信息

错误描述

400

OperationDenied.AccountArrears

The request on the specified resource is denied due to the account being in arrears status.

因账号处于欠费状态,对于该资源的操作请求被拒绝。

400

LimitExceed.BackendServer

You've reached the limit on the number of backend servers that you can operate at a time.

已达到单次可操作的后端服务器的数量上限。

400

MissingParameter

The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, 'Servers'.

该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如: Servers。

400InvalidIndexOrder.MalformedThe specified index order is malformed.指定的索引顺序参数格式不合法。
400InvalidServers.Type.MalformedThe specified Servers.Type is malformed.指定的 Servers.Type 参数格式不合法。

400

InvalidServers.Weight.Malformed

The specified Servers.Weight is malformed.

指定的 Servers.Weight 参数格式不合法。

400InvalidServers.Port.MalformedThe specified Servers.Port is malformed.指定的 Servers.Port 参数格式不合法。
400InvalidServers.Ip.MalformedThe specified Servers.Ip is malformed.指定的 Servers.Ip 参数格式不合法。
400InvalidServers.Description.MalformedThe specified Servers.Description is malformed.指定的 Servers.Description 参数格式不合法。
400MissingParameterThe request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, 'Servers.InstanceId'.该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如: Servers.InstanceId。

400

InvalidEni.InvalidStatus

The specified Eni is not in the correct status for the request.

指定的弹性网卡所处状态无法响应该请求。

400

InvalidEcs.Server.IpMismatch

The specified Ecs and Server.Ip do not match.

指定的 IP 地址和对应的 ECS 实例主网卡 IP 地址不匹配。

400

InvalidEni.Server.IpMismatch

The specified Eni and Server.Ip do not match.

指定的 IP 地址和对应的弹性网卡 IP 地址不匹配。

400

InvalidIp.InstanceIdMismatch

The specified Server.Ip and Server.InstanceId do not match.

指定的 IP 地址与实例 ID 不匹配。

400InvalidVpcForServerGroup.ServerMismatchThe specified Vpc of ServerGroup and Server do not match.指定的服务器组和后端服务器的 VPC 不匹配。
400InvalidServers.RemoteEnabled.MalformedThe specified Servers.RemoteEnabled is malformed.指定的 Servers.RemoteEnabled 参数格式不合法。
400InvalidServers.Port.DuplicatedThe specified Servers.Port is duplicated.指定的服务器端口重复。
400InvalidLoadBalancer.InvalidStatusThe related LoadBalancer is not in the correct status for the request.关联的 ALB 实例所处状态无法响应该请求
400InvalidServerGroup.InvalidStatusThe specified ServerGroup is not in the correct status for the request.指定的服务器组所处状态无法响应该请求。

400

QuotaExceed.ServerPerGroup

You've reached the limit on the number of backend servers per server group you can add in, resource xxx, usage xx/xx.

已达到每个服务器组可添加的后端服务器的数量上限。资源是xxx,目前已使用xxx,配额为xxx。

400

QuotaExceed.ServerPerInstance

You've reached the limit on the number of backend servers per ALB you can associate with, resource xxx, usage xx/xx.

已达到每个实例可关联的后端服务器的数量上限。资源是xxx,目前已使用xxx,配额为xxx。

404InvalidServerGroup.NotFoundThe specified ServerGroup does not exist.指定的服务器组不存在。

404

InvalidServer.NotFound

The specified Server does not exist.

指定的服务器不存在。

409InvalidServers.Port.ConflictThe specified Servers.Port already exists.指定的服务器端口已存在。