{"base_path":"/","components":null,"consumes":"[\"application/json;charset=UTF-8\"]","definitions":{"AllowedAddressPair":{"description":"","properties":{"ip_address":{"description":"功能说明:IP地址\n取值范围:可以是IP地址或CIDR\n约束:不支持0.0.0.0/0如果allowed_address_pairs配置地址池较大的CIDR(掩码小于24位),建议为该port配置一个单独的安全组。\n如果填写allowed_address_pairs参数,则ip_address是必选参数。","maxLength":255,"minLength":0,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"mac_address":{"description":"mac地址","maxLength":255,"minLength":0,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}},"required":["ip_address"]},"BindingVifDetails":{"description":"","properties":{"ovs_hybrid_plug":{"description":"用于通知像nova这样的API消费者,应该使用OVS的混合插入策略。","type":"boolean","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"port_filter":{"description":"功能说明:表示该网络服务提供端口过滤特性,如安全组和反MAC/IP欺骗。","type":"boolean","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"primary_interface":{"description":"功能说明:取值为true,表示是虚拟机的主网卡。","type":"boolean","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}}},"CreatePortOption":{"description":"","properties":{"admin_state_up":{"description":"功能说明:管理状态\n取值范围:只支持true,默认为true","type":"boolean","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"allowed_address_pairs":{"description":"功能说明:IP/Mac对列表\n约束:IP地址不允许为 “0.0.0.0/0”\n如果配置的地址池较大(CIDR掩码小于24位),建议为该port配置一个单独的安全组。","items":{"$ref":"#/definitions/AllowedAddressPair","description":""},"type":"array","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"device_owner":{"description":"功能说明:端口设备所属\n取值范围:目前只支持指定\"\"和\"neutron:VIP_PORT\";neutron:VIP_PORT表示创建的是VIP","type":"string","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"extra_dhcp_opts":{"description":"功能说明:DHCP的扩展Option(扩展属性)","items":{"$ref":"#/definitions/ExtraDhcpOpt","description":""},"type":"array","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"fixed_ips":{"description":"功能说明:端口IP\n例如:\"fixed_ips\": [{\"subnet_id\": \"4dc70db6-cb7f-4200-9790-a6a910776bba\", \"ip_address\": \"192.169.25.79\"}]\n约束:ipv4场景下一个端口只支持一个fixed_ip,且不支持更新","items":{"$ref":"#/definitions/FixedIp","description":""},"type":"array","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"name":{"description":"功能说明:端口名称\n取值范围:0~255个字符,支持中文、英文、字母、_(下划线)、-(中划线),默认为空","type":"string","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"network_id":{"description":"功能说明:端口所属网络的ID\n约束:必须是存在的网络ID","type":"string","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"security_groups":{"description":"功能说明:安全组的ID列表;例如:\"security_groups\": [\"a0608cbf-d047-4f54-8b28-cd7b59853fff\"]\n取值范围:默认值为系统默认安全组","items":{"description":"","type":"string"},"type":"array","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"tenant_id":{"description":"功能说明:端口所属项目ID","type":"string","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"}},"required":["network_id"]},"CreatePortRequestBody":{"description":"","properties":{"port":{"$ref":"#/definitions/CreatePortOption","description":"端口对象","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"}},"required":["port"]},"DnsAssignMent":{"description":"","properties":{"fqdn":{"description":"端口内网fqdn","type":"string","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"hostname":{"description":"端口hostname","type":"string","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"ip_address":{"description":"端口IP地址","type":"string","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"}}},"ErrorResp":{"description":"http响应码为错误码时的返回体数据模型","properties":{"code":{"description":"请求返回的错误码","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"message":{"description":"请求返回的错误信息","maxLength":999,"minLength":1,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"}},"required":["code","message"]},"ExtraDhcpOpt":{"description":"","properties":{"opt_name":{"description":"Option名称","maxLength":255,"minLength":0,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"opt_value":{"description":"Option值","maxLength":255,"minLength":0,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}}},"FixedIp":{"description":"","properties":{"ip_address":{"description":"功能说明:端口IP地址,如果同时指定子网ID和IP地址,会尝试将该子网上的IP地址分配给该端口。\n如果仅指定子网ID,会将该子网中的可用IP分配给该端口。\n如果仅指定IP地址,会尝试分配IP地址(如果该地址是指定网络上任何子网的有效IP)","example":"192.168.0.24","maxLength":255,"minLength":0,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"subnet_id":{"description":"功能说明:端口所属子网ID,如果同时指定子网ID和IP地址,会尝试将该子网上的IP地址分配给该端口。\n如果仅指定子网ID,会将该子网中的可用IP分配给该端口。\n如果仅指定IP地址,会尝试分配IP地址(如果该地址是指定网络上任何子网的有效IP)","pattern":"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}}},"Port":{"description":"","properties":{"admin_state_up":{"description":"功能说明:管理状态\n约束:只支持true,默认为true","type":"boolean"},"allowed_address_pairs":{"description":"功能说明:IP/Mac对列表\n约束:IP地址不允许为 “0.0.0.0”\n如果配置地址池较大(CIDR掩码小于24位),建议为该port配置一个单独的安全组。","items":{"$ref":"#/definitions/AllowedAddressPair"},"type":"array","x-admin":"False"},"binding:profile":{"description":"功能说明:提供用户设置自定义信息(扩展属性)","type":"object","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"binding:vif_details":{"$ref":"#/definitions/BindingVifDetails","description":"功能说明:vif的详细信息,\"primary_interface\": 是否为虚拟机的主网卡\n约束:管理员权限,普通租户不可指定","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"binding:vnic_type":{"description":"功能说明:绑定的vNIC类型\n取值范围:\n - normal(软交换)\n - direct: SRIOV硬直通(不支持)","type":"string","x-admin":"False","x-internal":"False"},"device_id":{"description":"功能说明:端口所属设备ID\n约束:不支持设置和更新,由系统自动维护","type":"string","x-admin":"False"},"device_owner":{"description":"功能说明:设备所属\n取值范围:合法设备所属,如network:dhcp、neutron:VIP_PORT、network:router_interface_distributed、network:router_centralized_snat\n约束:不支持设置和更新,由系统自动维护","enum":["network:dhcp","neutron:VIP_PORT","network:router_interface_distributed","network:router_centralized_snat"],"type":"string"},"dns_assignment":{"description":"功能说明:主网卡默认内网域名信息\n约束:不支持设置和更新,由系统自动维护","items":{"$ref":"#/definitions/DnsAssignMent","description":""},"type":"array","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"dns_name":{"description":"功能说明:主网卡默认内网DNS名称\n约束:不支持设置和更新,由系统自动维护","type":"string"},"enable_efi":{"description":"功能说明:是否使能efi,使能则表示端口支持vRoCE能力,默认为false","type":"boolean","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk"},"extra_dhcp_opts":{"description":"功能说明:DHCP的扩展Option(扩展属性)","items":{"$ref":"#/definitions/ExtraDhcpOpt"},"type":"array","x-admin":"False"},"fixed_ips":{"description":"功能说明:端口IP\n例如:\"fixed_ips\": [{\"subnet_id\": \"4dc70db6-cb7f-4200-9790-a6a910776bba\", \"ip_address\": \"192.169.25.79\"}]\n约束:一个端口只支持一个fixed_ip,且不支持更新。","items":{"$ref":"#/definitions/FixedIp"},"type":"array","x-admin":"False"},"id":{"description":"端口ID","type":"string"},"instance_id":{"description":"功能说明:端口所属实例ID,例如RDS实例ID\n约束:不支持设置和更新,由系统自动维护","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"instance_type":{"description":"功能说明:端口所属实例类型,例如“RDS”\n约束:不支持设置和更新,由系统自动维护","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"ipv6_bandwidth_id":{"description":"功能说明:IPv6网卡绑定的共享带宽ID\n约束:只有IPv6网卡绑定了共享带宽,才会显示此参数","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"mac_address":{"description":"功能描述:端口MAC地址\n约束:由系统分配,不支持指定","type":"string","x-admin":"False"},"name":{"description":"功能说明:端口名称\n取值范围:0~255个字符,支持中文、英文、字母、_(下划线)、-(中划线)","maxLength":255,"minLength":0,"type":"string","x-admin":"False"},"network_id":{"description":"端口所属网络的ID","type":"string","x-admin":"False"},"port_security_enabled":{"description":"功能说明:端口安全使能标记,如果不使能则安全组和dhcp防欺骗不生效\n取值范围:启用(true)或禁用(false)","type":"boolean","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"security_groups":{"description":"安全组的ID列表","items":{"type":"string"},"type":"array","x-admin":"False"},"status":{"description":"功能说明:端口状态,Hana硬直通虚拟机端口状态总为DOWN\n取值范围:ACTIVE、BUILD、DOWN","enum":["ACTIVE","BUILD","DOWN"],"type":"string","x-admin":"False"},"tenant_id":{"description":"项目ID","type":"string","x-admin":"False"},"zone_id":{"description":"功能说明:port所属的可用分区","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk"}},"required":["admin_state_up","allowed_address_pairs","binding:profile","binding:vif_details","binding:vnic_type","device_id","device_owner","dns_assignment","dns_name","enable_efi","extra_dhcp_opts","fixed_ips","id","instance_id","instance_type","ipv6_bandwidth_id","mac_address","name","network_id","port_security_enabled","security_groups","status","tenant_id","zone_id"]},"PortResponseBody":{"description":"","properties":{"port":{"$ref":"#/definitions/Port","description":"端口对象","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"}},"required":["port"]}},"description":null,"group_id":"4784d190da9948c381c1603ddda2f4ff","host":"vpc.cn-north-4.myhuaweicloud.com","id":"52816df481e74f5c8d290a881226ddf8","info_version":"v2","method":"post","name":"CreatePort","parameters":{},"paths":{"/v1/{project_id}/ports":{"post":{"consumes":[],"deprecated":false,"description":"创建端口。","operationId":"CreatePort","parameters":[{"description":"用户Token。\n获取Token,请参考《统一身份认证服务API参考》的“获取用户Token”章节。请求响应成功后在响应消息头中包含的“X-Subject-Token”的值即为Token值。","in":"header","name":"X-Auth-Token","required":true,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc","x-order":1},{"description":"项目ID","in":"path","name":"project_id","pattern":"[0-9a-fA-F]{32}","required":true,"type":"string","x-order":2},{"description":"创建端口对象","in":"body","name":"port","required":true,"schema":{"$ref":"#/definitions/CreatePortRequestBody"},"x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc","x-order":3}],"produces":[],"responses":{"201":{"description":"正常返回","examples":{"application/json":{"port":{"admin_state_up":"true","allowed_address_pairs":[],"binding:vnic_type":"normal","device_id":"","device_owner":"","dns_name":"","enable_efi":"false","extra_dhcp_opts":[],"fixed_ips":[{"ip_address":"10.128.1.10","subnet_id":"70f2e74b-e660-410a-b754-0ca46744348a"}],"id":"d00f9c13-412f-4855-8af3-de5d8c24cd60","mac_address":"fa:16:3e:d7:f2:6c","name":"test","network_id":"5b808927-13c9-4e60-a4f4-ed6ffe225167","security_groups":["02b4e8ee-74fa-4a31-802e-5490df11245e"],"status":"DOWN","tenant_id":"43f2d1cca56a40729dcb17212482f34d"}}},"schema":{"$ref":"#/definitions/PortResponseBody"}},"400":{"description":"服务器未能处理请求。","schema":{"$ref":"#/definitions/ErrorResp"}},"401":{"description":"被请求的页面需要用户名和密码。","schema":{"$ref":"#/definitions/ErrorResp"}},"403":{"description":"对被请求页面的访问被禁止。","schema":{"$ref":"#/definitions/ErrorResp"}},"404":{"description":"服务器无法找到被请求的页面。","schema":{"$ref":"#/definitions/ErrorResp"}},"409":{"description":"由于冲突,请求无法被完成。","schema":{"$ref":"#/definitions/ErrorResp"}},"500":{"description":"请求未完成。服务异常。","schema":{"$ref":"#/definitions/ErrorResp"}}},"summary":"创建端口","tags":["端口"],"x-apiexplorer-hide":"false","x-constraint":"","x-first-open-time":"2016-07-01","x-hybridcloud":"false","x-is-registered":"Y","x-name":"创建端口","x-open-region-cloud":"hc,hk,hcso","x-order":20,"x-publishpath":"","x-request-examples-1":{"port":{"device_owner":"neutron:VIP_PORT","network_id":"28a1c93c-9a5e-4a9f-813b-e495bdef7d34","security_groups":["f2c5b3fc-b971-4a86-87b9-032586260e3e"]}},"x-request-examples-2":{"port":{"fixed_ips":[{"ip_address":"192.168.0.38","subnet_id":"06bc2359-d75e-4f96-82f4-313e39c7148c"}],"network_id":"28a1c93c-9a5e-4a9f-813b-e495bdef7d34","security_groups":["f2c5b3fc-b971-4a86-87b9-032586260e3e"]}},"x-request-examples-3":{"port":{"network_id":"28a1c93c-9a5e-4a9f-813b-e495bdef7d34","security_groups":["f2c5b3fc-b971-4a86-87b9-032586260e3e"]}},"x-request-examples-description-1":"创建VIP","x-request-examples-description-2":"指定IP创建端口","x-request-examples-description-3":"自动分配IP创建端口","x-request-examples-text-1":"{\n \"port\": {\n \"network_id\": \"28a1c93c-9a5e-4a9f-813b-e495bdef7d34\",\n \"device_owner\": \"neutron:VIP_PORT\",\n \"security_groups\": [\n \"f2c5b3fc-b971-4a86-87b9-032586260e3e\"\n ]\n }\n}","x-request-examples-text-2":"{\n \"port\": {\n \"fixed_ips\": [\n {\n \"ip_address\": \"192.168.0.38\",\n \"subnet_id\": \"06bc2359-d75e-4f96-82f4-313e39c7148c\"\n }\n ],\n \"network_id\": \"28a1c93c-9a5e-4a9f-813b-e495bdef7d34\",\n \"security_groups\": [\n \"f2c5b3fc-b971-4a86-87b9-032586260e3e\"\n ]\n }\n}","x-request-examples-text-3":"{\n \"port\": {\n \"network_id\": \"28a1c93c-9a5e-4a9f-813b-e495bdef7d34\",\n \"security_groups\": [\n \"f2c5b3fc-b971-4a86-87b9-032586260e3e\"\n ]\n }\n}","x-request-examples-url-1":"POST https://{Endpoint}/v1/{project_id}/ports","x-request-examples-url-2":"POST https://{Endpoint}/v1/{project_id}/ports","x-request-examples-url-3":"POST https://{Endpoint}/v1/{project_id}/ports","x-scope":"Commercial","x-source":"SelfDeveloped","x-support-sdk":"Y","x-version":"v1"}}},"product_short":"VPC","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"创建端口","tags":"端口","uri":null,"version":"2.0"}