Add Local IP Translation ACL Policy

Last updated: 2017-12-05 16:52:45

1. API Description

This API (CreateLocalIPTranslationAclRule) is used to add ACL rules for local IP translation.
Domain for API request:vpc.api.qcloud.com

2. Input Parameters

The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is CreateLocalIPTranslationAclRule.

Parameter Name Required Type Description
vpcId Yes String Virtual private cloud ID assigned by the system, for example: vpc-dfg5445. This can be queried via the Querying Virtual Private Cloud List (DescribeVpcEx) API.
directConnectGatewayId Yes String Direct Connect gateway ID assigned by the system, for example: dcg-4d545d. This can be queried via the Querying Direct Connect Gateway (DescribeDirectConnectGateway) API.
originalIP Yes String Original IP (IP in VPC).
translationIP Yes String Translated IP.
aclRules.n Yes Array ACL rule information.
aclRules.n.protocol Yes String Protocol: TCP, UDP or ALL.
aclRules.n.sourcePort Yes String The accessed source port, supporting xx-xx range. If left blank or filled with 0 or 0-0, it means any port is OK.
aclRules.n.destinationCidr Yes String The accessed destination IP, supporting IP and IP segment (CIDR format). If left blank, it refers to all IPs.
aclRules.n.destinationPort Yes String The accessed destination port, supporting xx-xx range. If left blank or filled with 0 or 0-0, it means any port is OK.

3. Output Parameters

Parameter Name Type Description
code Int Common error code; 0: Succeeded; other values: Failed. For more information, please refer to Common Error Codes on the Error Code page.
message String Module error message description depending on API.

4. Error Code List

The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

Error Code Description
InvalidVpc.NotFound Invalid VPC. VPC resource does not exist. Please verify that you have entered resource information correctly. This can be queried via the Querying Virtual Private Cloud List (DescribeVpcEx) API.
InvalidDirectConnectGateway.NotFound Invalid Direct Connect gateway. Direct Connect gateway resource does not exist. Please verify that you have entered resource information correctly. This can be queried via the Querying Direct Connect Gateway (DescribeDirectConnectGateway) API.
InvalidLocalIPTranslation.NotFound Invalid local IP translation rule. Local IP translation rule does not exist. Please verify that you have entered resource information correctly.

5. Example

Input


https://vpc.api.qcloud.com/v2/index.php?Action=CreateLocalIPTranslationAclRule
&<Common request parameters>
&vpcId=vpc-dfgg190
&directConnectGatewayId=dcg-ddf14d
&originalIP=10.0.0.5
&translationIP=138.0.0.11
&aclRules.n.protocol=tcp
&aclRules.n.sourcePort=80
&aclRules.n.destinationCidr=10.0.0.2/18
&aclRules.n.destinationPort=90

Output

{
    "code":"0",
    "message":""
}