添加後端伺服器。
介面說明
如果一次請求中添加多個相同的 ECS 執行個體,只會取第一個,其他相同執行個體會被忽略。新增後端伺服器不能與同監聽下已有伺服器重複,否則會報錯。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
slb:AddBackendServers |
update |
*LoadBalancer
*Instance
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
否 |
Server Load Balancer執行個體所屬地區的 ID。 您可以通過調用 DescribeRegions 擷取地區 ID。 |
cn-beijing |
| LoadBalancerId |
string |
是 |
Server Load Balancer執行個體 ID。 |
lb-2ze7o5h52g02kkzz****** |
| BackendServers |
string |
否 |
要添加的後端伺服器列表,包含以下參數:
如果值為 0,則不會將請求轉寄給該後端伺服器。
說明
只有效能保障型執行個體支援添加 eni 和 eci 類型的後端伺服器。
樣本說明如下:
說明
必須是狀態為運行中的後端伺服器才可以加入Server Load Balancer執行個體,每次調用最多可添加 20 個後端伺服器。 |
[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port":"80","Description":"test-112" },{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "172.166.**.**", "Port":"80","Description":"test-113" }] |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| LoadBalancerId |
string |
Server Load Balancer執行個體 ID。 |
lb-2ze7o5h52g02kkzz**** |
| RequestId |
string |
請求 ID。 |
34B82C81-F13B-4EEB-99F6-A048C67CC830 |
| BackendServers |
object |
||
| BackendServer |
array<object> |
後端伺服器列表。 |
|
|
object |
|||
| Type |
string |
後端伺服器類型。取值:
|
ecs |
| Weight |
string |
後端伺服器的權重。 取值:0~100。預設值:100。 如果值為 0,則不會將請求轉寄給該後端伺服器。 |
100 |
| Description |
string |
後端伺服器描述。 |
後端伺服器 |
| ServerId |
string |
ECS、ENI、或者 ECI 執行個體 ID。 |
i-2zej4lxhjoq1icu***** |
樣本
正常返回樣本
JSON格式
{
"LoadBalancerId": "lb-2ze7o5h52g02kkzz****",
"RequestId": "34B82C81-F13B-4EEB-99F6-A048C67CC830",
"BackendServers": {
"BackendServer": [
{
"Type": "ecs",
"Weight": "100",
"Description": "後端伺服器",
"ServerId": "i-2zej4lxhjoq1icu*****"
}
]
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidParameter | The specified load balancer does not support the network type of the ECS instance. | |
| 400 | Mismatched.ZoneId | The zone of the server is not matched with the cloud box loadbalancer. | |
| 400 | BackendServerProcessing | Backend Server is adding, please try again later. | |
| 400 | InvalidBackendServers.ServerIpConflict | %s. | |
| 400 | OperationUnsupported.AddBackendServers | This type of backend server is not allowed to attached to singleTunnel or anyTunnel lb. | |
| 400 | IncorrectStatus.RSByPassToas | %s. | |
| 400 | OperationFailed.ActionNotSupport | The loadbalancer does not support such action. | |
| 400 | NetworkConflict | %s. | |
| 400 | SystemBusy | The system is busy. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。