- What's New
- Function Overview
- Service Overview
- Billing
- Getting Started
-
User Guide
- Permissions Management
- Enterprise Routers
- Attachments
- Route Tables
- Associations
- Propagations
- Routes
-
Routing Control
-
Route Policies
- Route Policy Overview
- Creating a Route Policy
- Associating a Route Policy with an Enterprise Router
- Changing the Route Policy Associated with an Enterprise Router
- Disassociating a Route Policy from an Enterprise Router
- Modifying a Route Policy
- Viewing a Route Policy
- Deleting a Route Policy
- Adding a Policy Node to a Route Policy
- Modifying a Policy Node in a Route Policy
- Exporting Policy Nodes in a Route Policy
- Viewing a Policy Node in a Route Policy
- Deleting a Policy Node from a Route Policy
-
IP Prefix Lists
- IP Prefix List Overview
- Creating an IP Prefix List
- Modifying the Name of an IP Prefix List
- Viewing an IP Prefix List
- Deleting an IP Prefix List
- Adding a Prefix Rule to an IP Address Prefix List
- Modifying an IP Prefix Rule in an IP Prefix List
- Exporting Prefix Rules in an IP Prefix List
- Viewing a Prefix Rule in an IP Prefix List
- Deleting a Prefix Rule from an IP Prefix List
-
AS_Path Lists
- AS_Path List Overview
- Creating an AS_Path List
- Modifying the Name of an AS_Path List
- Viewing an AS_Path List
- Deleting an AS_Path List
- Adding an AS_Path Filter to an AS_Path List
- Exporting AS_Path Filters in an AS_Path List
- Viewing an AS_Path Filter in an AS_Path List
- Deleting an AS_Path Filter from an AS_Path List
-
Route Policies
- Sharing
- Flow Logs
- Monitoring and Auditing
- Tags
- Quotas
-
Best Practices
- Summary on Enterprise Router Best Practices
- Connecting VPCs Across Regions Using Enterprise Router and Central Network
- Using Enterprise Router to Isolate VPCs in the Same Region
- Using a Third-Party Firewall to Protect VPCs Connected by Enterprise Routers
- Enabling an On-Premises Data Center to Access Service VPCs Using an Enterprise Router and Transit VPC
- Setting Up a Hybrid Cloud Network Using Enterprise Router and Direct Connect Global DC Gateway
-
Setting Up a Hybrid Cloud Network Using Enterprise Router and a Pair of Direct Connect Connections (Global DC Gateway)
- Overview
- Network and Resource Planning
- Process of Setting Up a Hybrid Cloud Network Using Enterprise Router and a Pair of Direct Connect Connections (Global DC Gateway)
- Procedure for Setting Up a Hybrid Cloud Network Using Enterprise Router and a Pair of Direct Connect Connections (Global DC Gateway)
-
Setting Up a Hybrid Cloud Network Using Enterprise Router and a Pair of Active/Standby Direct Connect Connections (Global DC Gateway)
- Overview
- Network and Resource Planning
- Process of Setting Up a Hybrid Cloud Network Using Enterprise Router and a Pair of Active/Standby Direct Connect Connections (Global DC Gateway)
- Procedure for Setting Up a Hybrid Cloud Network Using Enterprise Router and a Pair of Active/Standby Direct Connect Connections (Global DC Gateway)
- Setting Up a Hybrid Cloud Network Using Enterprise Router, VPN, and Direct Connect (Global DC Gateway)
- Setting Up a Hybrid Cloud Network Using Enterprise Router and Direct Connect (Virtual Gateway)
- Setting Up a Hybrid Cloud Network Using Enterprise Router and a Pair of Direct Connect Connections (Virtual Gateway)
- Setting Up a Hybrid Cloud Network Using Enterprise Router, VPN, and Direct Connect (Virtual Gateway)
- Allowing VPCs to Share an EIP to Access the Internet Using Enterprise Router and NAT Gateway
- Using Enterprise Router to Migrate the Network Set Up Through VPC Peering
- Using Enterprise Router to Migrate the Network Set Up Through Direct Connect (Global DC Gateway)
- Using Enterprise Router and Central Network to Migrate the Network Set Up Through a Cloud Connection
- API Reference
- FAQs
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Service Overview
- Getting Started
- Enterprise Routers
- Attachments
- Route Tables
- Associations
- Propagations
- Routes
- Sharing
- Flow Logs
- Monitoring
- Interconnecting with CTS
- Permissions Management
- Tags
- Quotas
- FAQ
- Change History
-
User Guide (Ankara Region)
- Service Overview
- Getting Started
- Permissions Management
- Enterprise Routers
- Attachments
- Route Tables
- Associations
- Propagations
- Routes
- Sharing
- Flow Logs
- Monitoring
- Quotas
- FAQ
- Change History
- API Reference (Ankara Region)
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Copied.
Deleting a VPC Attachment
Function
This API is used to delete a VPC attachment.
Constraints
A VPC attachment can only be deleted when it is in the available, deleting, or failed state.
Calling Method
For details, see Calling APIs.
URI
DELETE /v3/{project_id}/enterprise-router/{er_id}/vpc-attachments/{vpc_attachment_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
er_id |
Yes |
String |
Enterprise router ID |
vpc_attachment_id |
Yes |
String |
VPC attachment ID |
Request Parameters
None
Response Parameters
None
Example Requests
Deleting a VPC attachment
DELETE https://{erouter_endpoint}/v3/08d5a9564a704afda6039ae2babbef3c/enterprise-router/4ba931b6-5273-4ed9-8eeb-484d16a4786f/vpc-attachments/b70aee08-c671-4cad-9fd5-7381d163bcc8
Example Responses
None
SDK Sample Code
The SDK sample code is as follows.
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.er.v3.region.ErRegion; import com.huaweicloud.sdk.er.v3.*; import com.huaweicloud.sdk.er.v3.model.*; public class DeleteVpcAttachmentSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); ErClient client = ErClient.newBuilder() .withCredential(auth) .withRegion(ErRegion.valueOf("<YOUR REGION>")) .build(); DeleteVpcAttachmentRequest request = new DeleteVpcAttachmentRequest(); try { DeleteVpcAttachmentResponse response = client.deleteVpcAttachment(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdker.v3.region.er_region import ErRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdker.v3 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = __import__('os').getenv("CLOUD_SDK_AK") sk = __import__('os').getenv("CLOUD_SDK_SK") credentials = BasicCredentials(ak, sk) \ client = ErClient.new_builder() \ .with_credentials(credentials) \ .with_region(ErRegion.value_of("<YOUR REGION>")) \ .build() try: request = DeleteVpcAttachmentRequest() response = client.delete_vpc_attachment(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
Go
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" er "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/er/v3" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/er/v3/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/er/v3/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := er.NewErClient( er.ErClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.DeleteVpcAttachmentRequest{} response, err := client.DeleteVpcAttachment(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
More
For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.
Status Codes
Status Code |
Description |
---|---|
202 |
Accepted |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot