百度智能云

All Product Document

          Virtual Private Cloud

          VPC Related Operations

          Create VPC

          Description

          Create a VPC instance.

          Command Format

          $ bce vpc create-vpc <name> <cidr> [-des DESCRIPTION] 

          Note:

          • Name: the VPC name cannot take the "default" value, with the length not exceeding 65 characters, and can be composed by numbers, characters and underlines.
          • cidr: cidr of VPC.
          • -des DESCRIPTION, --description DESCRIPTION: VPC description, not exceeding 200 characters.

          Example for Operation

          $ bce vpc create-vpc test-name 192.168.0.0/16 -des test-description

          Example for Return

          {
              "vpc_id": "vpc-2mdntsz0jbki"
          }
          Parameter name Type Description
          vpc_id String Create id of VPC

          Query VPC List

          Description

          Query the VPC list information.

          Command Format

          $ bce vpc list-vpc [-a] [-mkr MARKER] [-mky MAX_KEYS] [-isd {True,False}]

          Note:

          • -mkr MARKER, --marker MARKER: The starting location of query for batch acquisition of lists, and is one string generated by the system.
          • -mky MAX_KEYS, --max_keys MAX_KEYS : The maximum VPC quantity contained in each page. The maximum quantity usually does not exceed 1000. The default is 1000.
          • -isd {True,False}, --is_default {True,False}: Default VPC? true: Yes, optional values: True, False; return all VPCs when this parameter is not filled in.
          • -a, --all: Return all VPCs.

          Example for Operation:

          $ bce vpc list-vpc

          Example for Return:

          {
              "marker": null,
              "max_keys": 1000,
              "vpcs": [
                  {
                      "is_default": false,
                      "vpc_id": "vpc-2mdntsz0jbki",
                      "cidr": "192.168.0.0/16",
                      "name": "test-name",
                      "description": "test-description"
                  },
                  {
                      "is_default": true,
                      "vpc_id": "vpc-suzek0b5vi4r",
                      "cidr": "192.168.0.0/16",
                      "name": "default private network", 
                      "description": "default"
                  }
              ],
              "is_truncated": false
          }
          Parameter name Type Description
          marker String It marks the queried starting position.
          is_truncated boolean True means there are additional data in the following pages and false means the current page is the last page.
          nextMarker String The marker value requiring to be passed in order to acquire the next page. The domain doesn't appear when isTruncated is false.
          max_keys int Maximum number contained in each page.
          vpcs List\<Vpc> VPC list

          Query Specified VPC

          Description

          Create a VPC instance.

          Command Format

          $ bce vpc show-vpc <vpc_id>

          Example for Operation

          $ bce vpc show-vpc vpc-2mdntsz0jbki

          Example for Return

          $ bce vpc show-vpc vpc-2mdntsz0jbki
          {
              "vpc": {
                  "is_default": false,
                  "subnets": [],
                  "description": "test-description",
                  "vpc_id": "vpc-2mdntsz0jbki",
                  "cidr": "192.168.0.0/16",
                  "name": "test-name"
              }
          }
          Parameter name Type Description
          vpc ShowVpcModel VPC entity

          Delete VPC

          Description

          Delete a VPC instance.

          Command Format

          $ bce vpc delete-vpc <vpc_id>

          Example for Operation

          $ bce vpc delete-vpc vpc-f284wyd8ema8

          Example for Return

          {}

          No special return parameters

          Update VPC

          Description

          Update the VPC information.

          Command Format

          $ bce vpc update-vpc <vpc_id> <name> [-des DESCRIPTION]

          Note:

          • vpc_id: id of vpc.
          • Name: the VPC name cannot take the "default" value, with the length not exceeding 65 characters, and can be composed by numbers, characters and underlines.
          • -des DESCRIPTION, --description DESCRIPTION: VPC description, not exceeding 200 characters.

          Example for Operation

          $ bce vpc update-vpc vpc-2mdntsz0jbki update-name -des update-description

          Example for Return

          {}

          No special return parameters

          Previous
          Use VPC Services by CLI
          Next
          Subnet Related Operations