调用SetBackendServers设置后端服务器权重。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ens:SetBackendServers |
update |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| LoadBalancerId |
string |
是 |
负载均衡实例的 ID。 |
lb-5s7crik3yo3bp03gqrbp5**** |
| BackendServers |
array<object> |
是 |
添加的后端服务器列表,每次调用最多可修改 20 个后端服务器。 |
|
|
object |
否 |
后端服务器列表。 |
||
| ServerId |
string |
是 |
后端服务器的实例 ID。 |
i-5ze0o05xccvbljtn**** |
| Weight |
integer |
是 |
后端服务器的权重。默认值:100,取值:0~100。 说明
取值为 0,表示不会将请求转发给该后端服务器。 |
20 |
| Type |
string |
否 |
后端服务器类型。取值:
枚举值:
|
ens |
| Ip |
string |
否 |
IP 地址。 |
192.168.0.10 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| BackendServers |
object |
||
| BackendServer |
array<object> |
后端服务器列表。 |
|
|
object |
后端服务器列表。 |
||
| ServerId |
string |
后端服务器的实例 ID。 |
i-5uf6hj58zvml4ali8**** |
| Weight |
integer |
后端服务器的权重。默认值:100,取值:0~100。 说明
取值为 0,表示不会将请求转发给该后端服务器。 |
100 |
| Type |
string |
后端服务器类型。取值:
|
ens |
| Ip |
string |
后端服务器 IP 地址。 |
192.168.0.1 |
| Port |
integer |
负载均衡实例后端使用的端口。 |
0 |
示例
正常返回示例
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"BackendServers": {
"BackendServer": [
{
"ServerId": "i-5uf6hj58zvml4ali8****",
"Weight": 100,
"Type": "ens",
"Ip": "192.168.0.1",
"Port": 0
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | ens.interface.error | An error occurred while call the API. | |
| 400 | LoadBalancerNotFound | The input parameter loadBalancerId that is not found. | |
| 400 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | 当前操作不被支持,磁盘正在重置中。 |
| 400 | BackendServerNotFound | The input parameter serverId that is not found. | |
| 400 | Invalid%s | The specified parameter %s is invalid. | |
| 400 | Missing%s | You must specify the parameter %s. | |
| 400 | InstanceNotFound | The input parameter instanceId that is not found. | |
| 400 | NoPermission | Permission denied. | |
| 400 | InvalidParameter.%s | The specified field %s invalid. Please check it again. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。