All Products
Search
Document Center

NAT Gateway:ListNatIps

Last Updated:Feb 22, 2024

Queries the IP addresses on a NAT gateway.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region where the NAT gateway is deployed.

You can call the DescribeRegions operation to query the most recent region list.

eu-central-1
NatGatewayIdstringYes

The ID of the NAT gateway.

ngw-gw8v16wgvtq26vh59****
NatIpCidrstringNo

The CIDR block to which the IP address belongs.

192.168.0.0/24
DryRunbooleanNo

Specifies whether to only precheck the request. Valid values:

  • true: checks the API request. IP addresses are not queried. The system checks the required parameters, request syntax, and limits. If the request fails to pass the precheck, the corresponding error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false (default): sends the request. If the request passes the precheck, a 2xx HTTP status code is returned and the operation is performed.
false
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Note If you do not set this parameter, the system automatically uses RequestId as ClientToken. RequestId may be different for each API request.
5A2CFF0E-5718-45B5-9D4D-70B3FF3898
NatIpStatusstringNo

The status of the IP address. Valid values:

  • Available
  • Deleting
  • Creating
Available
NextTokenstringNo

The token that is used for the next query. Valid values:

  • If this is your first query or no next query is to be sent, ignore this parameter.
  • If a next query is to be sent, set the value to the value of NextToken that is returned from the last call.
FFmyTO70tTpLG6I3FmYAXGKPd****f84eb48b699f0a4883
MaxResultsstringNo

The number of entries to return on each page. Valid values: 1 to 100. Default value: 20.

20
NatIpNamearrayNo

The name of the IP address. Valid values of N: 1 to 20.

stringNo

The name of the IP address. Valid values of N: 1 to 20.

test
NatIpIdsarrayNo

The ID of the IP address. Valid values of N: 1 to 20.

stringNo

The ID of the IP address. Valid values of N: 1 to 20.

vpcnatcidr-gw8ov42ei6xh1jys2****

Response parameters

ParameterTypeDescriptionExample
object
NextTokenstring

The token that is used for the next query. Valid values:

  • If the value of NextToken is not returned, it indicates that no next query is to be sent.
  • If the value of NextToken is returned, the value indicates the token that is used for the next query.
FFmyTO70tTpLG6I3FmYAXGKPd****
RequestIdstring

The ID of the request.

7E78CEEA-BF8F-44D1-9DCD-D9141135B71E
TotalCountstring

The number of IP addresses that are returned.

1
NatIpsobject []

The list of IP addresses of the NAT gateway.

IsDefaultboolean

Indicates whether the IP address is the default IP address of the NAT gateway. Valid values:

  • true: yes
  • false: no
true
NatIpstring

The IP address.

192.168.0.126
NatIpCidrstring

The CIDR block to which the IP address belongs.

192.168.0.0/24
NatIpIdstring

The ID of the IP address.

vpcnatip-gw8a863sut1zijxh0****
NatIpDescriptionstring

The description of the IP address.

default
NatGatewayIdstring

The ID of the Virtual Private Cloud (VPC) NAT gateway to which the IP address is assigned.

ngw-gw8v16wgvtq26vh59****
NatIpNamestring

The name of the IP address.

default
NatIpStatusstring

The status of the IP address. Valid values:

  • Available: available
  • Deleted: deleted
  • Deleting: deleting
  • Creating: creating
  • Associated: specified in an SNAT or DNAT entry
  • Associating: being specified in an SNAT or DNAT entry
Available

Examples

Sample success responses

JSONformat

{
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "7E78CEEA-BF8F-44D1-9DCD-D9141135B71E",
  "TotalCount": "1",
  "NatIps": [
    {
      "IsDefault": true,
      "NatIp": "192.168.0.126",
      "NatIpCidr": "192.168.0.0/24",
      "NatIpId": "vpcnatip-gw8a863sut1zijxh0****",
      "NatIpDescription": "default",
      "NatGatewayId": "ngw-gw8v16wgvtq26vh59****",
      "NatIpName": "default",
      "NatIpStatus": "Available"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
404InvalidRegionId.NotFoundThe specified RegionId does not exist in our records.The specified region ID does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-03-01The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 404