Query a NAT Gateway

Last updated: 2020-06-04 17:40:40


    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new VPC API 3.0 which is standardized and faster.

    1. API Description

    This API (DescribeNatGateway) is used to query NAT gateways.
    Domain name for API requests: vpc.api.qcloud.com

    2. Input Parameters

    The list below contains only the API request parameters. The common request parameters need to be added when a call is made. For more information, see the Common Request Parameters page. The Action field for this API is DescribeNatGateway.

    Parameter name Required Type Description
    natId No String NAT gateway unified ID, for example: nat-xx454.
    natName No String NAT gateway name, supports fuzzy query.
    vpcId No String VPC ID or unified ID (recommended), for example: vpc-dfdg42d.
    offset No Int Offset of the initial line. The default is 0.
    limit No Int Number of lines per page. The default is 20 and the maximum is 50.
    orderField No String Sorts by a field. Sorting is not implemented by default.
    Supported field: natId.
    orderDirection No String Ascending order (asc) or descending order (desc). The default is desc.

    3. Output Parameters

    Parameter name Type Description
    code Int Error code. 0: Successful; other values: Failed.
    message String Error message.
    totalCount Int Total number of queried NAT gateways.
    data.n Array Queried NAT gateway information array.

    "data" is composed as follows:

    Parameter name Type Description
    data.n.natId String Unified ID of the NAT gateway, for example: nat-xx454.
    data.n.unVpcId String Unified ID of the VPC, for example: vpc-xgfd55d.
    data.n.natName String NAT gateway name.
    data.n.state Int Status of the NAT gateway, 0: Running, 1: Unavailable, 2: Service suspended due to overdue payment.
    data.n.maxConcurrent Int Maximum gateway concurrent connections, values: 1,000,000 (small), 3,000,000 (medium), and 10,000,000 (large).
    data.n.bandwidth Int The maximum public network outbound bandwidth of the gateway (in Mbps).
    data.n.eipCount String Number of EIPs, for example: nat-xx454.
    data.n.eipSet Array Complete EIP information of the gateway, for example: [].
    data.n.createTime String Creation time of the NAT gateway, for example: 2016-06-21 12:01:23.
    data.n.productionStatus Int Production status of the NAT gateway. 0: Creating; 1: Created successfully; 2: Creation failed; 3: Changing; 4: Change failed; 5: Deleting; 6: Deletion failed.

    4. Error Codes

    The following error codes only include business logic error codes for this API.
    | Error code | Description |
    | InvalidVpc.NotFound | Invalid VPC. This error code indicates that the VPC resource does not exist. In this case, verify whether the resource information that you entered is correct. You can query the VPC through the API DescribeVpcEx. |
    | InvalidNatGatewayId.NotFound | Invalid NAT gateway. This error code indicates that the NAT gateway resource does not exist. In this case, verify whether the resource information that you entered is correct. You can query the NAT gateway through the API DescribeNatGateway. |

    5. Example




        "data": [
                "appId": "1351000042",
                "vpcId": "vpc-8e0ypm3z",
                "vpcName": "alblack.bbb1",
                "natId": "nat-dhfpwhtm",
                "natName": "apollan",
                "maxConcurrent": 0,
                "eipCount": 1,
                "createTime": "2016-06-21 12:01:23",
                "state": 1,
                "bandwidth": 90000,
                "productionStatus": 1,
                "eipSet": [

    Was this page helpful?

    Was this page helpful?

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