You need to enable JavaScript to run this app.
文档中心
负载均衡

负载均衡

复制全文
下载 pdf
服务器组
AddServerGroupBackendServers - 为指定服务器组添加后端服务器
复制全文
下载 pdf
AddServerGroupBackendServers - 为指定服务器组添加后端服务器
调用 AddServerGroupBackendServers 接口,为指定服务器组添加后端服务器。​
使用说明​
  • 每个服务器组内最多添加 200 个后端服务器。​
  • 每秒最多提交 5 个 API 请求。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:AddServerGroupBackendServers​
要执行的操作,取值:AddServerGroupBackendServers。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
Servers.N.InstanceId string[] 必选 示例值:Servers.1.InstanceId=i-3tkuehz8oa3vj0wz****&Servers.2.InstanceId=i-&2feo5qd3orri85oxruvxv****​
后端服务器。​
  • 取值如下:​
  • 当Servers.N.Type 取ecs时,传云服务器实例的ID。您可以调用DescribeInstances接口,查询云服务实例ID。​
  • 当Servers.N.Type 取eni时,传已挂载至云服务器的辅助网卡的ID。您可以调用DescribeNetworkInterfaces接口,查询网卡ID。​
  • 当Servers.N.Type 取ip时,传IP地址作为后端服务器。​
  • 参数-N:表示后端服务器的序号。取值范围为1 ~ 20。​
  • 多个后端服务器ID间使用“&”分隔。​
​
Servers.N.Description string[] 可选 示例值:Servers.1.Description=ecs1&Servers.2.Description=ecs2​
后端服务器描述。​
  • 参数- N:表示后端服务器的序号。取值范围为1 ~ 20。​
  • 必须以字母或中文开头,可包含数字、英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为1 ~ 255个字符。​
​
Servers.N.Type string[] 必选 示例值:Servers.1.Type=ecs&Servers.2.Type=ecs​
后端服务器的类型。​
  • 参数- N:表示后端服务器的序号。取值范围为1~20。​
  • 当服务组为instance类型时,取值如下:​
  • ecs:云服务器实例。​
  • eni:辅助网卡,不支持主网卡。​
  • 当服务组为ip类型时,本参数取值为ip。​
​
Servers.N.Ip string[] 必选 示例值:Servers.1.Ip=192.168.1.66&Servers.2.Ip=192.168.1.88​
云服务器或辅助网卡的私网IP地址。​
  • 参数- N:表示后端服务器的序号。取值范围为1~20。​
  • 您可以调用DescribeInstances接口,查询“ecs”类型后端服务器的私网IP地址;​
​
Servers.N.RemoteEnabled string[] 可选 示例值:Servers.1.RemoteEnabled=off&Servers.2.RemoteEnabled=off​
是否开启远端IP功能。​
  • 当后端服务器实例类型为IP地址,即 Type 取值为 ip 时,此字段有效。​
  • 取值如下:​
  • on:开启。​
  • off(默认值):不开启。​
​
Servers.N.Weight integer[] 可选 示例值:Servers.1.Weight=100&Servers.2.Weight=100​
后端服务器的权重,取值:0 ~ 100。​
  • 如果权重设置为0,表示不会将请求转发给该后端服务器。​
  • 参数- N:表示后端服务器的序号。取值范围为1 ~ 20。​
  • 不传默认为0。​
​
Servers.N.Port integer[] 必选 示例值:Servers.1.Port=88&Servers.2.Port=443​
后端服务器接收请求的端口号。​
  • 取值范围为:1-65535。​
  • 参数- N:表示后端服务器的序号。取值范围为1~20。​
