Skip to main content

CreateVSwitch

Description

call CreateVSwitch interface to create switch.

Request Method

POST

Request Path

/apsara/route/Vpc/CreateVSwitch

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
DescriptionBODYstringNoThis 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://.
IsCgwBODYbooleanNotruewhether it is a user gateway. Value: true: is the user gateway. false: not a user gateway.
VpcIdBODYstringYesvpc-257gqcdfvx6n****VPC ID of the switch to be created.
ZoneIdBODYstringYescn-qingdao-env-amtest11001-athe zone ID to which the switch to be created belongs. You can obtain the zone ID by calling the DescribeZones interface.
regionIdBODYstringYesNo sample value for this parameter.region id
CidrBlockBODYstringYes172.XX.XX.0/24the 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.
VSwitchNameBODYstringNoVSwitch-1the 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://.
RegionIdBODYstringYescn-qingdao-env17-d01the region ID of the switch to be created. You can obtain the region ID by calling the DescribeRegions interface.
Ipv6CidrBlockBODYintegerNo12the last 8 bits of the switch IPv6 network segment, value:0~255.
ClientTokenBODYstringNo0c593ea1-3bea-11e9-b96b-88e9fe637760Ensure 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.
versionBODYstringNo2016-01-01version of api

Return data

NameTypeSample valueDescription
RequestIDstring1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DCRequest id

Example

Successful Response example

{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}