向负载均衡服务器组中添加后端服务器。
接口说明
AddServersToServerGroup 接口属于异步接口,即系统返回一个请求 ID,但该后端服务器尚未添加成功,系统后台的添加任务仍在进行。
您可以调用 ListServerGroups 查询服务器组的状态:
当服务器组处于 Configuring 状态时,表示服务器组正在变配中。
当服务器组处于 Available 状态时,表示服务器组运行中。
您可以调用 ListServerGroupServers 查询后端服务器的状态:
当后端服务器处于 Adding 状态时,表示后端服务器正在加入服务器组。
当后端服务器处于 Available 状态时,表示后端服务器运行中。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
gwlb:AddServersToServerGroup |
create |
*ServerGroup
Instance
NetworkInterface
ContainerGroup
|
无 | 无 |
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
ServerGroupId |
string |
是 |
服务器组 ID。 |
sgp-atstuj3rtoptyui**** |
Servers |
array<object> |
是 |
后端服务器列表。 说明
单次调用最多支持传入 200 个服务器。 |
|
object |
否 |
后端服务器。 |
||
Port |
integer |
否 |
后端服务器使用的端口,取值:
|
6081 |
ServerId |
string |
是 |
后端服务器 ID。
|
i-bp67acfmxazb4p**** |
ServerIp |
string |
否 |
后端服务器 IP 地址。 |
192.168.XX.XX |
ServerType |
string |
是 |
后端服务器类型,取值:
|
Ecs |
DryRun |
boolean |
否 |
是否只预检此次请求,取值:
|
false |
ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。 |
123e4567-e89b-12d3-a456-42665544**** |
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
返回数据结构体。 |
||
RequestId |
string |
请求 ID。 |
54B48E3D-DF70-471B-AA93-08E683A1B45 |
示例
正常返回示例
JSON
格式
{
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45"
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 | Conflict.Server | The %s [%s] is conflict. | %s冲突,已经存在同配置的%s。 |
400 | Mismatch.ServerType | The %s is mismatched for %s and %s. | ServerType不匹配。 |
400 | ResourceInUse.IP | The specified resource of %s is in use. | 指定的IP地址已被使用 |
400 | IllegalParam.ServerIp | The param of %s is illegal. | 参数ServerIp非法,请检查输入参数。 |
400 | IllegalParam.EcsNetworkType | The param of %s is illegal. | |
400 | DuplicatedParam.Server | The param of %s is duplicated. | 参数中存在重复的server。 |
400 | ResourceInUse.Eni | The specified resource of %s is in use. | 传入的eni不能是网关型负载均衡实例使用的eni,请检查参数。 |
400 | IncorrectStatus.Eni | The status of %s [%s] is incorrect. | 资源%s当前状态%s不支持操作 |
400 | IllegalParam.IP | The param of %s is illegal. | 参数IP非法。请检查参数IP的输入值。 |
400 | Mismatch.IP | The %s is mismatched for %s and %s. | 输入的IP类型服务器的ID和IP不匹配。 |
400 | Mismatch.VpcId | The %s is mismatched for %s and %s. | 两个资源的VPC ID不匹配 |
400 | QuotaExceeded.ServerGroupServersNum | The quota of %s is exceeded for resource %s, usage %s/%s. | 配额gwlb_quota_servergroup_servers_num已超额度限制。 |
400 | QuotaExceeded.ServerGroupAzServersNum | The quota of %s is exceeded for resource %s, usage %s/%s. | 配额gwlb_quota_servergroup_az_servers_num已超额度限制。 |
400 | IncorrectStatus.ServerGroup | The status of %s [%s] is incorrect. | 资源%s当前状态%s不支持操作 |
404 | ResourceNotFound.Eni | The specified resource of %s is not found. | 指定的弹性网卡资源不存在。 |
404 | ResourceNotFound.Eci | The specified resource of %s is not found. | 指定的弹性容器实例资源不存在。 |
404 | ResourceNotFound.ServerGroup | The specified resource of %s is not found. | 指定的服务器组资源不存在。 |
404 | ResourceNotFound.Ecs | The specified resource of %s is not found. | 指定的云服务器资源不存在。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。