建立路由目標群組執行個體。
介面說明
-
CreateRouteTargetGroup 介面屬於非同步介面,即系統會傳回一個執行個體 ID,但該路由目標群組執行個體尚未建立完成,系統背景的建立任務仍在進行。您可以呼叫 ListRouteTargetGroup 查詢路由目標群組的建立狀態:
當路由目標群組處於 Pending 狀態時,表示路由目標群組建立中。
當路由目標群組處於 Available、Unavailable、Switched、Abnormal 狀態時,表示路由目標群組建立完成。
-
主備模式:建立路由目標群組時,需配置位於不同可用區、類型一致的主備執行個體。
-
主執行個體:權重為 100。正常情況下承載所有流量,在健康檢查正常時生效。
-
備執行個體:權重為 0。主執行個體故障後接管流量,作為容災備份。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
vpc:CreateRouteTargetGroup |
create |
*RouteTargetGroup
|
無 | 無 |
請求文法
POST HTTP/1.1
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| VpcId |
string |
是 |
路由目標群組所屬的 VPC 的 ID。 |
vpc-xxxx |
| RouteTargetGroupName |
string |
否 |
路由目標群組的名稱。 名稱長度為 1~128 個字元,不能以 http:// 或 https:// 開頭。 |
myRouteTargetGroupName |
| RouteTargetGroupDescription |
string |
否 |
路由目標群組的描述資訊。 描述長度為 1~256 個字元,不能以 http:// 或 https:// 開頭。 |
myRouteTargetGroupDescription |
| RouteTargetMemberList |
array<object> |
是 |
路由目標群組的成員清單。 主備模式下,對路由目標群組成員有如下限制:
|
|
|
object |
是 |
|||
| MemberId |
string |
是 |
路由目標群組成員執行個體 ID。 |
ep-xxxx |
| MemberType |
string |
是 |
路由目標群組的成員類型。 目前支援的類型:
主備模式下,路由目標群組所有成員的類型必須相同。 |
GatewayLoadBalancerEndpoint |
| Weight |
integer |
是 |
路由目標群組成員的權重值。取值:
權重值僅支援在建立時設定,不支援修改。 |
100 |
| ConfigMode |
string |
是 |
路由目標群組的設定模式,支援模式如下:
|
Active-Standby |
| RegionId |
string |
是 |
路由目標群組所屬的地域 ID。您可以透過呼叫 DescribeRegions 介面取得地域 ID。 |
cn-hangzhou |
| ResourceGroupId |
string |
否 |
資源群組 ID。 關於資源群組的更多資訊,請參閱什麼是資源群組。 |
rg-acfmxazffggds**** |
| ClientToken |
string |
否 |
用戶端 Token,用於保證請求的冪等性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 僅支援 ASCII 字元。說明 若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 識別碼。每次 API 請求的 RequestId 不一樣。 |
0c593ea1-3bea-11e9-b96b-88e9fe6**** |
| Tag |
array<object> |
否 |
資源的標籤。 |
|
|
object |
否 |
資源的標籤。 |
||
| Key |
string |
否 |
資源的標籤鍵。最多支援輸入 20 個標籤鍵。如需傳入該值,則不能輸入空字串。 一個標籤鍵最多支援 128 個字元,不能以 |
FinanceDept |
| Value |
string |
否 |
資源的標籤值。最多支援輸入 20 個標籤值。如需傳入該值,可以輸入空字串。 最多支援 128 個字元,不能以 |
FinanceJoshua |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| RequestId |
string |
Id of the request |
8AA5CE21-2E6A-4530-BDF5-F055849476E6 |
| RouteTargetGroupId |
string |
路由目標群組的執行個體 ID。 |
rtg-xxxx |
樣本
正常返回樣本
JSON格式
{
"RequestId": "8AA5CE21-2E6A-4530-BDF5-F055849476E6",
"RouteTargetGroupId": "rtg-xxxx"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | UnsupportedFeature.RouteTargetGroup | The feature of RouteTargetGroup is not supported. | 當前地域不支援路由目標群組功能。 |
| 400 | Mismatch.GroupVpcIdAndInstanceVpcId | The RouteTargetGroup VPC %s and the RouteTargetConfig VPC %s are mismatched. | 路由目標群組所屬的 VPC 和路由目標設定執行個體所屬的 VPC 不一致。 |
| 400 | OperationDenied.MemberWithSameAz | The operation is not allowed because of all members being in the same availability zone. | 路由目標群組成員執行個體禁止屬於同一個可用區。 |
| 400 | InvalidVpcId.NotFound | Specified value of VpcId is not found in our record. | |
| 400 | ResourceNotFound.GatewayLoadBalancerEndpoint | GatewayLoadBalancerEndpoint instance %s not found. | |
| 400 | QuotaExceeded.RouteTargetGroup | The quota of %s is exceeded, usage %s/%s. | 已超出 VPC 內支援建立的路由目標群組最大數量,請提升配額後再操作。 |
| 400 | OperationDenied.NatGatewayNotSingleAZ | NAT gateway must be in SingleAZ mode. | 路由目標群組僅支援單 AZ 類型的 NAT 閘道器。 |
| 400 | OperationDenied.NatGatewayIcmpReplyDisabled | NAT gateway ICMP reply is disabled. | 路由目標群組中的 NAT 閘道器必須開啟 ICMP 代回功能,確保 ICMP 偵測封包可被正常回應。 |
| 400 | UnsupportedFeature.RouteTargetGroupForNat | This region currently does not support NAT gateways as route target group members. | 該地域暫不支援將 NAT 閘道器作為路由目標群組成員。 |
| 400 | ResourceNotFound.NatGatewayVSwitch | The VSwitch information associated with the selected NAT gateway was not found. | 未找到所選 NAT 閘道器關聯的 VSwitch 資訊。 |
| 400 | ResourceNotFound.NatGateway | The selected NAT gateway was not found when creating or modifying the route target group. | 建立或修改路由目標群組時,未發現所選的 NAT 閘道器資源。 |
| 400 | IncorrectStatus.NatGateway | %The status of %s [%s] is incorrect. | 指定的 NatGateway 未處於穩態。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。