tencent cloud

文档反馈

DescribeNatGatewayDestinationIpPortTranslationNatRules

最后更新时间:2023-08-23 14:11:27

1. API Description

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

This API is used to query the array of objects of a NAT gateway's port forwarding rules.

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

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

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 Params. The value used for this API: DescribeNatGatewayDestinationIpPortTranslationNatRules.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region No String Common Params. This parameter is not required for this API.
NatGatewayIds.N No Array of String NAT gateway ID.
Filters.N No Array of Filter Filters:
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. Default value: 0.
    Limit No Integer Number of returned results. Default value: 20. Maximum value: 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 eligible object arrays of NAT port forwarding rules.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Querying the port forwarding rules of specified NAT gateways

    This example shows you how to query the port forwarding rules by specifying NatGatewayId.

    Input Example

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

    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"
        }
    }
    

    Example2 Querying the port forwarding rules of NAT gateways

    This example shows you how to use the Filter array to obtain the port forwarding rules of a NAT gateway.

    Input Example

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

    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"
        }
    }
    

    5. Developer Resources

    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 A parameter error occurred.
    InvalidParameter.Coexist The parameters cannot be specified at the same time.
    InvalidParameterValue Incorrect parameter value.
    InvalidParameterValue.Duplicate The input parameter already exists.
    InvalidParameterValue.LimitExceeded The parameter value exceeds the limit.
    InvalidParameterValue.Malformed Invalid input parameter format.
    InvalidParameterValue.Range The parameter value is not in the specified range.
    UnauthorizedOperation Unauthorized operation.
    联系我们

    联系我们,为您的业务提供专属服务。

    技术支持

    如果你想寻求进一步的帮助,通过工单与我们进行联络。我们提供7x24的工单服务。

    7x24 电话支持