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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
RegionId String Yes eu-central-1

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

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

NatGatewayId String Yes ngw-gw8v16wgvtq26vh59****

The ID of the NAT gateway.

NatIpCidr String No 192.168.0.0/24

The CIDR block to which the IP address belongs.

DryRun Boolean No false

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.
ClientToken String No 5A2CFF0E-5718-45B5-9D4D-70B3FF3898

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.
NatIpStatus String No Available

The status of the IP address. Valid values:

  • Available
  • Deleting
  • Creating
NextToken String No FFmyTO70tTpLG6I3FmYAXGKPd****f84eb48b699f0a4883

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.
MaxResults String No 20

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

Action String Yes ListNatIps

The operation that you want to perform. Set the value to ListNatIps.

NatIpName.N String No test

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

NatIpIds.N String No vpcnatcidr-gw8ov42ei6xh1jys2****

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

Response parameters

Parameter Type Example Description
NextToken String FFmyTO70tTpLG6I3FmYAXGKPd****

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.
RequestId String 7E78CEEA-BF8F-44D1-9DCD-D9141135B71E

The ID of the request.

TotalCount String 1

The number of IP addresses that are returned.

NatIps Array of NatIp

The list of IP addresses of the NAT gateway.

IsDefault Boolean true

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

  • true: yes
  • false: no
NatIp String 192.168.0.126

The IP address.

NatIpCidr String 192.168.0.0/24

The CIDR block to which the IP address belongs.

NatIpId String vpcnatip-gw8a863sut1zijxh0****

The ID of the IP address.

NatIpDescription String default

The description of the IP address.

NatGatewayId String ngw-gw8v16wgvtq26vh59****

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

NatIpName String default

The name of the IP address.

NatIpStatus String Available

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: specified in an SNAT or DNAT entry

Examples

Sample requests

http(s)://[Endpoint]/?RegionId=eu-central-1
&NatGatewayId=ngw-gw8v16wgvtq26vh59****
&NatIpCidr=192.168.0.0/24
&DryRun=false
&ClientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF3898
&NatIpStatus=Available
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****f84eb48b699f0a4883
&MaxResults=20
&NatIpName=["test"]
&NatIpIds=["vpcnatcidr-gw8ov42ei6xh1jys2****"]
&Action=ListNatIps
&Common request parameters

Sample responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListNatIpsResponse>
    <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
    <RequestId>7E78CEEA-BF8F-44D1-9DCD-D9141135B71E</RequestId>
    <TotalCount>1</TotalCount>
    <NatIps>
        <IsDefault>true</IsDefault>
        <NatIp>192.168.0.126</NatIp>
        <NatIpCidr>192.168.0.0/24</NatIpCidr>
        <NatIpId>vpcnatip-gw8a863sut1zijxh0****</NatIpId>
        <NatIpDescription>default</NatIpDescription>
        <NatGatewayId>ngw-gw8v16wgvtq26vh59****</NatGatewayId>
        <NatIpName>default</NatIpName>
        <NatIpStatus>Available</NatIpStatus>
    </NatIps>
</ListNatIpsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "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

HttpCode Error code Error message Description
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. The error message returned because the specified region ID does not exist.

For a list of error codes, visit the API Error Center.