Help & DocumentationAPIsVirtual Private CloudNAT Gateway APIsDescribeNatGatewayDestinationIpPortTranslationNatRules

DescribeNatGatewayDestinationIpPortTranslationNatRules

Last updated: 2020-05-15 11:12:19

1. API Description

Domain name for API request: vpc.tencentcloudapi.com.

This API (DescribeNatGatewayDestinationIpPortTranslationNatRules) is used to query the array of objects of the port forwarding rules for a NAT gateway.

A maximum of 100 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: vpc.ap-shanghai-fsi.tencentcloudapi.com

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: DescribeNatGatewayDestinationIpPortTranslationNatRules.
Version Yes String Common parameter. The value used for this API: 2017-03-12.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
NatGatewayIds.N No Array of String NAT gateway ID.
Filters.N No Array of Filter Filter conditions:
NatGatewayIds and Filters cannot be specified at the same time.
  • nat-gateway-id, the NAT gateway ID, such as nat-0yi4hekt.
  • vpc-id, the VPC ID, such as vpc-0yi4hekt.
  • public-ip-address, the EIP, such as 139.199.232.238.
  • public-port, the public network port.
  • private-ip-address, the private IP, such as 10.0.0.1.
  • private-port, the private network port.
  • description, the rule description.
  • Offset No Integer Offset. The default value is 0.
    Limit No Integer Number of values to be returned. The default value is 20. Maximum is 100.

    3. Output Parameters

    Parameter Name Type Description
    NatGatewayDestinationIpPortTranslationNatRuleSet Array of NatGatewayDestinationIpPortTranslationNatRule The object array of port forwarding rules for the NAT gateway.
    TotalCount Integer The number of object arrays of NAT port forwarding rules meeting the conditions.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Queries the port forwarding rule of a NAT gateway

    This example shows you how to use the Filter array to pull a NAT gateway’s port forwarding rules.

    Input Example

    https://vpc.tencentcloudapi.com/?Action=DescribeNatGatewayDestinationIpPortTranslationNatRules
    &Filters.0.Name=vpc-id
    &Filters.0.Values.0=vpc-0yi4hekt
    &<Common request parameter>

    Output Example

    {
      "Response": {
        "TotalCount": 2,
        "NatGatewayDestinationIpPortTranslationNatRuleSet": [
          {
            "IpProtocol": "TCP",
            "PublicIpAddress": "139.199.232.238",
            "PublicPort": 8989,
            "PrivateIpAddress": "10.80.80.41",
            "PrivatePort": 8989,
            "Description": "test_dnapt",
            "CreatedTime": "2019-05-04 13:42:11",
            "NatGatewayId": "nat-3isn9hr0",
            "VpcId": "vpc-0yi4hekt"
          },
          {
            "IpProtocol": "UDP",
            "PublicIpAddress": "139.199.232.238",
            "PublicPort": 8989,
            "PrivateIpAddress": "10.80.80.41",
            "PrivatePort": 8989,
            "Description": "test_dnapt",
            "CreatedTime": "2019-05-04 13:20:20",
            "NatGatewayId": "nat-3isn9hr0",
            "VpcId": "vpc-0yi4hekt"
          }
        ],
        "RequestId": "eb203971-a7a0-45c1-9c72-36ad86688590"
      }
    }

    Example2 Queries the port forwarding rule of a NAT gateway-2

    This example shows you how to use the NatGatewayId array to pull the NAT gateway’s port forwarding rules.

    Input Example

    https://vpc.tencentcloudapi.com/?Action=DescribeNatGatewayDestinationIpPortTranslationNatRules
    &NatGatewayIds.0=nat-3isn9hr0
    &Offset=0
    &Limit=10
    &<Common request parameter>

    Output Example

    {
      "Response": {
        "TotalCount": 2,
        "NatGatewayDestinationIpPortTranslationNatRuleSet": [
          {
            "IpProtocol": "TCP",
            "PublicIpAddress": "139.199.232.238",
            "PublicPort": 8989,
            "PrivateIpAddress": "10.80.80.41",
            "PrivatePort": 8989,
            "Description": "test_dnapt",
            "CreatedTime": "2019-05-04 13:09:25",
            "NatGatewayId": "nat-3isn9hr0",
            "VpcId": "vpc-0yi4hekt"
          },
          {
            "IpProtocol": "UDP",
            "PublicIpAddress": "139.199.232.238",
            "PublicPort": 8989,
            "PrivateIpAddress": "10.80.80.41",
            "PrivatePort": 8989,
            "Description": "test_dnapt",
            "CreatedTime": "2019-05-04 13:20:20",
            "NatGatewayId": "nat-3isn9hr0",
            "VpcId": "vpc-0yi4hekt"
          }
        ],
        "RequestId": "9b751ec3-d10a-4138-bdd9-fa5564684e60"
      }
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InternalServerError Internal error.
    InvalidAddressId.NotFound The specified EIP does not exist.
    InvalidParameter Invalid input parameter.
    InvalidParameter.Coexist The parameters cannot be specified at the same time.
    InvalidParameterValue Invalid parameter value
    InvalidParameterValue.Duplicate The input parameter already exists.
    InvalidParameterValue.LimitExceeded The parameter value exceeds the limit.
    InvalidParameterValue.Malformed Invalid input parameter format.
    UnauthorizedOperation Unauthorized operation.