Queries a CIDR block 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
Action String Yes ListNatIpCidrs

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

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 Virtual Private Cloud (VPC) NAT gateway that you want to query.

NatIpCidr String Yes 172.16.0.0/24

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

DryRun Boolean No false

Specifies whether to precheck only this request. Valid values:

  • true: sends a precheck request. The CIDR blocks of the NAT gateway are not queried. The system checks whether your AccessKey pair is valid, whether the Resource Access Management (RAM) user is authorized, and whether required parameters are set. If the request fails the precheck, the corresponding error message is returned. If the request passes the precheck, the DryRunOperation error message is returned.
  • false: sends a regular request. After 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 idempotency of the request. 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 and cannot exceed 64 characters in length.

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

The status of the CIDR block that you want to query. If the value is Available, the CIDR block is available.

NextToken String No caeba0bbb2be03f84eb48b699f0a4883

The token used to start the next query. If you do not set NextToken, 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.

NatIpCidrName.N RepeatList No test

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

NatIpCidrs.N RepeatList 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
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.

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.
NatGatewayId String ngw-gw8v16wgvtq26vh59****

The ID of the VPC NAT gateway.

NatIpCidr String 172.16.0.0/24

The CIDR block of the NAT gateway.

NatIpCidrDescription String default

The description of the CIDR block of the NAT gateway.

NatIpCidrId String vpcnatcidr-gw8ov42ei6xh1jys2****

The instance ID of the CIDR block of the NAT gateway.

NatIpCidrName String default

The name of the CIDR block of the NAT gateway.

NatIpCidrStatus String Available

The status of the CIDR block of the NAT gateway. If the value is Available, the CIDR block is available.

NextToken String caeba0bbb2be03f84eb48b699f0a4883

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

RequestId String 7479A224-4A28-4895-9604-11F48BCE6A88

The ID of the request.

TotalCount String 1

The number of CIDR blocks that are returned.

Examples

Sample requests

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

Sample success responses

XML format

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

JSON format

{
    "TotalCount": 1,
    "RequestId": "7479A224-4A28-4895-9604-11F48BCE6A88",
    "NextToken": "caeba0bbb2be03f84eb48b699f0a4883",
    "NatIpCidrs": {
        "IsDefault": true,
        "NatIpCidr": "172.16.0.0/24",
        "NatIpCidrDescription": "default",
        "NatIpCidrId": "vpcnatcidr-gw8ov42ei6xh1jys2****",
        "CreationTime": "2021-06-28T20:50Z",
        "NatIpCidrName": "default",
        "NatGatewayId": "ngw-gw8v16wgvtq26vh59****",
        "NatIpCidrStatus": "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.