{"base_path":"/","components":null,"consumes":"[\"application/json;charset=UTF-8\"]","definitions":{"NeutronCreateSecurityGroupOption":{"description":"","properties":{"description":{"description":"功能说明:安全组描述\n取值范围:0-255个字符","maxLength":255,"minLength":0,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"},"name":{"description":"功能说明:安全组名称\n取值范围:0-255个字符\n约束:不允许为“default”","maxLength":255,"minLength":0,"type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}}},"NeutronCreateSecurityGroupRequestBody":{"description":"","properties":{"security_group":{"$ref":"#/definitions/NeutronCreateSecurityGroupOption","description":"安全组对象","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}},"required":["security_group"]},"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"]},"NeutronSecurityGroup":{"description":"","properties":{"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"},"description":{"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"},"id":{"description":"安全组ID","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"},"project_id":{"description":"项目ID","maxLength":255,"minLength":0,"type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"security_group_rules":{"description":"安全组规则,详情参见Security Group Rule对象","items":{"$ref":"#/definitions/NeutronSecurityGroupRule"},"type":"array","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"tenant_id":{"description":"项目ID","maxLength":255,"minLength":0,"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":["created_at","description","id","name","project_id","security_group_rules","tenant_id","updated_at"]},"NeutronSecurityGroupResponseBody":{"description":"","properties":{"security_group":{"$ref":"#/definitions/NeutronSecurityGroup","description":"安全组对象","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc"}},"required":["security_group"]},"NeutronSecurityGroupRule":{"description":"","properties":{"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"},"description":{"description":"安全组规则描述","maxLength":255,"minLength":0,"type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"direction":{"description":"功能说明:规则方向\n取值范围:ingress、egress","enum":["ingress","egress"],"example":"egress","type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"ethertype":{"description":"功能说明:网络类型\n取值范围:IPv4、IPv6","type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"id":{"description":"安全组规则ID,查询安全组规则非必选","type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"port_range_max":{"description":"功能说明:最大端口\n取值范围:当协议类型为ICMP时,该值表示ICMP的code","format":"int32","type":"integer","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"port_range_min":{"description":"功能说明:最小端口\n当协议类型为ICMP时,该值表示ICMP的type。protocol为tcp和udp时,port_range_max和port_range_min必须同时输入,且port_range_max应大于等于port_range_min。protocol为icmp时,指定ICMP code(port_range_max)时,必须同时指定ICMP type(port_range_min)。","format":"int32","type":"integer","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-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"protocol":{"description":"功能说明:tcp/udp/icmp/icmpv6或IP协议编号(0~255)\n约束:协议为icmpv6时,网络类型应该为IPv6;协议为icmp时,网络类型应该为IPv4","type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"remote_address_group_id":{"description":"功能说明:远端IP地址组ID\n约束:和remote_ip_prefix,remote_group_id互斥","type":"string","x-admin":"False","x-internal":"False","x-open-region-cloud":"hc,hk,otc,tlf,ctc,hcso,sbc,obc"},"remote_group_id":{"description":"所属安全组的对端ID","type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"remote_ip_prefix":{"description":"对端ip网段","maxLength":255,"type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"security_group_id":{"description":"所属安全组ID","type":"string","x-admin":"False","x-internal":"False","x-obc":"Y","x-open-region-cloud":"hc,hk,otc,tlf,ctc"},"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":["created_at","description","direction","ethertype","id","port_range_max","port_range_min","project_id","protocol","remote_address_group_id","remote_group_id","remote_ip_prefix","security_group_id","tenant_id","updated_at"]}},"description":null,"group_id":"4784d190da9948c381c1603ddda2f4ff","host":"vpc.cn-north-4.myhuaweicloud.com","id":"fbae316ee3984606ba823ac3fe336748","info_version":"v2","method":"post","name":"NeutronCreateSecurityGroup","parameters":{},"paths":{"/v2.0/security-groups":{"post":{"consumes":[],"deprecated":false,"description":"创建安全组","operationId":"NeutronCreateSecurityGroup","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":"security_group","required":true,"schema":{"$ref":"#/definitions/NeutronCreateSecurityGroupRequestBody"},"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":{"security_group":{"created_at":"2018-09-20T02:15:34","description":"","id":"d29ae17d-f355-4992-8747-1fb66cc9afd2","name":"sg-test","project_id":"bbfe8c41dd034a07bebd592bf03b4b0c","security_group_rules":[{"description":null,"direction":"egress","ethertype":"IPv4","id":"3f51e52c-0e85-40f7-a137-85927392e436","port_range_max":null,"port_range_min":null,"protocol":null,"remote_group_id":null,"remote_ip_prefix":null,"security_group_id":"d29ae17d-f355-4992-8747-1fb66cc9afd2","tenant_id":"bbfe8c41dd034a07bebd592bf03b4b0c"},{"description":null,"direction":"egress","ethertype":"IPv6","id":"6332de3e-98fb-4f8c-b44a-fcb8ff09881e","port_range_max":null,"port_range_min":null,"protocol":null,"remote_group_id":null,"remote_ip_prefix":null,"security_group_id":"d29ae17d-f355-4992-8747-1fb66cc9afd2","tenant_id":"bbfe8c41dd034a07bebd592bf03b4b0c"}],"tenant_id":"bbfe8c41dd034a07bebd592bf03b4b0c","updated_at":"2018-09-20T02:15:34"}}},"schema":{"$ref":"#/definitions/NeutronSecurityGroupResponseBody"}},"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":"","x-first-open-time":"2016-6-30","x-hybridcloud":"false","x-is-registered":"Y","x-name":"创建安全组","x-open-region-cloud":"hc,hk,otc,tlf,ctc,obc","x-order":118,"x-publishpath":"","x-request-examples-1":{"security_group":{"description":"security-groups","name":"sg-test"}},"x-request-examples-description-1":"","x-request-examples-text-1":"{\n\t\"security_group\": {\n\t\t\"name\": \"sg-test\",\n \"description\": \"security-groups\"\n\t}\n}","x-request-examples-url-1":"POST https://{Endpoint}/v2.0/security-groups","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"}