Creating an Enterprise Switch
Function
This API is used to create an enterprise switch. This is an asynchronous API. After the request for creating an enterprise switch is delivered, the job ID and instance ID are returned. You need to call the API for querying the job status to query the job execution status.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
esw:instance:create |
Write |
- |
- |
- |
- |
URI
POST /v3/{project_id}/l2cg/instances
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
|
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
instance |
Yes |
CreatePostpaidInstanceOption object |
|
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
availability_zones |
Yes |
AvailabilityZones object |
|
|
charge_infos |
Yes |
PostPaidChargeInfos object |
|
|
flavor_ref |
Yes |
String |
|
|
ha_mode |
Yes |
String |
|
|
name |
Yes |
String |
|
|
tunnel_info |
Yes |
TunnelInfoOption object |
|
|
description |
No |
String |
|
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
primary |
Yes |
String |
|
|
standby |
Yes |
String |
|
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
charge_mode |
Yes |
String |
|
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
vpc_id |
Yes |
String |
|
|
virsubnet_id |
Yes |
String |
|
|
tunnel_ip |
No |
String |
|
Response Parameters
Status code: 201
|
Parameter |
Type |
Description |
|---|---|---|
|
request_id |
String |
|
|
instance |
Instance object |
|
|
job_id |
String |
|
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
|
|
name |
String |
|
|
project_id |
String |
|
|
region |
String |
|
|
flavor_ref |
String |
|
|
ha_mode |
String |
|
|
status |
String |
|
|
created_at |
String |
|
|
updated_at |
String |
|
|
description |
String |
|
|
tunnel_info |
TunnelInfoResult object |
|
|
charge_infos |
PostPaidChargeInfos object |
|
|
availability_zones |
AvailabilityZones object |
|
|
Parameter |
Type |
Description |
|---|---|---|
|
vpc_id |
String |
|
|
virsubnet_id |
String |
|
|
tunnel_ip |
String |
|
|
tunnel_port |
Integer |
|
|
tunnel_type |
String |
|
|
Parameter |
Type |
Description |
|---|---|---|
|
charge_mode |
String |
|
|
Parameter |
Type |
Description |
|---|---|---|
|
primary |
String |
|
|
standby |
String |
|
Example Requests
POST https://{endpoint}/v3/b2782e6708b8475c993e6064bc456bf8/l2cg/instances
{
"instance" : {
"availability_zones" : {
"primary" : "az1",
"standby" : "az2"
},
"charge_infos" : {
"charge_mode" : "postPaid"
},
"flavor_ref" : "l2cg.small.ha",
"ha_mode" : "ha",
"name" : "esw-88d4",
"tunnel_info" : {
"vpc_id" : "6ae030de-f630-476e-8284-7bcfbd94929d",
"virsubnet_id" : "6c32956f-eb3a-4521-8b83-d5a2d5f9b978"
},
"description" : ""
}
}
Example Responses
Status code: 201
The POST operation is successful. For more status codes, see Status Codes.
{
"request_id" : "2f1bdab599c96eb0b47a5e99ba9574bb",
"job_id" : "9bd12abc-17ba-4e40-9484-f4e97ee7ff59",
"instance" : {
"name" : "esw-88d4",
"id" : "87fea8df-3e0d-473a-a1bd-e6a76157f4ce",
"region" : "cn-north-213",
"status" : "build",
"description" : null,
"created_at" : "2025-07-28T03:45:05Z",
"updated_at" : "2025-07-28T03:45:05Z",
"project_id" : "dd9e484e058b48e18b820948dcbd480e",
"flavor_ref" : "l2cg.small.ha",
"ha_mode" : "ha",
"availability_zones" : {
"standby" : "az1",
"primary" : "az2"
},
"charge_infos" : {
"charge_mode" : "postPaid"
},
"tunnel_info" : {
"vpc_id" : "6ae030de-f630-476e-8284-7bcfbd94929d",
"virsubnet_id" : "6c32956f-eb3a-4521-8b83-d5a2d5f9b978",
"tunnel_ip" : "192.168.7.95",
"tunnel_port" : 4789,
"tunnel_type" : "vxlan"
}
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
The POST operation is successful. For more status codes, see Status Codes. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot