向負載平衡伺服器組中添加後端伺服器。
介面說明
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不能是網關型Server Load Balancer執行個體使用的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. | 指定的Elastic Container Instance資源不存在。 |
| 404 | ResourceNotFound.ServerGroup | The specified resource of %s is not found. | 指定的伺服器組資源不存在。 |
| 404 | ResourceNotFound.Ecs | The specified resource of %s is not found. | 指定的雲端服務器資源不存在。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。