Queries NAT IP addresses.

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
Action String Yes ListNatIps

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

NatGatewayId String Yes ngw-gw8v16wgvtq26vh59****

The ID of the NAT gateway to which the NAT IP address belongs.

NatIpCidr String Yes 192.168.0.0/24

The CIDR block to which the NAT IP address belongs.

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.

DryRun Boolean No false

Specifies whether to precheck this request. Valid values:

  • true: sends the precheck request. NAT IP addresses are not queried. The system checks whether the AccessKey pair is valid, whether the RAM user is authorized, and whether the required parameters are specified. If the request fails the precheck, the corresponding error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false: sends the API request. This is the default value. If the request passes the precheck, a 2XX HTTP status code is returned and NAT IP addresses are queried.
ClientToken String No 5A2CFF0E-5718-45B5-9D4D-70B3FF3898

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

Note If you do not set this parameter, the system automatically uses the request ID as the client token. The ID of each request may be unique.
NatIpStatus String No Available

The status of the NAT IP address. Valid values:

  • Available: available
  • Deleting: being deleted
  • Creating: being created
NextToken String No caeba0bbb2be03f84eb48b699f0a4883

The token used to start the next query. If NextToken is not set, all results are returned.

MaxResults String No 20

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

NatIpName.N RepeatList No test

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

NatIpIds.N RepeatList No vpcnatip-gw8a863sut1zijxh0****

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

Response parameters

Parameter Type Example Description
NatIps Array of NatIp

The list of NAT IP addresses.

IsDefault Boolean true

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

  • true: yes
  • false: no
NatGatewayId String ngw-gw8v16wgvtq26vh59****

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

NatIp String 192.168.0.126

The NAT IP address that is queried.

NatIpCidr String 192.168.0.0/24

The CIDR block to which the NAT IP address belongs.

NatIpDescription String default

The description of the NAT IP address.

NatIpId String vpcnatip-gw8a863sut1zijxh0****

The ID of the NAT IP address.

NatIpName String default

The name of the NAT IP address.

NatIpStatus String Available

The status of the NAT IP address. Valid values:

  • Available: available
  • Deleted: deleted
  • Deleting: being deleted
  • Creating: being created
  • Associated: associated with an SNAT or DNAT entry
  • Associating: being associated with an SNAT or DNAT entry
NextToken String caeba0bbb2be03f84eb48b699f0a4883

The token used to start the next query. If NextToken is not set, all results are returned.

RequestId String 7E78CEEA-BF8F-44D1-9DCD-D9141135B71E

The ID of the request.

TotalCount String 7

The number of NAT IP addresses that are returned.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListNatIps
&NatGatewayId=ngw-gw8v16wgvtq26vh59****
&NatIpCidr=192.168.0.0/24
&RegionId=eu-central-1
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

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.