您可以透過建立僅主動出規則,使開通了 IPv6 網段的 VPC 中的 ECS 可以主動存取用戶端的 IPv6 終端,但不允許用戶端的 IPv6 終端透過網際網路存取 VPC 網路中的 ECS 執行個體,呼叫 CreateIpv6EgressOnlyRule 為 IPv6 位址新增僅主動出規則。
介面說明
- CreateIpv6EgressOnlyRule 介面屬於非同步介面,即系統返回一個執行個體 ID,但該 IPv6 位址的僅主動出規則尚未建立成功,系統後台的建立任務仍在進行。您可以呼叫 DescribeIpv6EgressOnlyRules 查詢 IPv6 位址的僅主動出規則的建立狀態:
當 IPv6 位址的僅主動出規則處於 Creating 狀態時,表示 IPv6 位址僅主動出規則正在建立中。
當 IPv6 位址的僅主動出規則處於 Created 狀態時,表示 IPv6 位址僅主動出規則建立完成。
CreateIpv6EgressOnlyRule 介面不支援為同一個 IPv6 位址並行新增僅主動出規則。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
vpc:CreateIpv6EgressOnlyRule |
create |
*Ipv6EgressRule
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
IPv6 閘道器的地域 ID。 您可以透過呼叫 DescribeRegions 介面取得地域 ID。 |
cn-huhehaote |
| Ipv6GatewayId |
string |
是 |
IPv6 閘道器執行個體 ID。 |
ipv6gw-hp3c2paq0ywauasza**** |
| InstanceId |
string |
是 |
需要設定僅主動出規則的 IPv6 位址 ID。 |
ipv6-hp3nxjkfxn5pnhgl5**** |
| InstanceType |
string |
否 |
需要設定僅主動出規則的執行個體類型。 僅取值:Ipv6Address(預設值),表示為 IPv6 位址類型。 |
Ipv6Address |
| Name |
string |
否 |
僅主動出規則的名稱。 長度為 0-128 個字元,不能以 |
rulename |
| Description |
string |
否 |
僅主動出規則的描述。 長度為 0-256 個字元,不能以 |
ruledescription |
| ClientToken |
string |
否 |
用戶端 Token,用於保證請求的冪等性。 由用戶端產生該參數值,要保證在不同請求間唯一,最大值不超過 64 個 ASCII 字元。 說明
若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 標識。每次 API 請求的 RequestId 不一樣。 |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
| RegionId |
string |
是 |
參數預檢,不實際執行。 |
cn-huhehaote |
| DryRun |
boolean |
否 |
參數預檢,不實際運行 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| Ipv6EgressRuleId |
string |
僅主動出規則的 ID。 |
ipv6py-hp3w98rmlbqp01245**** |
| RequestId |
string |
請求 ID。 |
9DFEDBEE-E5AB-49E8-A2DC-CC114C67AF75 |
樣本
正常返回樣本
JSON格式
{
"Ipv6EgressRuleId": "ipv6py-hp3w98rmlbqp01245****",
"RequestId": "9DFEDBEE-E5AB-49E8-A2DC-CC114C67AF75"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidIpv6Gateway.NotFound | The specified IPv6 gateway was not found. | 指定的 IPv6 閘道未找到。 |
| 400 | IllegalParam.Name | The param of Name [%s] is illegal. | 參數 Name 不合法,請根據請求參數規定重新輸入。 |
| 400 | IllegalParam.Description | The parameter of Description is illegal. | 參數Description非法。 |
| 400 | IllegalParam.InstanceType | The parameter of InstanceType is illegal. | 參數InstanceType非法。 |
| 400 | OperationFailed.FinancialLocked | The operation is forbidden because of financialLocked. | 操作失敗,已欠費。 |
| 400 | OperationUnsupported.EgressRuleVSwitch | The specified VSwitch is not supported to create egress-only rule. | 指定地域尚未支援交換粒度的僅主動出規則。 |
| 400 | InvalidIpv6Instance.NotFound | The specified resource of InvalidIpv6Instance is not found. | 指定的 IPv6 執行個體未找到。 |
| 400 | OperationFailed.NoInternetBandwidth | Operation failed because the ipv6 instance has no internet bandwidth. | 該操作不受支援,因為 IPv6 執行個體沒有公網頻寬。 |
| 400 | OperationFailed.Ipv6EgressRuleExisted | An egress-only rule already exists for the IPv6 address. | 該 IPv6 執行個體已存在僅主動出規則。 |
| 400 | OperationFailed.InternetBandwidthUnstable | The operation is forbidden because of InternetBandwidthUnstable. | 由於頻寬執行個體處於非穩態,該操作被禁止。 |
| 400 | IncorrectStatus.Ipv6InternetBandwidth | The status of the IPv6InternetBandwidth is incorrect. | IPv6 公網頻寬當前狀態不支援建立 IPv6 僅出規則。 |
| 400 | OperationUnsupported.EgressRuleInDefaultSpec | Egress-only rule is not supported. Please update the spec of IPv6 Gateway to Medium or Large. | 免費版 IPv6 閘道不支援建立僅主動出規則,請將 IPv6 閘道升級為企業版或企業增強版。 |
| 400 | QuotaExceeded.Ipv6EgressRules | %s quota exceeded. | Ipv6EgressRules 數量配額超限。 |
| 400 | Mismatch.Ipv6AddressAndIpv6Gateway | The %s and %s are mismatched. | 指定的 Ipv6Address 和 Ipv6Gateway 不在同一 VPC 內。 |
| 400 | OperationUnsupported.EgressOnlyRuleOnFreeIpv6Instance | Creating ipv6 egress only rule on ipv6 instance that not associated with any resource is unsupported. | 不支援在未繫結資源的 IPv6 執行個體上建立僅主動出規則。 |
| 400 | MissingParam.InstanceId | The parameter InstanceId is mandatory. | InstanceId 不可以為空。 |
| 400 | OperationUnsupported.ULA | %s is unsupported. | 當前操作不支援 ULA 位址。 |
| 400 | OperationUnsupported.PrivateGUA | This operation does not support private GUA addresses. | 當前操作不支援私網 GUA 位址。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。