向伺服器群組中新增後端伺服器。
介面說明
AddServersToServerGroup 介面屬於非同步介面,即系統返回一個請求 ID,但該後端伺服器尚未新增成功,系統後台的新增任務仍在進行。
您可以呼叫 ListServerGroups 查詢伺服器群組的狀態:
當伺服器群組處於 Configuring 狀態時,表示伺服器群組正在變更配置中。
當伺服器群組處於 Available 狀態時,表示伺服器群組執行中。
您可以呼叫 ListServerGroupServers 查詢後端伺服器的狀態:
當後端伺服器處於 Adding 狀態時,表示後端伺服器正在加入伺服器群組。
當後端伺服器處於 Available 狀態時,表示後端伺服器執行中。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
alb:AddServersToServerGroup |
create |
*ServerGroup
Instance
NetworkInterface
ContainerGroup
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| ServerGroupId |
string |
是 |
伺服器群組 ID。 |
sgp-atstuj3rtop**** |
| Servers |
array<object> |
是 |
後端伺服器清單,單次呼叫最多支援新增 200 個伺服器。 |
|
|
object |
否 |
後端伺服器群組結構體。 |
||
| Description |
string |
否 |
後端伺服器描述。長度為 2~256 個英文或中文字元,不能以 http:// 和 https:// 開頭。 |
test |
| Port |
integer |
否 |
後端伺服器使用的連接埠。取值範圍:1~65535。單次呼叫最多支援新增 200 個伺服器。 說明
當 ServerType 取值為 Ecs、Eni、Eci、Ip 時,該參數必傳。當 ServerType 取值為 Fc 時,無需設定該參數。 |
80 |
| ServerId |
string |
否 |
後端伺服器 ID。單次呼叫最多支援新增 200 個伺服器。
|
i-uf616vu8me****** |
| ServerIp |
string |
否 |
指定 IP 地址。單次呼叫最多支援新增 200 個伺服器。 當 ServerType 為 Eni 時,支援指定 ENI 的主要私有 IP 或輔助私有 IP。 說明
當 ServerType 取值為 Fc 時,無需設定該參數。 |
192.168.1.1 |
| ServerType |
string |
是 |
後端伺服器類型。單次呼叫最多支援新增 200 個伺服器。取值:
|
Ecs |
| Weight |
integer |
否 |
後端伺服器的權重,取值範圍:0~100。預設值為 100。如果設定權重為 0,則不會將請求轉發給該後端伺服器。單次呼叫最多支援新增 200 個伺服器。 說明
當 ServerType 取值為 Fc 時,無需設定該參數。 |
100 |
| RemoteIpEnabled |
boolean |
否 |
是否啟用遠端 IP 功能。單次呼叫最多支援新增 200 個伺服器。取值:
說明
當 ServerType 取值為 Ip 時,該參數有效。 |
false |
| ClientToken |
string |
否 |
用戶端 Token,用於保證請求的冪等性。 從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。 說明
若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 識別碼。每次 API 請求的 RequestId 不一樣。 |
593B0448-D13E-4C56-AC0D-FDF0****** |
| DryRun |
boolean |
否 |
是否僅預檢此次請求,取值:
|
false |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回資料結構體。 |
||
| JobId |
string |
非同步任務 ID。 |
72dcd26b-f12d-4c27-b3af-18f6aed5**** |
| RequestId |
string |
請求 ID。 |
365F4154-92F6-4AE4-92F8-7FF34****** |
樣本
正常返回樣本
JSON格式
{
"JobId": "72dcd26b-f12d-4c27-b3af-18f6aed5****",
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34******"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | ResourceQuotaExceeded.ServerAddedNum | The quota of %s is exceeded for resource %s, usage %s/%s. | |
| 400 | IncorrectStatus.ServerGroup | The status of %s [%s] is incorrect. | |
| 400 | Conflict.BackendServer | There is already %s having the same configuration with %s. | |
| 400 | OperationDenied.VpcVportNotFound | The operation is not allowed because of %s. | |
| 400 | IncorrectStatus.Eni | The status of %s [%s] is incorrect. | |
| 400 | ResourceInUse.IP | The specified resource %s is in use. | |
| 400 | OperationDenied.NoAvailableVSwitch | The operation is not allowed because of %s. | |
| 400 | OperationDenied.VgwVipNotFound | The operation is not allowed because of %s. | |
| 400 | OperationDenied.CloudBox | The operation is not allowed because of %s. | |
| 400 | Mismatch.Type | The %s is mismatched for %s and %s. | |
| 400 | Mismatch.VpcId | The %s is mismatched for %s and %s. | |
| 400 | ResourceQuotaExceeded.LoadBalancerServersNum | The quota of %s is exceeded for resource %s, usage %s/%s. | |
| 400 | ResourceInConfiguring | The specified resource of %s is being configured. Please try again later. | |
| 400 | DuplicatedParam.BackendServer | The param of %s is duplicated. | |
| 400 | OperationDenied.EciNotSupportJobType | The operation is not allowed because of eci not support job type. | |
| 400 | IllegalParam.ServerIp | The param of ServerIp is illegal. | |
| 400 | Mismatch.ServerType | The %s is mismatched for %s and %s. | |
| 400 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | |
| 403 | Forbidden.ServerGroup | Authentication has failed for ServerGroup. | |
| 404 | ResourceNotFound.ServerGroup | The specified resource %s is not found. | |
| 404 | ResourceNotFound.Ecs | The specified resource %s is not found. | |
| 404 | ResourceNotFound.Eci | The specified resource %s is not found. | |
| 404 | ResourceNotFound.Eni | The specified resource %s is not found. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。