tencent cloud

Feedback

DescribeNatGateways

Last updated: 2023-08-23 14:11:26

1. API Description

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

This API 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.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeNatGateways.
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 The unified ID of the NAT gateways, such as nat-123xx454.
Filters.N No Array of Filter Filters. NatGatewayIds and Filters cannot be specified at the same time.
  • nat-gateway-id - String - (Filter) The ID of the protocol port template instance, such as nat-123xx454.
  • vpc-id - String - (Filter) The unique ID of the VPC, such as vpc-123xx454.
  • nat-gateway-name - String - (Filter) The ID of the protocol port template instance, such as test_nat.
  • tag-key - String - (Filter) The tag key, such as test-key.
  • 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
    NatGatewaySet Array of NatGateway NAT gateway object array.
    TotalCount Integer The number of eligible NAT gateway objects.
    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,
                    "SecurityGroupSet": [],
                    "ExclusiveGatewayBandwidth": 1,
                    "IsExclusive": true,
                    "SubnetId": "sub-er88uji9",
                    "DirectConnectGatewayIds": [],
                    "SourceIpTranslationNatRuleSet": [],
                    "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"
                        }
                    ],
                    "SecurityGroupSet": [],
                    "ExclusiveGatewayBandwidth": 1,
                    "IsExclusive": true,
                    "SubnetId": "sub-er88uji9",
                    "DirectConnectGatewayIds": [],
                    "SourceIpTranslationNatRuleSet": []
                }
            ],
            "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"
                        }
                    ],
                    "SecurityGroupSet": [],
                    "ExclusiveGatewayBandwidth": 1,
                    "IsExclusive": true,
                    "SubnetId": "sub-er88uji9",
                    "DirectConnectGatewayIds": [],
                    "SourceIpTranslationNatRuleSet": []
                },
                {
                    "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"
                        }
                    ],
                    "SecurityGroupSet": [],
                    "ExclusiveGatewayBandwidth": 1,
                    "IsExclusive": true,
                    "SubnetId": "sub-er88uji9",
                    "DirectConnectGatewayIds": [],
                    "SourceIpTranslationNatRuleSet": []
                }
            ],
            "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
    InternalError.ModuleError Internal module error
    InvalidParameter.Coexist The parameters cannot be specified at the same time.
    InvalidParameter.FilterInvalidKey The specified filter condition does not exist.
    InvalidParameter.FilterNotDict The specified filter condition should be a key-value pair.
    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.
    InvalidParameterValue.TooLong Invalid parameter value. The parameter value is too long.
    ResourceNotFound The resource does not exist.
    UnsupportedOperation Unsupported operation.
    UnsupportedOperation.ActionNotFound The port does not exist.
    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