All Products
Search
Document Center

Virtual Private Cloud:CreateIpv6EgressOnlyRule

Last Updated:Aug 29, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:CreateIpv6EgressOnlyRulecreate
  • Ipv6EgressRule
    acs:vpc:{#regionId}:{#accountId}:ipv6gateway/{#Ipv6GatewayId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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
Ipv6GatewayIdstringYes

The ID of the IPv6 gateway.

ipv6gw-hp3c2paq0ywauasza****
InstanceIdstringYes

The ID of the IPv6 address for which you want to create an egress-only rule.

ipv6-hp3nxjkfxn5pnhgl5****
InstanceTypestringNo

The type of the instance for which you want to create an egress-only rule.

Default value: Ipv6Address

Ipv6Address
NamestringNo

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 http:// or https://.

rulename
DescriptionstringNo

The description of the egress-only rule.

The description must be 2 to 256 characters in length and cannot start with http:// or https://.

ruledescription
ClientTokenstringNo

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

ParameterTypeDescriptionExample
object
Ipv6EgressRuleIdstring

The ID of the egress-only rule.

ipv6py-hp3w98rmlbqp01245****
RequestIdstring

The request ID.

9DFEDBEE-E5AB-49E8-A2DC-CC114C67AF75

Examples

Sample success responses

JSONformat

{
  "Ipv6EgressRuleId": "ipv6py-hp3w98rmlbqp01245****",
  "RequestId": "9DFEDBEE-E5AB-49E8-A2DC-CC114C67AF75"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidIpv6Gateway.NotFound%s-
400IllegalParam.Name%s-
400IllegalParam.Description%s-
400IllegalParam.InstanceType%s-
400OperationFailed.FinancialLocked%s-
400OperationUnsupported.EgressRuleVSwitch%s-
400InvalidIpv6Instance.NotFound%s-
400OperationFailed.NoInternetBandwidth%s-
400OperationFailed.Ipv6EgressRuleExistedAn egress-only rule already exists for the IPv6 address.The IPv6 instance already has egress-only rules.
400OperationFailed.InternetBandwidthUnstable%s-
400IncorrectStatus.Ipv6InternetBandwidth%s-
400OperationUnsupported.EgressRuleInDefaultSpec%s-
400QuotaExceeded.Ipv6EgressRules%s-
400Mismatch.Ipv6AddressAndIpv6GatewayThe %s and %s are mismatched.Specified Ipv6Address and Ipv6Gateway are not in the same VPC
404InvalidRegionId.NotFoundThe 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 timeSummary of changesOperation
2024-06-28The Error code has changedView Change Details
2023-10-10API Description Update. The Error code has changedView Change Details
2023-07-05The Error code has changedView Change Details