{"base_path":"/","components":null,"consumes":"[\"application/json;charset=UTF-8\"]","definitions":{"AllocationPool":{"description":"","properties":{"end":{"description":"网络池结束IP","maxLength":64,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"start":{"description":"网络池起始IP","maxLength":64,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}}},"HostRoute":{"description":"","properties":{"destination":{"description":"路由目的子网","maxLength":64,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"nexthop":{"description":"路由下一跳IP","maxLength":64,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}}},"NeutronCreateSubnetOption":{"description":"","properties":{"allocation_pools":{"description":"功能说明:可用的IP池,allocation_pool对象参见allocation_pool对象\n例如:[ { \"start\": \"10.0.0.2\", \"end\": \"10.0.0.251\"} ]每个子网的第1个和最后4个IP地址为系统保留地址。以192.168.1.0/24为例,192.168.1.0、 192.168.1.252、192.168.1.253、192.168.1.254和192.168.1.255这些地址是系统保留地址。系统预留地址默认不在allocation_pool范围内。\n约束:更新时allocation_pool范围不能包含网关和广播地址的所有IP。","items":{"$ref":"#/definitions/AllocationPool"},"type":"array","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"cidr":{"description":"功能说明:子网网段\n取值范围:必须是cidr格式,只支持10.0.0.0/8,172.16.0.0/12,192.168.0.0/16三个网段内的地址,掩码长度不能大于28","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"dns_nameservers":{"description":"功能说明:子网关联的DNS名称服务器列表\n取值范围:IP地址格式例如:\"dns_nameservers\": [\"8.xx.xx.8\",\"8.xx.xx.4\"]\n默认值:不填时为空,无法使用云内网DNS功能\n[内网DNS地址请参见](https://support.huaweicloud.com/dns_faq/dns_faq_002.html)\n[通过API获取请参见](https://support.huaweicloud.com/api-dns/dns_api_69001.html)","items":{"description":"","type":"string"},"type":"array","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"enable_dhcp":{"default":true,"description":"功能说明:是否启动dhcp,false表示不提供dhcp服务的能力\n约束:只支持true","type":"boolean","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"gateway_ip":{"description":"功能说明:子网网关\n取值范围:子网网段中的IP地址\n约束:必须是ip格式","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"host_routes":{"description":"功能说明:虚拟机静态路由,参见“host_route对象”表\n约束:不支持设置","items":{"$ref":"#/definitions/HostRoute","description":""},"type":"array","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"ip_version":{"description":"功能说明:IP版本信息\n取值范围:4或者6(特定局点)","format":"int32","type":"integer","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"ipv6_address_mode":{"default":"dhcpv6-stateful","description":"功能说明:IPv6寻址模式\n取值范围:dhcpv6-stateful","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"ipv6_ra_mode":{"default":"dhcpv6-stateful","description":"功能说明:IPv6路由广播模式\n取值范围:dhcpv6-stateful","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"name":{"description":"功能说明:子网的名称\n取值范围:0-255个字符","maxLength":64,"minLength":1,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"network_id":{"description":"功能说明:子网所属网络ID","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"}},"required":["cidr","network_id"]},"NeutronCreateSubnetRequestBody":{"description":"","properties":{"subnet":{"$ref":"#/definitions/NeutronCreateSubnetOption","description":"subnet对象","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"}},"required":["subnet"]},"NeutronErrorBody":{"description":"","properties":{"detail":{"description":"错误请求返回的错误详情","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"message":{"description":"错误请求返回的错误信息","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"type":{"description":"错误请求返回的错误类型","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}},"required":["detail","message","type"]},"NeutronErrorResponseBody":{"description":"","properties":{"NeutronError":{"$ref":"#/definitions/NeutronErrorBody","description":"错误信息返回体","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}},"required":["NeutronError"]},"NeutronSubnet":{"description":"","properties":{"allocation_pools":{"description":"功能说明:可用的IP池,allocation_pool对象参见 allocation_pool对象\n例如:[ { \"start\": \"10.0.0.2\", \"end\": \"10.0.0.251\"} ]每个子网的第1个和最后4个IP地址为系统保留地址。以192.168.1.0/24为例,192.168.1.0、 192.168.1.252、192.168.1.253、192.168.1.254和192.168.1.255这些地址是系统保留地址。系统预留地址默认不在allocation_pool范围内\n约束:更新时allocation_pool范围不能包含网关和广播地址的所有IP。","items":{"$ref":"#/definitions/AllocationPool"},"type":"array","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"cidr":{"description":"功能说明:子网网段\n取值范围:CIDR格式,只支持10.0.0.0/8,172.16.0.0/12,192.168.0.0/16三个网段内的地址,掩码长度不能大于28\n约束:当ip_version=6时,该字段不支持设置","maxLength":64,"type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"created_at":{"description":"功能说明:资源创建UTC时间\n格式:yyyy-MM-ddTHH:mm:ss","format":"date-time","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"dns_nameservers":{"description":"功能说明:子网关联的DNS名称服务器列表\n取值范围:IP地址格式例如:\"dns_nameservers\": [\"8.xx.xx.8\",\"8.xx.xx.4\"];\n默认值:不填时为空,无法使用云内网DNS功能","items":{"description":"","type":"string"},"type":"array","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"enable_dhcp":{"description":"功能说明:是否启动dhcp\n取值范围:只支持true","type":"boolean","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"gateway_ip":{"description":"功能说明:子网网关IP \n取值范围:本子网网段内的可用IP \n约束:不允许和allocation_pools地址块冲突;ip_version=6时该字段不支持设置\n默认值:本子网网段内第一个可用IP","maxLength":64,"type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"host_routes":{"description":"虚拟机静态路由,参见“host_route对象”表","items":{"$ref":"#/definitions/HostRoute"},"type":"array","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"id":{"description":"子网ID","type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"ip_version":{"description":"功能说明:IP协议版本\n取值范围:4或6(支持后)","format":"int32","type":"integer","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"ipv6_address_mode":{"description":"功能说明:IPv6寻址模式\n取值范围:dhcpv6-stateful","type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"ipv6_ra_mode":{"description":"功能说明:IPv6路由广播模式\n取值范围:dhcpv6-stateful","type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"name":{"description":"功能说明:子网的名称\n取值范围:0-255个字符","maxLength":255,"minLength":0,"type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"network_id":{"description":"所属网络的ID","type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"project_id":{"description":"项目ID","maxLength":64,"type":"string","x-admin":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"subnetpool_id":{"description":"子网池id\n【使用说明】目前IPv4不支持,IPv6支持","type":"string","x-open-region-cloud":"hc,otc,hcso_dt"},"tenant_id":{"description":"项目ID","maxLength":255,"type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"updated_at":{"description":"功能说明:资源更新UTC时间\n格式:yyyy-MM-ddTHH:mm:ss","format":"date-time","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc"}},"required":["allocation_pools","cidr","created_at","dns_nameservers","enable_dhcp","gateway_ip","host_routes","id","ip_version","ipv6_address_mode","ipv6_ra_mode","name","network_id","project_id","tenant_id","updated_at"]},"NeutronSubnetResponseBody":{"description":"","properties":{"subnet":{"$ref":"#/definitions/NeutronSubnet","description":"subnet对象","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}},"required":["subnet"]}},"description":null,"group_id":"4784d190da9948c381c1603ddda2f4ff","host":"vpc.cn-north-4.myhuaweicloud.com","id":"c33cf13316504988a9e0f7ab525acae7","info_version":"v2","method":"post","name":"NeutronCreateSubnet","parameters":{},"paths":{"/v2.0/subnets":{"post":{"consumes":[],"deprecated":false,"description":"创建子网。","operationId":"NeutronCreateSubnet","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":"子网对象","in":"body","name":"subnet","required":true,"schema":{"$ref":"#/definitions/NeutronCreateSubnetRequestBody"},"x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc","x-order":2}],"produces":[],"responses":{"201":{"description":"正常返回","examples":{"application/json":{"subnet":{"allocation_pools":[{"end":"172.16.2.252","start":"172.16.2.2"}],"cidr":"172.16.2.0/24","created_at":"2019-05-08T02:20:04","dns_nameservers":[],"enable_dhcp":true,"gateway_ip":"172.16.2.1","host_routes":[],"id":"66ef9989-4c38-4249-bd6e-86277aa954ca","ip_version":4,"name":"subnet-test","network_id":"7b1ff976-bb29-4718-b348-2c4c2da54b75","project_id":"6e9dfd51d1124e8d8498dce894923a0d","tenant_id":"6e9dfd51d1124e8d8498dce894923a0d","updated_at":"2019-05-08T02:20:04"}}},"schema":{"$ref":"#/definitions/NeutronSubnetResponseBody"}},"400":{"description":"服务器未能处理请求。","schema":{"$ref":"#/definitions/NeutronErrorResponseBody"}},"401":{"description":"被请求的页面需要用户名和密码。","schema":{"$ref":"#/definitions/NeutronErrorResponseBody"}},"403":{"description":"对被请求页面的访问被禁止。","schema":{"$ref":"#/definitions/NeutronErrorResponseBody"}},"404":{"description":"服务器无法找到被请求的页面。","schema":{"$ref":"#/definitions/NeutronErrorResponseBody"}},"409":{"description":"由于冲突,请求无法被完成。","schema":{"$ref":"#/definitions/NeutronErrorResponseBody"}},"500":{"description":"请求未完成。服务异常。","schema":{"$ref":"#/definitions/NeutronErrorResponseBody"}}},"summary":"创建子网","tags":["OpenStack - 子网"],"x-apiexplorer-hide":"false","x-constraint":"网络下存在IPv4子网的情况下才允许创建IPv6子网。","x-first-open-time":"2016-6-30","x-hybridcloud":"true","x-is-registered":"Y","x-name":"创建子网","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc","x-order":89,"x-publishpath":"","x-request-examples-1":{"subnet":{"cidr":"172.16.2.0/24","enable_dhcp":true,"name":"subnet-test","network_id":"0133cd73-34d4-4d4c-bf1f-e65b24603206"}},"x-request-examples-description-1":"","x-request-examples-text-1":"{\n\t\"subnet\": {\n\t\t\"name\": \"subnet-test\",\n\t\t\"network_id\": \"0133cd73-34d4-4d4c-bf1f-e65b24603206\",\n\t\t\"cidr\": \"172.16.2.0/24\",\n\t\t\"enable_dhcp\": true\n\t}\n}","x-request-examples-url-1":"POST https://{Endpoint}/v2.0/subnets","x-scope":"Commercial","x-source":"Native","x-support-sdk":"Y","x-version":"v2.0"}}},"product_short":"VPC","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"创建子网","tags":"OpenStack - 子网","uri":null,"version":"2.0"}