{"base_path":null,"components":null,"consumes":"[\"application/json\"]","definitions":{"AvailabilityZones":{"properties":{"primary":{"description":"- 参数解释:ESW实例默认主节点所在的可用区。\n- 约束限制:1-128字符。\n- 取值范围:当前区域可用区id。\n- 默认取值:不涉及。","example":"az1","type":"string"},"standby":{"description":"- 参数解释:ESW实例默认备节点所在的可用区。\n- 约束限制:1-128字符。\n- 取值范围:当前区域可用区id。\n- 默认取值:不涉及。","example":"az2","type":"string"}},"required":["primary","standby"],"type":"object"},"CreatePostPaidInstanceRequestBody":{"properties":{"instance":{"$ref":"#/definitions/CreatePostpaidInstanceOption","description":"- 参数解释:创建实例的请求体。\n- 约束限制:不涉及。\n- 取值范围:不涉及。\n- 默认取值:不涉及。"}},"required":["instance"],"type":"object"},"CreatePostPaidInstanceResponseBody":{"properties":{"instance":{"$ref":"#/definitions/Instance","description":"- 参数解释:创建实例的响应体。\n- 约束限制:不涉及。\n- 取值范围:不涉及。\n- 默认取值:不涉及。"},"job_id":{"description":"- 参数解释:任务的唯一标识。\n- 约束限制:带“-”的UUID格式。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"},"request_id":{"description":"- 参数解释:请求的唯一标识。\n- 约束限制:UUID格式。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"}},"required":["instance","job_id","request_id"],"type":"object"},"CreatePostpaidInstanceOption":{"properties":{"availability_zones":{"$ref":"#/definitions/AvailabilityZones","description":"- 参数解释:ESW实例节点所在的可用区。\n- 约束限制:不涉及。\n- 取值范围:当前区域可用区。\n- 默认取值:不涉及。"},"charge_infos":{"$ref":"#/definitions/PostPaidChargeInfos","description":"- 参数解释:计费信息。\n- 约束限制:不涉及。\n- 取值范围:不涉及。\n- 默认取值:不涉及。"},"description":{"description":"- 参数解释:ESW实例描述信息。\n- 约束限制:\n - 长度范围为0~255个字符。\n - 不能包含“<”和“>”。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"},"flavor_ref":{"description":"- 参数解释:ESW实例规格。\n- 约束限制:不涉及。\n- 取值范围:参考flavor list接口响应。\n- 默认取值:不涉及。","example":"l2cg.small.ha","type":"string"},"ha_mode":{"description":"- 参数解释:ESW实例的高可用模式。\n- 约束限制:当前只支持设置ha。\n- 取值范围:ha。\n- 默认取值:不涉及。","example":"ha","type":"string"},"name":{"description":"- 参数解释:ESW实例名称。\n- 约束限制:\n - 长度范围为1~64个字符。\n - 名称由中文、英文字母、数字、下划线(_)、中划线(-)、点(.)组成。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","example":"1234","type":"string"},"tunnel_info":{"$ref":"#/definitions/TunnelInfoOption","description":"- 参数解释:本端隧道信息。\n- 约束限制:不涉及。\n- 取值范围:不涉及。\n- 默认取值:不涉及。"}},"required":["availability_zones","charge_infos","flavor_ref","ha_mode","name","tunnel_info"],"type":"object"},"Instance":{"properties":{"availability_zones":{"$ref":"#/definitions/AvailabilityZones","description":"- 参数解释:ESW实例节点所在的可用区。\n- 约束限制:不涉及。\n- 取值范围:当前区域可用区。\n- 默认取值:不涉及。"},"charge_infos":{"$ref":"#/definitions/PostPaidChargeInfos","description":"- 参数解释:计费信息。\n- 约束限制:不涉及。\n- 取值范围:不涉及。\n- 默认取值:不涉及。"},"created_at":{"description":"- 参数解释:ESW实例创建时间。\n- 约束限制:UTC时间,格式为yyyy-MM-ddTHH:mm:ss。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","format":"date-time","type":"string"},"description":{"description":"- 参数解释:ESW实例描述信息。\n- 约束限制:\n - 长度范围为0~255个字符。\n - 不能包含“<”和“>”。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"},"flavor_ref":{"description":"- 参数解释:ESW实例规格。\n- 约束限制:不涉及。\n- 取值范围:参考flavor list接口响应。\n- 默认取值:不涉及。","example":"l2cg.small.ha","type":"string"},"ha_mode":{"description":"- 参数解释:ESW实例的高可用模式。\n- 约束限制:当前只支持设置ha。\n- 取值范围:ha。\n- 默认取值:不涉及。","example":"ha","type":"string"},"id":{"description":"- 参数解释:ESW实例的唯一标识。\n- 约束限制:带“-”的UUID格式。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"},"name":{"description":"- 参数解释:ESW实例名称。\n- 约束限制:\n - 长度范围为1~64个字符。\n - 名称由中文、英文字母、数字、下划线(_)、中划线(-)、点(.)组成。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","example":"1234","type":"string"},"project_id":{"description":"- 参数解释:ESW实例所属项目ID。\n- 约束限制:不涉及。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"},"region":{"description":"- 参数解释:ESW实例所属region的ID。\n- 约束限制:不涉及。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"},"status":{"description":"- 参数解释:ESW实例的状态。\n- 约束限制:不涉及。\n- 取值范围:\n - active:运行中\n - failed:创建失败\n - abnormal:异常\n - build:创建中\n - frozen:已冻结\n- 默认取值:不涉及。","type":"string"},"tunnel_info":{"$ref":"#/definitions/TunnelInfoResult","description":"- 参数解释:本端隧道信息。\n- 约束限制:不涉及。\n- 取值范围:不涉及。\n- 默认取值:不涉及。"},"updated_at":{"description":"- 参数解释:ESW实例更新时间。\n- 约束限制:UTC时间,格式为yyyy-MM-ddTHH:mm:ss。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","format":"date-time","type":"string"}},"required":["availability_zones","charge_infos","created_at","description","flavor_ref","ha_mode","id","name","project_id","region","status","tunnel_info","updated_at"],"type":"object"},"PostPaidChargeInfos":{"description":"支付信息","properties":{"charge_mode":{"description":"- 参数解释:付费方式(后付费,即按需付费)。\n- 约束限制:不涉及。\n- 取值范围:postPaid,后付费,即按需付费。\n- 默认取值:不涉及。","type":"string"}},"required":["charge_mode"],"type":"object"},"TunnelInfoOption":{"properties":{"tunnel_ip":{"description":"- 参数解释:ESW的隧道IP。\n- 约束限制:不能与已存在的子网IP冲突。\n- 取值范围:标准的IPv4格式,例:192.168.1.1。\n- 默认取值:不涉及。","type":"string"},"virsubnet_id":{"description":"- 参数解释:ESW所在隧道子网ID。\n- 约束限制:\n - 需要使用本租户下可操作的子网资源的ID;此值即为子网详情中的“网络ID”参数值。\n - 带“-”的UUID格式。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"},"vpc_id":{"description":"- 参数解释:ESW所在VPC资源ID。\n- 约束限制:\n - 需要使用本租户下可操作的VPC资源的ID。\n - 带“-”的UUID格式。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"}},"required":["virsubnet_id","vpc_id"],"type":"object"},"TunnelInfoResult":{"properties":{"tunnel_ip":{"description":"- 参数解释:ESW实例的本端隧道IP。\n- 约束限制:不能与已存在的子网IP冲突。\n- 取值范围:标准的IPv4格式,例:192.168.1.1。\n- 默认取值:不涉及。","type":"string"},"tunnel_port":{"description":"- 参数解释:ESW实例的隧道端口。\n- 约束限制:不涉及。\n- 取值范围:4789。\n- 默认取值:不涉及。","format":"int32","type":"integer"},"tunnel_type":{"description":"- 参数解释:ESW实例的隧道协议类型。\n- 约束限制:不涉及。\n- 取值范围:vxlan。\n- 默认取值:不涉及。","type":"string"},"virsubnet_id":{"description":"- 参数解释:ESW所在隧道子网ID。\n- 约束限制:\n - 需要使用本租户下可操作的子网资源的ID;此值即为子网详情中的“网络ID”参数值。\n - 带“-”的UUID格式。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"},"vpc_id":{"description":"- 参数解释:ESW所在VPC资源ID。\n- 约束限制:\n - 需要使用本租户下可操作的VPC资源的ID。\n - 带“-”的UUID格式。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","type":"string"}},"required":["tunnel_ip","tunnel_port","tunnel_type","virsubnet_id","vpc_id"],"type":"object"}},"description":null,"group_id":"85bc4f8eac384af6b052b0374dba3eac","host":"esw.cn-north-4.myhuaweicloud.com","id":"42906a317a894054ba2a9898b592f74a","info_version":"v1","method":"post","name":"CreateInstance","parameters":{},"paths":{"/v3/{project_id}/l2cg/instances":{"post":{"description":"您可通过调用本接口创建一个ESW实例。该接口是一个异步接口,当前创建ESW实例的请求下发成功后,会响应job_id以及实例ID等信息,需要通过[调用查询任务的执行状态查询job状态](ListResourceJobs.xml)。","operationId":"CreateInstance","parameters":[{"description":"- 参数解释:ESW实例所属项目ID。\n- 约束限制:不涉及。\n- 取值范围:不涉及。\n- 默认取值:不涉及。","in":"path","name":"project_id","required":true,"type":"string","x-order":1},{"in":"body","name":"CreateInstanceRequestBody","required":true,"schema":{"$ref":"#/definitions/CreatePostPaidInstanceRequestBody"}}],"produces":["application/json"],"responses":{"201":{"description":"POST操作正常返回,更多状态码请参见[状态码](esw_api0020.xml)。","examples":{"application/json":{"instance":{"availability_zones":{"primary":"az2","standby":"az1"},"charge_infos":{"charge_mode":"postPaid"},"created_at":"2025-07-28T03:45:05Z","flavor_ref":"l2cg.small.ha","ha_mode":"ha","id":"87fea8df-3e0d-473a-a1bd-e6a76157f4ce","name":"esw-88d4","project_id":"dd9e484e058b48e18b820948dcbd480e","region":"cn-north-213","status":"build","tunnel_info":{"tunnel_ip":"192.168.7.95","tunnel_port":4789,"tunnel_type":"vxlan","virsubnet_id":"6c32956f-eb3a-4521-8b83-d5a2d5f9b978","vpc_id":"6ae030de-f630-476e-8284-7bcfbd94929d"},"updated_at":"2025-07-28T03:45:05Z"},"job_id":"9bd12abc-17ba-4e40-9484-f4e97ee7ff59","request_id":"2f1bdab599c96eb0b47a5e99ba9574bb"}},"schema":{"$ref":"#/definitions/CreatePostPaidInstanceResponseBody"}}},"summary":"创建ESW实例","tags":["企业交换机"],"x-api-type":"open-api","x-apiexplorer-hide":"false","x-first-open-time":"","x-hybridcloud":"false","x-is-registered":"Y","x-name":"createInstance","x-open-region-cloud":"hws,hws_hk,hws_test,hws_eu,dt,dt_test","x-order":0,"x-publishpath":"","x-request-examples-1":{"instance":{"availability_zones":{"primary":"az1","standby":"az2"},"charge_infos":{"charge_mode":"postPaid"},"description":"","flavor_ref":"l2cg.small.ha","ha_mode":"ha","name":"esw-88d4","tunnel_info":{"virsubnet_id":"6c32956f-eb3a-4521-8b83-d5a2d5f9b978","vpc_id":"6ae030de-f630-476e-8284-7bcfbd94929d"}}},"x-request-examples-text-1":{"instance":{"availability_zones":{"primary":"az1","standby":"az2"},"charge_infos":{"charge_mode":"postPaid"},"description":"","flavor_ref":"l2cg.small.ha","ha_mode":"ha","name":"esw-88d4","tunnel_info":{"virsubnet_id":"6c32956f-eb3a-4521-8b83-d5a2d5f9b978","vpc_id":"6ae030de-f630-476e-8284-7bcfbd94929d"}}},"x-request-examples-url-1":"POST https://{endpoint}/v3/b2782e6708b8475c993e6064bc456bf8/l2cg/instances","x-scope":"Commercial","x-source":"SelfDeveloped","x-support-sdk":"Y"}}},"product_short":"ESW","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"创建ESW实例","tags":"企业交换机","uri":null,"version":"2.0"}