huawei-cloud-api-definitions-VPC 0.1.20250523

Huawei Cloud API definitions, generated from OpenAPI spec
Documentation
1
{"base_path":"/","components":null,"consumes":"[\"application/json;charset=UTF-8\"]","definitions":{"CreateSubnetOption":{"description":"","properties":{"availability_zone":{"description":"功能说明:子网所在的可用分区标识\n约束:系统存在的可用分区标识","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"cidr":{"description":"功能说明:子网的网段\n取值范围:必须在vpc对应cidr范围内\n约束:必须是cidr格式。掩码长度不能大于28","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"description":{"description":"功能说明:子网描述\n取值范围:0-255个字符,不能包含“<”和“>”。","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"dhcp_enable":{"description":"功能说明:子网是否开启dhcp功能\n取值范围:true(开启),false(关闭)\n约束:不填时默认为true。当设置为false时,会导致新创建的ECS无法获取IP地址,cloudinit无法注入账号密码,请谨慎操作。","type":"boolean","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"dnsList":{"description":"功能说明:子网dns服务器地址的集合;如果想使用两个以上dns服务器,请使用该字段\n约束:是子网dns服务器地址1跟子网dns服务器地址2的合集的父集,不支持IPv6地址。\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,hcso,sbc,obc"},"extra_dhcp_opts":{"description":"子网配置的NTP地址或租约时间","items":{"$ref":"#/definitions/ExtraDhcpOption","description":""},"type":"array","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,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,sbc,obc"},"ipv6_enable":{"description":"功能说明:是否创建cidr_v6\n取值范围:true(开启),false(关闭)\n约束:不填时默认为false\n> 说明\n该参数目前仅在“华北-北京四”区域开放,且申请IPv6公测后才可设置。","type":"boolean","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"name":{"description":"功能说明:子网名称\n取值范围:1-64个字符,支持数字、字母、中文、_(下划线)、-(中划线)、.(点)","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"primary_dns":{"description":"功能说明:子网dns服务器地址1\n约束:ip格式,不支持IPv6地址\n默认值:不填时为空\n[内网DNS地址请参见](https://support.huaweicloud.com/dns_faq/dns_faq_002.html)\n[通过API获取请参见](https://support.huaweicloud.com/api-dns/dns_api_69001.html)","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"secondary_dns":{"description":"功能说明:子网dns服务器地址2\n约束:ip格式,不支持IPv6地址\n默认值:不填时为空\n[内网DNS地址请参见](https://support.huaweicloud.com/dns_faq/dns_faq_002.html)\n[通过API获取请参见](https://support.huaweicloud.com/api-dns/dns_api_69001.html)","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"tags":{"description":"功能说明:子网资源标签。创建子网时,给子网添加资源标签。\n取值范围:最大10个标签, key:标签名称; value:标签值。\n格式:[key*value],每一个标签的key和value之间用*连接","items":{"description":"","type":"string"},"type":"array","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk"},"vpc_id":{"description":"子网所在VPC标识","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"}},"required":["cidr","gateway_ip","name","vpc_id"]},"CreateSubnetRequestBody":{"description":"创建子网对象","properties":{"subnet":{"$ref":"#/definitions/CreateSubnetOption","description":"subnet对象","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"}},"required":["subnet"]},"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"]},"ExtraDhcpOption":{"description":"子网配置的NTP地址或租约时间对象","properties":{"opt_name":{"description":"功能说明:子网配置的NTP地址名称或子网配置的租约到期名称。\n约束:目前只支持字段“ntp”或“addresstime”","enum":["ntp","addresstime"],"type":"string","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"opt_value":{"description":"功能说明:子网配置的NTP地址或子网配置的租约到期时间。\n约束:opt_name配置为“ntp”,则表示是子网ntp地址,目前只支持IPv4地址,每个IP地址以逗号隔开,IP地址个数不能超过4个,不能存在相同地址。\n该字段为null表示取消该子网NTP的设置,不能为””(空字符串)。\nopt_name配置为“addresstime”,则该值表示是子网租约到期时间,取值格式有两种,取-1,表示无限租约;数字+h,数字范围是1~30000,比如5h。","type":"string","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"}},"required":["opt_name"]},"Subnet":{"description":"","properties":{"availability_zone":{"description":"子网所在的可用区标识","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"cidr":{"description":"功能说明:子网的网段\n取值范围:必须在vpc对应cidr范围内\n约束:必须是cidr格式。掩码长度不能大于28","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"cidr_v6":{"description":"IPv6子网的网段,如果子网为IPv4子网,则不返回此参数","type":"string"},"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,hcso,obc"},"description":{"description":"功能说明:子网描述\n取值范围:0-255个字符,不能包含“<”和“>”。","maxLength":255,"minLength":0,"type":"string"},"dhcp_enable":{"description":"子网是否开启dhcp功能","type":"boolean","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"dnsList":{"description":"子网dns服务器地址列表","items":{"type":"string"},"type":"array"},"extra_dhcp_opts":{"description":"子网配置的NTP地址或DHCP租约时间","items":{"$ref":"#/definitions/ExtraDhcpOption"},"type":"array"},"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,sbc,obc"},"gateway_ip_v6":{"description":"IPv6子网的网关,如果子网为IPv4子网,则不返回此参数","type":"string"},"id":{"description":"子网ID","pattern":"[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"ipv6_enable":{"description":"功能说明:是否创建cidr_v6\n取值范围:true(开启),false(关闭)","type":"boolean"},"name":{"description":"功能说明:子网名称\n取值范围:1-64个字符,支持数字、字母、中文、_(下划线)、-(中划线)、.(点)","maxLength":64,"minLength":1,"type":"string"},"neutron_network_id":{"description":"对应网络(OpenStack Neutron接口)id","type":"string"},"neutron_subnet_id":{"description":"对应子网(OpenStack Neutron接口)id","type":"string"},"neutron_subnet_id_v6":{"description":"对应IPv6子网(OpenStack Neutron接口)id,如果子网为IPv4子网,则不返回此参数","type":"string"},"primary_dns":{"description":"子网dns服务器地址1","type":"string"},"scope":{"description":"功能说明:子网作用域\n取值范围:center-表示作用域为中心;{azId}表示作用域为具体的AZ","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk"},"secondary_dns":{"description":"子网dns服务器地址2","type":"string"},"status":{"description":"功能说明:子网的状态\n取值范围:\n- ACTIVE:表示子网已挂载到ROUTER上\n- UNKNOWN:表示子网还未挂载到ROUTER上\n- ERROR:表示子网状态故障","enum":["ACTIVE","UNKNOWN","ERROR"],"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"tenant_id":{"description":"项目ID","example":"b433fedb577940bfa59abff86482ed1a","pattern":"[0-9a-fA-F]{32}","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc"},"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,hcso,obc"},"vpc_id":{"description":"子网所在VPC标识","type":"string"}},"required":["availability_zone","cidr","cidr_v6","created_at","description","dhcp_enable","dnsList","extra_dhcp_opts","gateway_ip","gateway_ip_v6","id","ipv6_enable","name","neutron_network_id","neutron_subnet_id","neutron_subnet_id_v6","primary_dns","secondary_dns","status","tenant_id","updated_at","vpc_id"]},"SubnetResponseBody":{"description":"","properties":{"subnet":{"$ref":"#/definitions/Subnet","description":"subnet对象","x-admin":"False","x-huawei-extraAnnotation":"","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"}},"required":["subnet"]}},"description":null,"group_id":"4784d190da9948c381c1603ddda2f4ff","host":"vpc.cn-north-4.myhuaweicloud.com","id":"49bae44006394f0cac9eb741db14d16d","info_version":"v2","method":"post","name":"CreateSubnet","parameters":{},"paths":{"/v1/{project_id}/subnets":{"post":{"consumes":[],"deprecated":false,"description":"创建子网。","operationId":"CreateSubnet","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":"subnet","required":true,"schema":{"$ref":"#/definitions/CreateSubnetRequestBody"},"x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc","x-order":3}],"produces":[],"responses":{"200":{"description":"正常返回","examples":{"application/json":{"subnet":{"availability_zone":"aa-bb-cc","cidr":"192.168.20.0/24","cidr_v6":"2001:db8:a583::/64","description":"","dhcp_enable":true,"dnsList":["114.xx.xx.114","1114.xx.xx.115"],"extra_dhcp_opts":[{"opt_name":"ntp","opt_value":"10.100.0.33,10.100.0.34"}],"gateway_ip":"192.168.20.1","gateway_ip_v6":"2001:db8:a583::1","id":"4779ab1c-7c1a-44b1-a02e-93dfc361b32d","ipv6_enable":true,"name":"subnet","neutron_network_id":"4779ab1c-7c1a-44b1-a02e-93dfc361b32d","neutron_subnet_id":"213cb9d-3122-2ac1-1a29-91ffc1231a12","neutron_subnet_id_v6":"e0fa7de1-a6e2-44c9-b052-b9d8cebe93c4","primary_dns":"114.xx.xx.114","secondary_dns":"114.xx.xx.115","status":"UNKNOWN","vpc_id":"3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85"}}},"schema":{"$ref":"#/definitions/SubnetResponseBody"}},"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-6-30","x-hybridcloud":"true","x-is-registered":"Y","x-name":"创建子网","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,obc","x-order":13,"x-publishpath":"","x-request-examples-1":{"subnet":{"availability_zone":"aa-bb-cc","cidr":"192.168.20.0/24","dhcp_enable":true,"dnsList":["114.xx.xx.114","114.xx.xx.115"],"extra_dhcp_opts":[{"opt_name":"ntp","opt_value":"10.100.0.33,10.100.0.34"}],"gateway_ip":"192.168.20.1","ipv6_enable":"true","name":"subnet","primary_dns":"114.xx.xx.114","secondary_dns":"114.xx.xx.115","vpc_id":"3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85"}},"x-request-examples-description-1":"","x-request-examples-text-1":"{\n    \"subnet\": {\n        \"name\": \"subnet\",\n        \"cidr\": \"192.168.20.0/24\",\n        \"gateway_ip\": \"192.168.20.1\",\n        \"ipv6_enable\": \"true\",\n        \"dhcp_enable\": true,\n        \"primary_dns\": \"114.xx.xx.114\",\n        \"secondary_dns\": \"114.xx.xx.115\",\n        \"dnsList\": [\n            \"114.xx.xx.114\",\n            \"114.xx.xx.115\"\n        ],\n        \"availability_zone\": \"aa-bb-cc\",\n        \"vpc_id\": \"3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85\",\n        \"extra_dhcp_opts\": [\n            {\n                \"opt_value\": \"10.100.0.33,10.100.0.34\",\n                \"opt_name\": \"ntp\"\n            }\n        ]\n    }\n}","x-request-examples-url-1":"POST https://{Endpoint}/v1/{project_id}/subnets","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"}