You can call CreateIpv6EgressOnlyRule to create egress-only rules to enable ECS instances in VPCs that have IPv6 enabled to access IPv6 clients. However, IPv6 clients cannot access the ECS instances over the Internet.
Operation description
-
CreateIpv6EgressOnlyRule is an asynchronous operation. After a request is sent, the system returns a request ID and creates the rule in the background. You can call the DescribeIpv6EgressOnlyRules operation to query the status of the task.
- If the egress-only rule is in the Creating state, the egress-only rule is being created.
- If the egress-only rule is in the Created state, the egress-only rule is created.
-
You cannot repeatedly call the CreateIpv6EgressOnlyRule operation to add egress-only rules for an IPv6 address within the specified period of time.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
vpc:CreateIpv6EgressOnlyRule | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The ID of the region in which the IPv6 gateway is deployed. You can call the DescribeRegions operation to query the region ID. | cn-huhehaote |
Ipv6GatewayId | string | Yes | The ID of the IPv6 gateway. | ipv6gw-hp3c2paq0ywauasza**** |
InstanceId | string | Yes | The ID of the IPv6 address for which you want to create an egress-only rule. | ipv6-hp3nxjkfxn5pnhgl5**** |
InstanceType | string | No | The type of the instance for which you want to create an egress-only rule. Default value: Ipv6Address | Ipv6Address |
Name | string | No | The name of the egress-only rule. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter but cannot start with | rulename |
Description | string | No | The description of the egress-only rule. The description must be 2 to 256 characters in length and cannot start with | ruledescription |
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate a token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. Note
If you do not specify this parameter, the system automatically uses the value of RequestId as the client token. The value of RequestId is different for each API request.
| 0c593ea1-3bea-11e9-b96b-88e9fe637760 |
Response parameters
Examples
Sample success responses
JSON
format
{
"Ipv6EgressRuleId": "ipv6py-hp3w98rmlbqp01245****",
"RequestId": "9DFEDBEE-E5AB-49E8-A2DC-CC114C67AF75"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidIpv6Gateway.NotFound | %s | - |
400 | IllegalParam.Name | %s | - |
400 | IllegalParam.Description | %s | - |
400 | IllegalParam.InstanceType | %s | - |
400 | OperationFailed.FinancialLocked | %s | - |
400 | OperationUnsupported.EgressRuleVSwitch | %s | - |
400 | InvalidIpv6Instance.NotFound | %s | - |
400 | OperationFailed.NoInternetBandwidth | %s | - |
400 | OperationFailed.Ipv6EgressRuleExisted | An egress-only rule already exists for the IPv6 address. | The IPv6 instance already has egress-only rules. |
400 | OperationFailed.InternetBandwidthUnstable | %s | - |
400 | IncorrectStatus.Ipv6InternetBandwidth | %s | - |
400 | OperationUnsupported.EgressRuleInDefaultSpec | %s | - |
400 | QuotaExceeded.Ipv6EgressRules | %s | - |
400 | Mismatch.Ipv6AddressAndIpv6Gateway | The %s and %s are mismatched. | Specified Ipv6Address and Ipv6Gateway are not in the same VPC |
404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. | The specified region ID does not exist. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-06-28 | The Error code has changed | View Change Details |
2023-10-10 | API Description Update. The Error code has changed | View Change Details |
2023-07-05 | The Error code has changed | View Change Details |