调用SetBackendServers接口设置传统型负载均衡的后端服务器权重。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
RegionId | String | 否 | cn-hangzhou |
传统型负载均衡实例的地域ID。 |
Action | String | 是 | SetBackendServers |
系统规定参数。取值:SetBackendServers。 |
LoadBalancerId | String | 是 | lb-bp1qjwo61pqz3a****** |
传统型负载均衡实例ID。 |
BackendServers | String | 否 | [{ "ServerId": "ecs-******FmYAXG", "Weight": "100", "Type": "ecs", "Port":"80","Description":"test-112" }] |
要修改的后端服务器列表。 取值:是一个Json string,其结构是一个JsonList。一次请求中,列表最多支持20个元素。
示例说明如下:
说明
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
LoadBalancerId | String | lb-bp1qjwo61pqz3a****** |
传统型负载均衡实例ID。 |
RequestId | String | 365F4154-92F6-4AE4-92F8-7FF34B540710 |
请求ID。 |
BackendServers | Array of BackendServer |
后端服务器列表。 |
|
BackendServer | |||
Type | String | eni |
后端服务器类型,取值:
|
Weight | String | 100 |
后端服务器的权重。 |
Description | String | 后端服务器 |
后端服务器描述。 |
ServerId | String | eni-hhshhs**** |
后端服务器ID。 |
示例
请求示例
http(s)://[Endpoint]/?RegionId=cn-hangzhou
&Action=SetBackendServers
&LoadBalancerId=lb-bp1qjwo61pqz3a******
&BackendServers=[{ "ServerId": "ecs-******FmYAXG", "Weight": "100", "Type": "ecs", "Port":"80","Description":"test-112" }]
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<SetBackendServersResponse>
<LoadBalancerId>lb-bp1qjwo61pqz3a******</LoadBalancerId>
<RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
<BackendServers>
<Type>eni</Type>
<Weight>100</Weight>
<Description>后端服务器</Description>
<ServerId>eni-hhshhs****</ServerId>
</BackendServers>
</SetBackendServersResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"LoadBalancerId" : "lb-bp1qjwo61pqz3a******",
"RequestId" : "365F4154-92F6-4AE4-92F8-7FF34B540710",
"BackendServers" : [ {
"Type" : "eni",
"Weight" : "100",
"Description" : "后端服务器",
"ServerId" : "eni-hhshhs****"
} ]
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | Mismatched.ZoneId | The zone of the server is not matched with the cloud box loadbalancer. | 当前服务器的可用区与云盒实例可用区不匹配。 |
访问错误中心查看更多错误码。