​
ServerGroupId string 必选 示例值:rsp-bp1o94dp5i6ea****​
后端服务器组ID。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId string 示例值:20210811152539010225146063030****​
请求ID。​
​
ServerIds string[] 示例值:["rs-3ciynux6i1x4w****rszh49sj"]​
返回添加的后端服务器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: alb.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/alb/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20210816110638****2514606306AF947C",​
"Action": "AddServerGroupBackendServers",​
"Version": "2020-04-01",​
"Service": "alb",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "202108161106****22514606306AF947C",​
"ServerIds": [​
"rs-3ciynux6i1x4w****rszh49sj"​
]​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
Invalid%s.Malformed​
MismatchThe specified %s is malformed.​
指定的 %s 参数格式不合法。​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, '%s'.​
该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如: %s。​
400​
InvalidParameter​
Data unmarshal failed.​
请求解析失败。​
400​
LimitExceed.BackendServer​
You've reached the limit on the number of backend servers that you can operate at a time.​
已达到单次可操作的后端服务器的数量上限。​
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。​
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​
InvalidServerGroup.InvalidStatus​
The specified ServerGroup is not in the correct status for the request.​
指定的服务器组所处状态无法响应该请求。​
400​
InvalidLoadBalancer.InvalidStatus​
The related LoadBalancer is not in the correct status for the request.​
关联的 ALB 实例所处状态无法响应该请求​
400​
InvalidServers.Port.Duplicated​
The specified Servers.Port is duplicated.​
指定的服务器端口重复。​
400​
InvalidServers.RemoteEnabled.Malformed​
The specified Servers.RemoteEnabled is malformed.​
指定的 Servers.RemoteEnabled 参数格式不合法。​
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​
InvalidIp.InstanceIdMismatch​
The specified Server.Ip and Server.InstanceId do not match.​
指定的 IP 地址与实例 ID 不匹配。​
400​
OperationDenied.AccountArrears​
The request on the specified resource is denied due to the account being in arrears status.​
因账号处于欠费状态,对于该资源的操作请求被拒绝。​
400​
InvalidIndexOrder.Malformed​
The specified index order is malformed.​
指定的索引顺序参数格式不合法。​
400​
InvalidServers.Type.Malformed​
The specified Servers.Type is malformed.​
指定的 Servers.Type 参数格式不合法。​
400​
InvalidServers.Weight.Malformed​
The specified Servers.Weight is malformed.​
指定的 Servers.Weight 参数格式不合法。​
400​
InvalidServers.Port.Malformed​
The specified Servers.Port is malformed.​
指定的 Servers.Port 参数格式不合法。​
400​
InvalidServers.Ip.Malformed​
The specified Servers.Ip is malformed.​
指定的 Servers.Ip 参数格式不合法。​
400​
InvalidServers.Description.Malformed​
The specified Servers.Description is malformed.​
指定的 Servers.Description 参数格式不合法。​
400​
MissingParameter​
The 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​
InvalidVpcForServerGroup.ServerMismatch​
The specified Vpc of ServerGroup and Server do not match.​
指定的服务器组和后端服务器的 VPC 不匹配。​
400​
InvalidEni.Server.IpMismatch​
The specified Eni and Server.Ip do not match.​
指定的 IP 地址和对应的弹性网卡 IP 地址不匹配。​
400​
OperationDenied.EniTypeNotSupport​
The request on the specified Eni is denied due to the eni type is not allowed for this action.​
因弹性网卡不支持此操作,对于该 Eni 的操作请求被拒绝。​
400​
OperationFailed.QueryArkClaw​
The request on the specified resource failed due to the query on ArkClaw failed.​
因请求 ArkClaw 失败,对于该资源的操作请求失败。​
400​
OperationFailed.QueryEcs​
The request on the specified resource failed due to the query on ECS failed.​
因请求 ECS 失败,对于该资源的操作请求失败。​
400​
InvalidServers.InstanceId.Malformed​
The specified Servers.InstanceId is malformed.​
指定的 Servers.InstanceId 参数格式不合法。​
400​
OperationDenied.DomainServerGroupOnlyOneServer​
The request on the specified ServerGroup is denied due to domain type server group only supports one backend server.​
因域名类型服务器组仅支持添加一个后端服务器,对于该服务器组的操作请求被拒绝。​
400​
OperationDenied.DomainServerNotSupportIp​
The request on the specified Server is denied due to domain type backend server does not support Ip parameter.​
因域名类型后端服务器不支持传入 Ip 参数,对于该后端服务器的操作请求被拒绝。​
400​
OperationDenied.DomainServerNotSupportRemoteEnabled​
The request on the specified Server is denied due to domain type backend server does not support RemoteEnabled parameter.​
因域名类型后端服务器不支持传入 RemoteEnabled 参数,对于该后端服务器的操作请求被拒绝。​
404​
InvalidServer.NotFound​
The specified Server does not exist.​
指定的服务器不存在。​
404​
InvalidServerGroup.NotFound​
The specified ServerGroup does not exist.​
指定的服务器组不存在。​
404​
InvalidClaw.NotFound​
The specified Claw does not exist.​
指定的 Claw 不存在。​
409​
InvalidServers.Port.Conflict​
The specified Servers.Port already exists.​
指定的服务器端口已存在。​
500​
InternalError​
An internal error has occurred.​
发生内部错误。请稍后重试或联系工程师进一步咨询。​
​
​
最近更新时间:2026.07.10 15:34:56
这个页面对您有帮助吗?
有用
有用
无用
无用