All Products
Search
Document Center

NAT Gateway:ListNatIpCidrs

Last Updated:Mar 22, 2024

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.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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.

eu-central-1
NatGatewayIdstringYes

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

ngw-gw8v16wgvtq26vh59****
NatIpCidrstringNo

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

172.16.0.0/24
DryRunbooleanNo

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.
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
NatIpCidrStatusstringNo

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

Available
NextTokenstringNo

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.
caeba0bbb2be03f84eb48b699f0a4883
MaxResultsstringNo

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

20
NatIpCidrNamearrayNo

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

stringNo

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

cidrname
NatIpCidrsarrayNo

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

stringNo

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

172.16.0.0/24

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.
caeba0bbb2be03f84eb48b699f0a4883
RequestIdstring

The ID of the request.

7479A224-4A28-4895-9604-11F48BCE6A88
TotalCountstring

The number of CIDR blocks that are returned.

1
NatIpCidrsobject []

The CIDR blocks of the NAT gateway.

CreationTimestring

The time when the CIDR block was created.

2021-06-28T20:50Z
NatIpCidrIdstring

The ID of the CIDR block of the NAT gateway.

vpcnatcidr-gw8ov42ei6xh1jys2****
IsDefaultboolean

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.
true
NatIpCidrStatusstring

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

Available
NatIpCidrNamestring

The name of the CIDR block of the NAT gateway.

Name
NatIpCidrstring

The CIDR block of the NAT gateway.

172.16.0.0/24
NatGatewayIdstring

The ID of the VPC NAT gateway.

ngw-gw8v16wgvtq26vh59****
NatIpCidrDescriptionstring

The description of the CIDR block of the NAT gateway.

test

Examples

Sample success responses

JSONformat

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

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