建立主備伺服器組。一個主備伺服器組只能包含兩個後端伺服器,一個為主伺服器,另一個為備伺服器。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
slb:CreateMasterSlaveServerGroup |
create |
Instance
*LoadBalancer
|
|
無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
傳統型Server Load Balancer執行個體的地區 ID。 |
cn-hangzhou |
| LoadBalancerId |
string |
是 |
傳統型Server Load Balancer執行個體 ID。 |
lb-bp1hv944r69al4j****** |
| MasterSlaveServerGroupName |
string |
否 |
主備伺服器組名稱。 |
Group1 |
| MasterSlaveBackendServers |
string |
否 |
主備伺服器組列表。一個主備伺服器組只能包含 2 個後端伺服器。 包含以下參數:
說明
只有效能保障型執行個體支援添加 eni 和 eci 類型的後端伺服器。
|
[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"82","ServerType":"Master","Description":"test-112" }, { "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"84","ServerType":"Slave","Description":"test-112" }] |
| Tag |
array<object> |
否 |
標籤列表。 |
|
|
object |
否 |
標籤列表。 |
||
| Key |
string |
否 |
資源標籤鍵。N 的取值範圍:1~20。一旦輸入該值,則不允許為空白字串。 最多支援 64 個字元,不能以 |
test |
| Value |
string |
否 |
資源的標籤值。N 的取值範圍:1~20。一旦輸入該值,可以為空白字串。
最多支援 128 個字元,不能以 |
1 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| MasterSlaveServerGroupId |
string |
主備伺服器組 ID。 |
rsp-bp19au4****** |
| RequestId |
string |
請求 ID。 |
7CA4DB76-4D32-523B-822E-5C9****** |
| MasterSlaveBackendServers |
object |
||
| MasterSlaveBackendServer |
array<object> |
主備伺服器組列表。 |
|
|
object |
主備伺服器組列表。 |
||
| Type |
string |
後端伺服器類型,取值:
|
ecs |
| Weight |
integer |
後端伺服器的權重。 |
100 |
| Description |
string |
主備伺服器組描述。 |
test-112 |
| Port |
integer |
後端伺服器使用的連接埠。 |
82 |
| ServerId |
string |
要添加的後端伺服器執行個體 ID。 |
i-bp1fq61enf4loa5i**** |
| ServerType |
string |
伺服器類型。 取值:Master 或 Slave。 |
Master |
樣本
正常返回樣本
JSON格式
{
"MasterSlaveServerGroupId": "rsp-bp19au4******",
"RequestId": "7CA4DB76-4D32-523B-822E-5C9******",
"MasterSlaveBackendServers": {
"MasterSlaveBackendServer": [
{
"Type": "ecs",
"Weight": 100,
"Description": "test-112",
"Port": 82,
"ServerId": "i-bp1fq61enf4loa5i****",
"ServerType": "Master"
}
]
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | BACKEND_SERVERS_NUM_MUST_BE_TWO | Backend servers num must be 2. | |
| 400 | Mismatched.ZoneId | The zone of the server is not matched with the cloud box loadbalancer. | |
| 400 | BACKEND_SERVERS_HAVE_SAME_PORT_AND_SERVERID | Backend servers have same port and serverId. | |
| 400 | BACKEND_SERVERS_CAN_ONLY_CONTAIN_ONE_MASTER_AND_ONE_SLAVE | Backend servers can only contain one master and one slave. | |
| 400 | BACKEND_SERVER_ID_CAN_NOT_EMPTY | Backend server id can not empty. | |
| 400 | INVALID_SERVER_TYPE | Invalid server type. | |
| 400 | BACKEND_SERVER_PORT_CAN_NOT_EMPTY | Backend server port can not empty. | |
| 400 | RealServerPortNotSupport | Real server port not support. | |
| 400 | OperationUnsupported.CreateMasterSlaveServerGroup | 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 | RsTunnelIp2VmNameConflict | %s. | |
| 400 | NetworkConflict | %s. | |
| 400 | InvalidParam.TagValue | %s. | |
| 400 | InvalidParam.TagKey | %s. | |
| 400 | SizeLimitExceeded.Tag | %s. | |
| 400 | MissingParam.TagKey | The param MissingParam.TagKey is missing. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。