Last updated: 2020-06-04 17:52:44


This is a legacy API which has been hidden and will no longer be updated. We recommend using the new VPC API 3.0 which is standardized and faster.

This document provides an exmple of creating a VPC.

Before creating a VPC, you should have a plan about your CIDR block. Once a VPC is created, its cidrBlock cannot be changed. For other details about creating a VPC, please see the related document.

To create a VPC, the Action field in common request parameter should be CreateVpc. The API request parameters include:

Parameter Description Value
vpcName VPC name 1-60 letters (upper-/lower-case), numbers and underlines
cidrBlock VPC CIDR block VPC IP address range. It can be,, and their subnets. For details, please see VPC network segment planning introduction.
subnetSet.n Subnet array Optional
subnetSet.n.subnetName Subnet name 1-60 letters (upper-/lower-case), numbers and underlines
subnetSet.n.cidrBlock Subnet segment The subnet segment must be within the VPC network segment
subnetSet.n.zoneId ID of availability zone Refer to the introduction of availability zone

The final request should be:

  &<Common request parameters>

Result of the above request is as below, indicating that the ID of new created VPC is vpc-2ari9m7h.

    "code": 0,
    "message": "",
    "vpcId": "gz_vpc_266",
    "uniqVpcId": "vpc-2ari9m7h",
    "vpcCreateTime": "2015-11-06 11:33:52",
    "subnetSet": [
            "subnetId": "gz_subnet_18720",
            "unSubnetId": "subnet-5gu2jxf4",
            "routeTableId": "gz_rtb_8751",
            "subnetName": "wikitest",
            "cidrBlock": "",
            "zoneId": 800001
    "routeTableSet": [
            "routeTableId": "gz_rtb_8751",
            "routeTableType": 1,
            "routeTableName": "Default"

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback