All Products
Search
Document Center

Virtual Private Cloud:ListVSwitchCidrReservations

Last Updated:Aug 29, 2024

Queries reserved CIDR blocks of vSwitches.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:ListVSwitchCidrReservationslist
  • VSwitchCidrReservation
    acs:vpc:{#regionId}:{#accountId}:vswitchcidrreservation/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
Tagsarray<object>No

The tags.

objectNo
KeystringNo

The tag key. You can specify at most 20 tag keys. The tag key cannot be an empty string.

A tag key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

FinanceDept
ValuestringNo

The tag value. You can specify at most 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length, and cannot start with acs: or aliyun. It cannot contain http:// or https://.

FinanceJoshua
VSwitchIdstringNo

The ID of the vSwitch for which you want to query reserved CIDR blocks.

vsw-25navfgbue4g****
VSwitchCidrReservationIdsarrayNo

The ID of the reserved CIDR block. You can specify at most 10 IDs.

stringNo

The ID of the reserved CIDR block. You can specify at most 10 IDs.

vcr-bp1m12saqteraw3rp****
VSwitchCidrReservationTypestringNo

The type of the reserved CIDR block. Set the value to prefix.

Note When you allocate CIDR blocks, or enable the service to automatically allocate CIDR blocks to elastic network interfaces (ENIs), the CIDR blocks to allocate must fall into the reserved CIDR block. If the reserved CIDR is exhausted, an error message is returned.
prefix
IpVersionstringNo

The IP version of the reserved CIDR block. Valid values:

  • IPv4 (default)
  • IPv6
IPv4
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • You do not need to specify this parameter for the first request.
  • You must specify the token that is obtained from the previous query as the value of NextToken.
FFmyTO70tTpLG6I3FmYAXGKPd****
MaxResultslongNo

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

10
RegionIdstringYes

The region ID of the vSwitch.

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

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

The request ID.

RequestIdstring

The request ID.

54B48E3D-DF70-471B-AA93-08E683A1B45
NextTokenstring

The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next page exists.
  • If a value is returned for NextToken, the value is the token that determines the start point of the next query.
FFmyTO70tTpLG6I3FmYAXGKPd****
TotalCountlong

The total number of entries returned.

10
MaxResultslong

The number of entries to return per page.

10
VSwitchCidrReservationsarray<object>

A list of reserved CIDR blocks.

object
VpcIdstring

The virtual private cloud (VPC) to which the reserved CIDR block belongs.

vpc-bp1wdz2pdhgurz1od****
VSwitchIdstring

The ID of the vSwitch to which the reserved CIDR block belongs.

vsw-25navfgbue4g****
VSwitchCidrReservationIdstring

The ID of the reserved CIDR block.

vcr-bp1m12saqteraw3rp****
VSwitchCidrReservationCidrstring

The reserved CIDR block.

192.168.1.64/28
VSwitchCidrReservationNamestring

The name of the reserved CIDR block.

ReservationName
VSwitchCidrReservationDescriptionstring

The description of the reserved CIDR block.

ReservationDescription
IpVersionstring

The IP version of the reserved CIDR block. Valid values:

  • IPv4 (default)
  • IPv6
IPv4
CreationTimestring

The time when the reserved CIDR block was created.

2023-03-14T10:02:37Z
Typestring

The type of the reserved CIDR block. Valid value: prefix. CIDR blocks are allocated from the reserved CIDR block.

prefix
AvailableCidrCountinteger

The number of available prefixes in the reserved CIDR block.

10
AssignedCidrCountinteger

The number of used prefixes in the reserved CIDR block.

6
Statusstring

The status of the reserved CIDR block. Valid values:

  • Assigning
  • Assigned
  • Releasing
  • Released
Assigned
Tagsarray<object>

The tags.

object
Keystring

The tag key.

FinanceDept
Valuestring

The tag value.

FinanceJoshua

Examples

Sample success responses

JSONformat

{
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "TotalCount": 10,
  "MaxResults": 10,
  "VSwitchCidrReservations": [
    {
      "VpcId": "vpc-bp1wdz2pdhgurz1od****",
      "VSwitchId": "vsw-25navfgbue4g****",
      "VSwitchCidrReservationId": "vcr-bp1m12saqteraw3rp****",
      "VSwitchCidrReservationCidr": "192.168.1.64/28",
      "VSwitchCidrReservationName": "ReservationName",
      "VSwitchCidrReservationDescription": "ReservationDescription",
      "IpVersion": "IPv4",
      "CreationTime": "2023-03-14T10:02:37Z",
      "Type": "prefix",
      "AvailableCidrCount": 10,
      "AssignedCidrCount": 6,
      "Status": "Assigned",
      "Tags": [
        {
          "Key": "FinanceDept",
          "Value": "FinanceJoshua"
        }
      ]
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalParam.NextTokenThe specified NextToken is invalid.The specified NextToken is invalid.

For a list of error codes, visit the Service error codes.