Queries the CIDR blocks of a specified 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 region ID of the Virtual Private Cloud (VPC) NAT gateway that you want to query.

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

NatGatewayId String Yes ngw-gw8v16wgvtq26vh59****

The ID of the VPC NAT gateway that you want to query.

NatIpCidr String No 172.16.0.0/24

The CIDR block of the NAT gateway that you want to query.

DryRun Boolean No false

Specifies whether to only precheck this request. Valid values:

  • true: checks the API request. The CIDR blocks of the NAT gateway are not queried if the API request passes the precheck. The system checks whether your AccessKey pair is valid, whether the Resource Access Management (RAM) user is authorized, and whether the required parameters are set. If the request fails to pass the precheck, the corresponding error message is returned. If the check succeeds, the DryRunOperation error code is returned.
  • false: sends the API request. If the request passes the precheck, 2xx HTTP status code is returned and the CIDR blocks of the NAT gateway are queried. This is the default value.
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.
NatIpCidrStatus String No Available

The status of the CIDR block that you want to query. Set the value to Available.

NextToken String No caeba0bbb2be03f84eb48b699f0a4883

The token that is used for the next query. Set the value as needed.

  • 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 ListNatIpCidrs

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

NatIpCidrName.N String No cidrname

The name of the CIDR block that you want to query. Valid values of N: 1 to 20.

NatIpCidrs.N String No 172.16.0.0/24

The CIDR block of the NAT gateway that you want to query. Valid values of N: 1 to 20.

Response parameters

Parameter Type Example Description
NextToken String caeba0bbb2be03f84eb48b699f0a4883

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 7479A224-4A28-4895-9604-11F48BCE6A88

The ID of the request.

TotalCount String 1

The number of CIDR blocks that are returned.

NatIpCidrs Array of NatIpCidr

The CIDR blocks of the NAT gateway.

CreationTime String 2021-06-28T20:50Z

The time when the CIDR block was created.

NatIpCidrId String vpcnatcidr-gw8ov42ei6xh1jys2****

The ID of the CIDR block of the NAT gateway.

IsDefault Boolean true

Indicates whether the CIDR block is the default CIDR block of the NAT gateway. Valid values:

  • true: The CIDR block is the default CIDR block of the NAT gateway.
  • false: The CIDR block is not the default CIDR block of the NAT gateway.
NatIpCidrStatus String Available

The status of the CIDR block of the NAT gateway. If Available is returned, it indicates that the CIDR block is available.

NatIpCidrName String Name

The name of the CIDR block of the NAT gateway.

NatIpCidr String 172.16.0.0/24

The CIDR block of the NAT gateway.

NatGatewayId String ngw-gw8v16wgvtq26vh59****

The ID of the VPC NAT gateway.

NatIpCidrDescription String test

The description of the CIDR block of the NAT gateway.

Examples

Sample requests

http(s)://[Endpoint]/?RegionId=eu-central-1
&NatGatewayId=ngw-gw8v16wgvtq26vh59****
&NatIpCidr=172.16.0.0/24
&DryRun=false
&ClientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF3898
&NatIpCidrStatus=Available
&NextToken=caeba0bbb2be03f84eb48b699f0a4883
&MaxResults=20
&NatIpCidrName=["cidrname"]
&NatIpCidrs=["172.16.0.0/24"]
&Action=ListNatIpCidrs
&Common request parameters

Sample responses

XML format

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

<ListNatIpCidrsResponse>
    <NextToken>caeba0bbb2be03f84eb48b699f0a4883</NextToken>
    <RequestId>7479A224-4A28-4895-9604-11F48BCE6A88</RequestId>
    <TotalCount>1</TotalCount>
    <NatIpCidrs>
        <CreationTime>2021-06-28T20:50Z</CreationTime>
        <NatIpCidrId>vpcnatcidr-gw8ov42ei6xh1jys2****</NatIpCidrId>
        <IsDefault>true</IsDefault>
        <NatIpCidrStatus>Available</NatIpCidrStatus>
        <NatIpCidrName>default</NatIpCidrName>
        <NatIpCidr>172.16.0.0/24</NatIpCidr>
        <NatGatewayId>ngw-gw8v16wgvtq26vh59****</NatGatewayId>
        <NatIpCidrDescription>default</NatIpCidrDescription>
    </NatIpCidrs>
</ListNatIpCidrsResponse>

JSON format

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

{
  "NextToken" : "caeba0bbb2be03f84eb48b699f0a4883",
  "RequestId" : "7479A224-4A28-4895-9604-11F48BCE6A88",
  "TotalCount" : "1",
  "NatIpCidrs" : [ {
    "CreationTime" : "2021-06-28T20:50Z",
    "NatIpCidrId" : "vpcnatcidr-gw8ov42ei6xh1jys2****",
    "IsDefault" : true,
    "NatIpCidrStatus" : "Available",
    "NatIpCidrName" : "default",
    "NatIpCidr" : "172.16.0.0/24",
    "NatGatewayId" : "ngw-gw8v16wgvtq26vh59****",
    "NatIpCidrDescription" : "default"
  } ]
}

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.