DescribeNatGateways

Last updated: 2020-07-31 14:30:45

1. API Description

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

This API (DescribeNatGateways) is used to query NAT gateways.

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

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 parameter. The value used for this API: DescribeNatGateways.
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 The unified ID of the NAT gateways, such as nat-123xx454.
Filters.N No Array of Filter Filter condition. NatGatewayIds and Filters cannot be specified at the same time.
  • nat-gateway-id - String - (Filter condition) The ID of the protocol port template instance, such as nat-123xx454.
  • vpc-id - String - (Filter condition) The unique ID of the VPC, such as vpc-123xx454.
  • nat-gateway-name - String - (Filter condition) The ID of the protocol port template instance, such as test_nat.
  • 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
    NatGatewaySet Array of NatGateway NAT gateway object array.
    TotalCount Integer The number of NAT gateway object sets 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 NAT gateway information

    This example shows you how to use Filters to query the NAT gateway information.

    Input Example

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

    Output Example

    {
      "Response": {
        "NatGatewaySet": [
          {
            "NatGatewayId": "nat-3isn9hr0",
            "NatGatewayName": "test",
            "VpcId": "vpc-0yi4hekt",
            "CreatedTime": "2017-09-20 20:28:24",
            "State": "AVAILABLE",
            "NetworkState": "RUNNING",
            "InternetMaxBandwidthOut": 100,
            "MaxConcurrentConnection": 1000000,
            "PublicIpAddressSet": [
              {
                "AddressId": "eip-7qcdm91q",
                "PublicIpAddress": "139.199.232.238",
                "IsBlocked": false
              }
            ],
            "DestinationIpPortTranslationNatRuleSet": [
              {
                "IpProtocol": "TCP",
                "PublicIpAddress": "139.199.232.238",
                "PublicPort": 8586,
                "PrivateIpAddress": "10.80.80.41",
                "PrivatePort": 8989,
                "Description": "test_modify"
              },
              {
                "IpProtocol": "UDP",
                "PublicIpAddress": "139.199.232.238",
                "PublicPort": 8989,
                "PrivateIpAddress": "10.80.80.41",
                "PrivatePort": 8989,
                "Description": "test_dnapt"
              }
            ],
            "Zone": "ap-guangzhou-1"
          },
          {
            "NatGatewayId": "nat-7xh58vea",
            "NatGatewayName": "test_create",
            "VpcId": "vpc-0yi4hekt",
            "CreatedTime": "2019-05-04 15:01:11",
            "State": "PENDING",
            "NetworkState": "RUNNING",
            "InternetMaxBandwidthOut": 100,
            "MaxConcurrentConnection": 1000000,
            "PublicIpAddressSet": [],
            "DestinationIpPortTranslationNatRuleSet": [],
            "Zone": "ap-guangzhou-2"
          }
        ],
        "TotalCount": 2,
        "RequestId": "a3964872-e2f5-4180-8607-0b49ec8e0109"
      }
    }

    Example2 Queries NAT gateway information-2

    This example shows you how to use NatGatewayIds to query the NAT gateway information.

    Input Example

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

    Output Example

    {
        "Response": {
            "NatGatewaySet": [
                {
                    "NatGatewayId": "nat-3isn9hr0",
                    "NatGatewayName": "test",
                    "VpcId": "vpc-0yi4hekt",
                    "CreatedTime": "2017-09-20 20:28:24",
                    "State": "AVAILABLE",
                    "NetworkState": "RUNNING",
                    "InternetMaxBandwidthOut": 100,
                    "MaxConcurrentConnection": 1000000,
                    "PublicIpAddressSet": [
                        {
                            "AddressId": "eip-7qcdm91q",
                            "PublicIpAddress": "139.199.232.238",
                            "IsBlocked": false
                        }
                    ],
                    "DestinationIpPortTranslationNatRuleSet": [
                        {
                            "IpProtocol": "TCP",
                            "PublicIpAddress": "139.199.232.238",
                            "PublicPort": 8586,
                            "PrivateIpAddress": "10.80.80.41",
                            "PrivatePort": 8989,
                            "Description": "test_modify"
                        },
                        {
                            "IpProtocol": "UDP",
                            "PublicIpAddress": "139.199.232.238",
                            "PublicPort": 8989,
                            "PrivateIpAddress": "10.80.80.41",
                            "PrivatePort": 8989,
                            "Description": "test_dnapt"
                        }
                    ],
                    "Zone": "ap-guangzhou-1"
                },
                {
                    "NatGatewayId": "nat-mxkohguo",
                    "NatGatewayName": "aaaaaa",
                    "VpcId": "vpc-m7sihqw5",
                    "CreatedTime": "2018-07-25 11:37:29",
                    "State": "PENDING",
                    "NetworkState": "UNAVAILABLE",
                    "InternetMaxBandwidthOut": 100,
                    "MaxConcurrentConnection": 1000000,
                    "PublicIpAddressSet": [],
                    "DestinationIpPortTranslationNatRuleSet": [
                    "Zone": "ap-guangzhou-1"
                }
            ],
            "TotalCount": 2,
            "RequestId": "fed7e087-083f-49e4-8754-17fb130828e0"
        }
    }

    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
    InvalidParameterValue.Malformed Invalid input parameter format.
    InvalidParameterValue.TooLong Invalid parameter value. The parameter value is too long.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help