CreateRouteTargetGroup
建立路由目標群組執行個體。
介面說明
-
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. | |
| 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. | |
| 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网关资源。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。