All Products
Search
Document Center

Virtual Private Cloud:DeleteVpcPeerConnection

Last Updated:Mar 03, 2024

Deletes a virtual private cloud (VPC) peering connection.

Operation description

  • You can delete VPC peering connections. After you delete a VPC peering connection, your service is affected. Proceed with caution.

    • If you forcefully delete a VPC peering connection, the system deletes the routes that point to the VPC peering connection from the VPC route table.
    • If you do not forcefully delete a VPC peering connection, the system does not delete these routes. You must manually delete them.
  • The DeleteVpcPeerConnection operation is asynchronous. After you send a request, the system returns RequestId, but the operation is still being performed in the background. You can call the GetVpcPeerConnectionAttribute operation to query the status of a VPC peering connection.

    • If a VPC peering connection is in the Deleting state, it is being deleted.
    • If a VPC peering connection is in the Deleted state, it is deleted.
  • You cannot repeatedly call the DeleteVpcPeerConnection operation for the same VPC peering connection 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

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the VPC peering connection that you want to delete.

pcc-lnk0m24khwvtkm****
ForcebooleanNo

Specifies whether to forcefully delete the VPC peering connection. Valid values:

  • false (default): no.
  • true: yes. If you forcefully delete the VPC peering connection, the system deletes the routes that point to the VPC peering connection from the VPC route table.
false
DryRunbooleanNo

Specifies whether to check the request without performing the operation. Valid values:

  • true: checks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails to pass the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false (default): sends the request. If the request passes the check, an HTTP 2xx status code is returned and the operation is performed.
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 client token can contain only ASCII characters.

Note If you do not set this parameter, the system uses RequestId as ClientToken. The value of RequestId for each API request may be different.
02fb3da4-130e-11e9-8e44-001****

Response parameters

ParameterTypeDescriptionExample
object

RpcResponse

RequestIdstring

The ID of the request.

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

Examples

Sample success responses

JSONformat

{
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45"
}

Error codes

HTTP status codeError codeError messageDescription
400ResourceNotFound.InstanceIdThe specified resource of %s is not found.The specified instance is not found
400IncorrectStatus.VpcPeerThe status of %s [%s] is incorrect.-
400OperationDenied.RouteEntryExistThe operation is not allowed because of existing routeEntry point to VpcPeer.The VPC peering connection cannot be deleted because a route points to the VPC peering connection.

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

Change history

Change timeSummary of changesOperation
2024-01-23API Description Update. The Error code has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400