CreateVSwitch
Description
call CreateVSwitch interface to create switch.
Request Method
POST
Request Path
/apsara/route/Vpc/CreateVSwitch
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
Description | BODY | string | No | This is my vswitch. | description information of the switch. The description length is 2 to 256 characters and must start with a letter or Chinese, but cannot be http:// or https://. |
IsCgw | BODY | boolean | No | true | whether it is a user gateway. Value: true: is the user gateway. false: not a user gateway. |
VpcId | BODY | string | Yes | vpc-257gqcdfvx6n**** | VPC ID of the switch to be created. |
ZoneId | BODY | string | Yes | cn-qingdao-env-amtest11001-a | the zone ID to which the switch to be created belongs. You can obtain the zone ID by calling the DescribeZones interface. |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
CidrBlock | BODY | string | Yes | 172.XX.XX.0/24 | the network segment of the switch. The requirements of the switch network segment are as follows: The mask length of the network segment of the switch ranges from 16 to 29 bits. The CIDR block of the VSwitch must belong to the CIDR block of the VPC. The network segment of the switch cannot be the same as the target network segment of the route entry in the VPC, but it can be a subset of the target network segment. |
VSwitchName | BODY | string | No | VSwitch-1 | the name of the switch. The name is 2 to 128 characters in length and must start with a letter or Chinese, but cannot be http:// or https://. |
RegionId | BODY | string | Yes | cn-qingdao-env17-d01 | the region ID of the switch to be created. You can obtain the region ID by calling the DescribeRegions interface. |
Ipv6CidrBlock | BODY | integer | No | 12 | the last 8 bits of the switch IPv6 network segment, value:0~255. |
ClientToken | BODY | string | No | 0c593ea1-3bea-11e9-b96b-88e9fe637760 | Ensure request idempotence. Generate a parameter value from your client to ensure that the parameter value is unique between different requests. ClientToken only supports ASCII characters and cannot exceed 64 characters. |
version | BODY | string | No | 2016-01-01 | version of api |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
RequestID | string | 1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC | Request id |
Example
Successful Response example
{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}