VPC Related Operations
Updated at:2025-10-16
Create VPC
Description:
Launch a VPC instance.
Command format:
Plain Text
1$ bce vpc create-vpc <name> <cidr> [-des DESCRIPTION]
Description:
- Name: The VPC name cannot be set to "default". The name must be no longer than 65 characters and can include numbers, letters, and underscores.
- cidr: The CIDR block for the VPC.
- \-des DESCRIPTION, --description DESCRIPTION: Description of the VPC, up to 200 characters.
Operation example:
Plain Text
1$ bce vpc create-vpc test-name 192.168.0.0/16 -des test-description
Response example:
Plain Text
1{
2 “vpc_id”: “vpc-2mdntsz0jbki”
3}
| Parameter name | Types | Description |
|---|---|---|
| vpc_id | String | ID of the created VPC |
Query VPC list
Description:
Query information about the VPC list.
Command format:
Plain Text
1$ bce vpc list-vpc [-a] [-mkr MARKER] [-mky MAX_KEYS] [-isd {True,False}]
Description:
- -mkr MARKER, --marker MARKER: The starting position for batch retrieval queries, represented by a system-generated string
- \-mky MAX_KEYS, --max_keys MAX_KEYS: Maximum number of VPCs displayed per page. The upper limit is generally 1000, and the default value is 1000.
- \-isd {True,False}, --is_default {True,False}: Indicates whether the VPC is the default one. Options: True, False. If this parameter is omitted, all VPCs will be listed.
- -a, --all: Returns all VPCs
Operation example:
Plain Text
1$ bce vpc list-vpc
Response example:
Plain Text
1{
2 “marker”: null,
3 “max_keys”: 1000,
4 “vpcs”: [
5 {
6 “is_default”: false,
7 “vpc_id”: “vpc-2mdntsz0jbki”,
8 “cidr”: “192.168.0.0/16”,
9 “name”: “test-name”,
10 “description”: “test-description”
11 },
12 {
13 “is_default”: true,
14 “vpc_id”: “vpc-suzek0b5vi4r”,
15 “cidr”: “192.168.0.0/16”,
16 "name": "Default virtual private cloud",
17 “description”: “default”
18 }
19 ],
20 “is_truncated”: false
21}
| Parameter name | Types | Description |
|---|---|---|
| marker | String | Mark the starting position of the query. |
| is_truncated | boolean | true indicates there is more data later, false indicates it is the last page |
| nextMarker | String | The marker value needed to fetch the next page. This field is absent when isTruncated is false. |
| max_keys | int | Maximum number of items included per page |
| vpcs | List\<[Vpc](VPC/API Reference/Appendix.md#Vpc)> | List of VPCs |
Query specified VPC
Description:
Launch a VPC instance.
Command format:
Plain Text
1$ bce vpc show-vpc <vpc_id>
Operation example:
Plain Text
1$ bce vpc show-vpc vpc-2mdntsz0jbki
Response example:
Plain Text
1$ bce vpc show-vpc vpc-2mdntsz0jbki
2{
3 “vpc”: {
4 “is_default”: false,
5 “subnets”: [],
6 “description”: “test-description”,
7 “vpc_id”: “vpc-2mdntsz0jbki”,
8 “cidr”: “192.168.0.0/16”,
9 “name”: “test-name”
10 }
11}
| Parameter name | Types | Description |
|---|---|---|
| vpc | [ShowVpcModel](VPC/API Reference/Appendix.md#ShowVpcModel) | VPC entity |
Delete VPC
Description: Remove a VPC instance.
Command format:
Plain Text
1$ bce vpc delete-vpc <vpc_id>
Operation example:
Plain Text
1$ bce vpc delete-vpc vpc-f284wyd8ema8
Response example:
Plain Text
1{}
There are no special response parameters
Update VPC
Description:
Modify the VPC details.
Command format:
Plain Text
1$ bce vpc update-vpc <vpc_id> <name> [-des DESCRIPTION]
Description:
- vpc_id: The ID of the VPC.
- The VPC name must not be "default," should not exceed 65 characters, and can only consist of numbers, letters, and underscores.
- \-des DESCRIPTION, --description DESCRIPTION: The VPC description must not exceed 200 characters.
Operation example:
Plain Text
1$ bce vpc update-vpc vpc-2mdntsz0jbki update-name -des update-description
Response example:
Plain Text
1{}
There are no special response parameters
