All Products
Search
Document Center

Virtual Private Cloud:UnassociateVpcCidrBlock

Last Updated:Aug 29, 2024

Deletes a secondary CIDR block from a virtual private cloud (VPC).

Operation description

  • Before you delete a secondary CIDR block from a VPC, delete the vSwitch which is created with the CIDR block. For more information, see DeleteVSwitch .
  • You cannot repeatedly call the UnassociateVpcCidrBlock operation to delete a secondary CIDR block from a VPC within the specified period of time.

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:UnassociateVpcCidrBlockdelete
  • VPC
    acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the VPC to which the secondary CIDR block to be deleted belongs.

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

ch-hangzhou
VpcIdstringYes

The ID of the VPC from which you want to delete a secondary CIDR block.

vpc-o6wrloqsdqc9io3mg****
SecondaryCidrBlockstringNo

The secondary IPv4 CIDR block to be deleted.

Note You must set one of the SecondaryCidrBlock and Ipv6CidrBlock parameters.
192.168.0.0/16
IPv6CidrBlockstringNo

The secondary IPv6 CIDR block to be deleted.

Note You must set one of the Ipv6CidrBlock and SecondaryCidrBlock parameters.
2408:XXXX:0:6a::/56

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

C1221A1F-2ACD-4592-8F27-474E02883159

Examples

Sample success responses

JSONformat

{
  "RequestId": "C1221A1F-2ACD-4592-8F27-474E02883159"
}

Error codes

HTTP status codeError codeError messageDescription
400OperationFailed.Ipv6GatewayThe operation is failed because of ipv6Gateway is in use.The operation failed because the IPv6 gateway is being used.
400InvalidVpc.NotFound%s-
400IncorrectStatus.Vpc%s-
400ParamExclusive.SecondaryCidrAndIpv6Cidr%s-
400MissingParam.SecondaryCidrOrIpv6Cidr%s-
400InvalidSecondaryCidrBlock.NotFound%s-
400OperationFailed.CidrInUse%s-
400InvalidIpv6CidrBlock.NotFound%s-
400OperationFailed.CidrInUseThe operation failed because the CIDR block is already in use.-
400OperationFailed.IpV6VSwitchInuseOperation failed because some vswitch ipv6 is in use.-
400MissingParam.SecondaryCidrBlockOrIpv6CidrBlockEither SecondaryCidrBlock or Ipv6CidrBlock must be specified.The secondary CIDR block or the IPv6 CIDR block is not specified.

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

Change history

Change timeSummary of changesOperation
2023-08-24API Description Update. The Error code has changedView Change Details
2023-07-10The Error code has changedView Change Details