tencent cloud

Feedback

DescribeNatGateways

Last updated: 2022-01-18 17:05:31

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.

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.
This document describes the parameters for Signature V1. It's recommended to use the V3 signature, which provides higher security. Note that for Signature V3, the common parameters need to be placed in the HTTP Header. See details.

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 name of the protocol port template instance, such as test_nat.
  • tag-key - String - (Filter condition) The tag key, such as test-key.
  • 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 Querying 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 parameters>
    

    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",
            "TagSet": [
              {
                "Key": "test-key",
                "Value": "test-value1"
              }
            ]
          },
          {
            "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",
            "TagSet": [
              {
                "Key": "test-key",
                "Value": "test-value2"
              }
            ]
          }
        ],
        "TotalCount": 2,
        "RequestId": "fed7e087-083f-49e4-8754-17fb130828e0"
      }
    }
    

    Example2 Querying 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 parameters>
    

    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",
            "TagSet": [
              {
                "Key": "test-key",
                "Value": "test-value3"
              }
            ]
          },
          {
            "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",
            "TagSet": [
              {
                "Key": "test-key",
                "Value": "test-value4"
              }
            ]
          }
        ],
        "TotalCount": 2,
        "RequestId": "a3964872-e2f5-4180-8607-0b49ec8e0109"
      }
    }
    

    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
    InvalidParameter.FilterInvalidKey The specified filter condition does not exist.
    InvalidParameterValue.Malformed Invalid input parameter format.
    InvalidParameterValue.Range The parameter value is not in the specified range.
    InvalidParameterValue.TooLong Invalid parameter value. The parameter value is too long.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support