华为云用户手册

  • 响应参数 表5 响应参数 名称 参数类型 说明 resources Array of resource objects resource对象列表,请参见表6。 total_count Integer 总记录数 表6 resource对象 名称 参数类型 说明 resource_id String 资源ID resource_detail Object 资源详情。 资源对象,用于扩展。默认为空 tags Array of tag objects 标签列表,没有标签默认为空数组,参见表7 resource_name String 资源名称,没有默认为空字符串 表7 tag字段数据结构说明 名称 是否必选 参数类型 说明 key 是 String 键。最大长度127个unicode字符。 key不能为空。(搜索时不对此参数做校验) value 是 String 值列表。每个值最大长度255个unicode字符,如果values为空列表,则表示any_value。 value之间为或的关系: 能查到匹配任意一个value的资源,如,资源A有val1的tag,B有val2的tag,用values={val1,val2}能过滤查询到资源A和B。
  • 响应示例 { "firewall_group": { "status": "ACTIVE", "public": false, "egress_firewall_policy_id": null, "name": "bobby_fwg1", "admin_state_up": true, "ports": [ "16e6d779-15e9-48fb-abc5-b86457792a15" ], "tenant_id": "23c8a121505047b6869edf39f3062712", "id": "a504a4cf-9300-40e0-b2d4-649bd157c55a", "ingress_firewall_policy_id": "fed2d88f-d0e7-4cc5-bd7e-c495f67037b6", "description": "test", "project_id": "23c8a121505047b6869edf39f3062712", "created_at": "2018-09-12T08:24:14", "updated_at": "2018-09-12T08:24:14" }}
  • 响应参数 表2 响应参数 参数名称 类型 说明 firewall_group firewall_group object firewall group对象。请参见表3。 表3 Firewall Group对象 属性 类型 说明 id String 网络ACL组的uuid标识。 name String 网络ACL组名称。 description String 网络ACL组描述。 tenant_id String 项目ID ingress_firewall_policy_id String 入方向网络ACL策略。 egress_firewall_policy_id String 出方向网络ACL策略。 ports Array of strings 网络ACL组绑定的端口列表。 public Boolean 是否支持跨租户共享。 status String 网络ACL策略的状态。 admin_state_up Boolean 网络ACL的管理状态。 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss
  • 示例 举例描述创建网络ACL资源的过程,理解三者之间的关系。 创建网络ACL规则 POST /v2.0/fwaas/firewall_rules 请求体 { "firewall_rule": { "name": "fw-rule-ingress-1", "description": "create a ingress firewall rule ", "protocol": "TCP", "action": "ALLOW", "ip_version": 4, "destination_ip_address": "192.168.22.0/24", "source_ip_address": "0.0.0.0/0", "enabled": true }} 响应体,获取到firewall_rule_id:84d10f4a-9f8b-41b8-bdfa-5a0f18736f12 { "firewall_rule": { "protocol": "tcp", "description": "create a ingress firewall rule ", "source_ip_address": "0.0.0.0/0", "destination_ip_address": "192.168.22.0/24", "source_port": null, "destination_port": null, "id": "84d10f4a-9f8b-41b8-bdfa-5a0f18736f12", "name": "fw-rule-ingress-1", "tenant_id": "5f6387106c2048b589b369d96c2f23a2", "project_id": "5f6387106c2048b589b369d96c2f23a2", "enabled": true, "action": "allow", "ip_version": 4, "public": false }} 创建网络ACL策略 POST /v2.0/fwaas/firewall_policies 请求体,绑定网络ACL规则 { "firewall_policy": { "description": "create a ingress firewall policy", "firewall_rules": [ "84d10f4a-9f8b-41b8-bdfa-5a0f18736f12" ], "name": "fw-policy-ingress" }} 响应体,获取到firewall_policy_id:da037721-b895-4e07-bbcc-f5f6ac2759fb { "firewall_policy": { "id": "da037721-b895-4e07-bbcc-f5f6ac2759fb", "name": "fw-policy-ingress", "project_id": "5f6387106c2048b589b369d96c2f23a2", "tenant_id": "5f6387106c2048b589b369d96c2f23a2", "description": "create a ingress firewall policy", "firewall_rules": [ "84d10f4a-9f8b-41b8-bdfa-5a0f18736f12" ], "audited": false, "public": false }} 创建网络ACL组 POST /v2.0/fwaas/firewall_groups 请求体,绑定入方向网络ACL策略 { "firewall_group": { "name": "fw-group-example", "description": "create a firewall group", "ingress_firewall_policy_id": "da037721-b895-4e07-bbcc-f5f6ac2759fb", "admin_state_up": true }} 响应体,获取到firewall_group_id:102493e8-fc6d-4f0d-b57f-55c5be86f5c0 { "firewall_group": { "id": "102493e8-fc6d-4f0d-b57f-55c5be86f5c0", "name": "fw-group-example", "project_id": "5f6387106c2048b589b369d96c2f23a2", "tenant_id": "5f6387106c2048b589b369d96c2f23a2", "admin_state_up": true, "egress_firewall_policy_id": null, "ingress_firewall_policy_id": "da037721-b895-4e07-bbcc-f5f6ac2759fb", "description": "create a firewall group", "created_at": "2023-03-09T08:54:40", "updated_at": "2023-03-09T08:54:40", "status": "INACTIVE", "ports": [], "public": false }} 登录网络控制台,可以查看到创建的网络ACL资源。
  • 概述 欢迎使用虚拟私有云服务(Virtual Private Cloud,以下简称VPC)。VPC为弹性云服务器构建隔离的、用户自主配置和管理的虚拟网络环境,提升用户云上资源的安全性,简化用户的网络部署。 您可以使用本文档提供的API对VPC进行相关操作,如创建、查询、删除、更新等。支持的全部操作请参见API概览。 在调用VPC服务的API之前,请确保已经充分了解VPC服务相关概念,详细信息请参见《虚拟私有云用户指南》的“产品介绍”。 父主题: 使用前必读
  • 操作步骤 通过子网ID或IP地址过滤查询端口。 发送“GET https://VPC的Endpoint/v1/{project_id}/ports?fixed_ips=ip_address={ip_address}&fixed_ips=subnet_id={subnet_id}”, project_id为项目ID,ip_address为端口资源的IP地址,subnet_id为端口资源所在子网的ID(IPV4/IPV6子网ID,不是网络ID)。 过滤信息格式举例 fixed_ips=ip_address=192.168.27.75,fixed_ips=subnet_id=f60f887b-60e1-4647-a762-b5c6925909cd 在Request Header中增加“X-Auth-Token”。 查看请求响应结果。 请求成功时,响应参数如下,id就是port_id,可以看到端口的详细信息。 { "ports": [ { "id": "6026a064-eacc-4c40-a0fd-9dcc456ad495", "name": "", "status": "DOWN", "admin_state_up": true, "fixed_ips": [ { "subnet_id": "f60f887b-60e1-4647-a762-b5c6925909cd", "ip_address": "192.168.27.75" } ], "mac_address": "fa:16:3e:ab:1e:4e", "network_id": "b033c3b8-59ea-4a15-9f86-648119cdc50a", "tenant_id": "5f6387106c2048b589b369d96c2f23a2", "device_id": "", "device_owner": "neutron:VIP_PORT", "security_groups": [], "extra_dhcp_opts": [], "allowed_address_pairs": [], "binding:vnic_type": "normal", "binding:vif_details": {}, "binding:profile": {}, "port_security_enabled": true, "instance_type": "", "instance_id": "", "zone_id": "cn-north-4a" } ]} 请求异常时,错误码请参见错误码。 查询端口详情。 如果已知端口ID,可以通过下面的接口查询端口详情。 发送“GET https://VPC的Endpoint/v1/{project_id}/ports/{port_id}”,project_id为项目ID,port_id为端口ID。 在Request Header中增加“X-Auth-Token”。 查看请求响应结果。 请求成功时,响应参数如下。 { "port": { "id": "6026a064-eacc-4c40-a0fd-9dcc456ad495", "name": "", "status": "DOWN", "admin_state_up": true, "fixed_ips": [ { "subnet_id": "f60f887b-60e1-4647-a762-b5c6925909cd", "ip_address": "192.168.27.75" } ], "mac_address": "fa:16:3e:ab:1e:4e", "network_id": "b033c3b8-59ea-4a15-9f86-648119cdc50a", "tenant_id": "5f6387106c2048b589b369d96c2f23a2", "device_id": "", "device_owner": "neutron:VIP_PORT", "security_groups": [], "extra_dhcp_opts": [], "allowed_address_pairs": [], "binding:vnic_type": "normal", "binding:vif_details": {}, "binding:profile": {}, "port_security_enabled": true, "instance_type": "", "instance_id": "", "zone_id": "cn-north-4a" }} 请求异常时,错误码请参见错误码。
  • 请求示例 page_reverse为False GET https://{Endpoint}/v2.0/networks?limit=2&marker=3d42a0d4-a980-4613-ae76-a2cddecff054&page_reverse=False page_reverse为True GET https://{Endpoint}/v2.0/vpc/peerings?limit=2&marker=e5a0c88e-228e-4e62-a8b0-90825b1b7958&page_reverse=True
  • 响应示例 page_reverse为False { "networks": [ { "status": "ACTIVE", "subnets": [], "name": "liudongtest ", "admin_state_up": false, "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f", "id": "60c809cb-6731-45d0-ace8-3bf5626421a9" }, { "status": "ACTIVE", "subnets": [ "132dc12d-c02a-4c90-9cd5-c31669aace04" ], "name": "publicnet", "admin_state_up": true, "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f", "id": "9daeac7c-a98f-430f-8e38-67f9c044e299" } ], "networks_links": [ { "href": "http://192.168.82.231:9696/v2.0/networks?limit=2&marker=9daeac7c-a98f-430f-8e38-67f9c044e299", "rel": "next" }, { "href": "http://192.168.82.231:9696/v2.0/networks?limit=2&marker=60c809cb-6731-45d0-ace8-3bf5626421a9&page_reverse=True", "rel": "previous" } ]} page_reverse为True { "peerings_links": [ { "marker": "dd442819-5638-401c-bd48-a82703cf0464", "rel": "next" }, { "marker": "1e13cbaf-3ce4-413d-941f-66d855dbfa7f", "rel": "previous" } ], "peerings": [ { "status": "ACTIVE", "accept_vpc_info": { "vpc_id": "83a48834-b9bc-4f70-aa46-074568594650", "tenant_id": "e41a43bf06e249678413c6d61536eff9" }, "request_vpc_info": { "vpc_id": "db8e7687-e43b-4fc1-94cf-16f69f484d6d", "tenant_id": "e41a43bf06e249678413c6d61536eff9" }, "name": "peering1", "id": "1e13cbaf-3ce4-413d-941f-66d855dbfa7f" }, { "status": "ACTIVE", "accept_vpc_info": { "vpc_id": "83a48834-b9bc-4f70-aa46-074568594650", "tenant_id": "e41a43bf06e249678413c6d61536eff9" }, "request_vpc_info": { "vpc_id": "bd63cc9e-e7b8-4d4e-a0e9-055031470ffc", "tenant_id": "e41a43bf06e249678413c6d61536eff9" }, "name": "peering2", "id": "dd442819-5638-401c-bd48-a82703cf0464" } ]}
  • 功能介绍 Neutron API v2.0提供分页查询功能,通过在list请求的url中添加limit和marker参数实现分页返回列表信息。分页显示的结果以显示对象的id升序排序。 若需要访问请求的下一页,需要进行以下两项配置: 在原有访问请求url中将“marker”属性值进行替换。将“marker”取值替换为:在响应消息中“rel”值为“next”时,“herf”参数取值中包括的“marker”取值。 设置“page_reverse”值为“False”。 若需要访问请求的上一页,需要进行以下两项配置: 在原有访问请求的url中将“marker”属性值进行替换。将“maker”取值替换为:在响应消息中“rel”值为“previous”时,“herf”参数中包括的“marker”取值。 设置“page_reverse”值为“True”。
  • 响应参数 表2 响应参数 参数名称 类型 说明 tags Array of tag objects 标签列表 表3 tag字段数据结构说明 名称 参数类型 说明 key String 键。 不能为空。 长度不超过36个字符。 由英文字母、数字、下划线、中划线、中文字符组成。 values Array of strings 值列表。 长度不超过43个字符。 由英文字母、数字、下划线、点、中划线、中文字符组成。
  • 响应示例 { "tags": [ { "key": "key1", "values": [ "value1", "value2" ] }, { "key": "key2", "values": [ "value1", "value2" ] } ]}
  • 响应示例 { "security_group_rules": [ { "remote_group_id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967", "direction": "ingress", "remote_ip_prefix": null, "protocol": null, "tenant_id": "6c9298ec8c874f7f99688489ab65f90e", "port_range_max": null, "security_group_id": "1d8b19c7-7c56-48f7-a99b-4b40eb390967", "port_range_min": null, "ethertype": "IPv6", "description": null, "id": "07adc044-3f21-4eeb-bd57-5e5eb6024b7f", "project_id": "6c9298ec8c874f7f99688489ab65f90e", "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:15:34" }, { "remote_group_id": null, "direction": "egress", "remote_ip_prefix": null, "protocol": null, "tenant_id": "6c9298ec8c874f7f99688489ab65f90e", "port_range_max": null, "security_group_id": "328fb454-a2ee-4a11-bdb1-ee19bbdfde43", "port_range_min": null, "ethertype": "IPv6", "description": null, "id": "09358f83-f4a5-4386-9563-a1e3c373d655", "project_id": "6c9298ec8c874f7f99688489ab65f90e", "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:15:34" }, { "remote_group_id": "4c763030-366e-428c-be2b-d48f6baf5297", "direction": "ingress", "remote_ip_prefix": null, "protocol": null, "tenant_id": "6c9298ec8c874f7f99688489ab65f90e", "port_range_max": null, "security_group_id": "4c763030-366e-428c-be2b-d48f6baf5297", "port_range_min": null, "ethertype": "IPv6", "description": null, "id": "219a6f56-1069-458b-bec0-df9270e7a074", "project_id": "6c9298ec8c874f7f99688489ab65f90e", "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:15:34" } ], "security_group_rules_links": [ { "rel": "previous", "href": "https://{Endpoint}/v2.0/security-group-rules?marker=07adc044-3f21-4eeb-bd57-5e5eb6024b7f&page_reverse=True" } ]}
  • 响应参数 表2 响应参数 参数名称 类型 说明 security_group_rules Array of Security Group Rule objects security group rule对象列表。请参见表3。 security_group_rules_links Array of SecurityGroupRulesLink objects 分页信息。 只有在使用limit过滤,并且资源个数超过limit或者资源个数超过2000时(limit默认值),该参数的rel和href取值才会显示为next和其对应的link。 表3 Security Group Rule对象 属性 类型 说明 id String 安全组规则id 使用说明:查询安全组规则非必选 description String 安全组规则描述 security_group_id String 所属安全组id remote_group_id String 所属安全组的对端id direction String 规则方向 remote_ip_prefix String 对端ip网段 protocol String 协议类型或直接指定IP协议号 port_range_max Integer 最大端口,当协议类型为ICMP时,该值表示ICMP的code port_range_min Integer 最小端口,当协议类型为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)。 ethertype String 网络类型 支持IPv4,IPv6 tenant_id String 项目ID remote_address_group_id String 功能说明:远端IP地址组ID 约束:和remote_ip_prefix,remote_group_id互斥 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表4 SecurityGroupRulesLink对象 参数名称 类型 说明 href String API链接 rel String API链接与该API版本的关系
  • URI GET /v2.0/security-group-rules 样例: GET https://{Endpoint}/v2.0/security-group-rules?security_group_id={security_group_id}&remote_group_id={remote_group_id}&direction={direction}&remote_ip_prefix={remote_ip_prefix}&protocol={protocol}&port_range_max={port_range_max}&port_range_min={port_range_min}ðertype={ethertype}&tenant_id ={tenant_id} 分页查询样例: GET https://{Endpoint}/v2.0/networks?limit=2&marker=07adc044-3f21-4eeb-bd57-5e5eb6024b7f&page_reverse=False 参数说明请参见表1 表1 参数说明 名称 是否必选 参数类型 说明 id 否 String 按照安全组规则对应的id过滤查询结果 description 否 String 按照description过滤查询结果 remote_group_id 否 String 按照与此安全组规则关联的远端安全组ID过滤查询结果 security_group_id 否 String 按照与此安全组规则所属的安全组ID过滤查询结果 direction 否 String 按照安全组规则的方向过滤查询结果,支持ingress和egress进行过滤 protocol 否 String 按照安全组规则的IP协议过滤查询结果 remote_ip_prefix 否 String 按照与此安全组规则匹配的远端IP网段过滤查询结果 ethertype 否 String 按照网络类型过滤查询结果 port_range_max 否 Integer 按照最大端口过滤查询结果 port_range_min 否 Integer 按照最小端口过滤查询结果 tenant_id 否 String 按照项目ID过滤查询结果 marker 否 String 分页查询的起始资源ID,表示从指定资源的下一条记录开始查询。 marker需要和limit配合使用: 若不传入marker和limit参数,查询结果返回第一页全部资源记录。 若不传入marker参数,limit为10,查询结果返回第1~10条资源记录。 若marker为第10条记录的资源ID,limit为10,查询结果返回第11~20条资源记录。 若marker为第10条记录的资源ID,不传入limit参数,查询结果返回第11条及之后的所有资源记录。 limit 否 Integer 分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。 limit需要和marker配合使用,详细规则请见marker的参数说明。
  • 响应参数 表2 响应参数 参数名称 类型 说明 security_groups Array of Security Group objects security group对象列表。请参见表3 security_groups_links Array of SecurityGroupsLink objects 分页信息。 只有在使用limit过滤,并且资源个数超过limit或者资源个数超过2000时(limit默认值),该参数的rel和href取值才会显示为next和其对应的link。 表3 Security Group对象 属性 类型 说明 id String 安全组的id 使用说明:查询安全组列表非必选 tenant_id String 项目ID name String 安全组名称 description String 安全组描述 security_group_rules Array of Security Group Rule objects security_group_rule列表,参见表4 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表4 Security Group Rule对象 属性 类型 说明 id String 安全组规则id 使用说明:查询安全组规则非必选 description String 安全组规则描述 security_group_id String 所属安全组id remote_group_id String 所属安全组的对端id direction String 规则方向 remote_ip_prefix String 对端ip网段 protocol String 协议类型或直接指定IP协议号 port_range_max Integer 最大端口,当协议类型为ICMP时,该值表示ICMP的code port_range_min Integer 最小端口,当协议类型为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)。 ethertype String 网络类型 支持IPv4,IPv6 tenant_id String 项目ID remote_address_group_id String 功能说明:远端IP地址组ID 约束:和remote_ip_prefix,remote_group_id互斥 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表5 SecurityGroupsLink对象 参数名称 类型 说明 href String API链接 rel String API链接与该API版本的关系
  • 响应示例 { "security_groups": [ { "id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "name": "sg-ad3f", "description": "", "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "security_group_rules": [ { "id": "d90e55ba-23bd-4d97-b722-8cb6fb485d69", "direction": "ingress", "protocol": null, "ethertype": "IPv4", "description": null, "remote_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_address_group_id": "0150a3a7-82ca-4569-865c-04e46e5e9249" }, { "id": "aecff4d4-9ce9-489c-86a3-803aedec65f7", "direction": "egress", "protocol": null, "ethertype": "IPv4", "description": null, "remote_group_id": null, "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_address_group_id": null } ], "created_at": "2018-09-12T08:24:14", "updated_at": "2018-09-12T08:24:14" } ], "security_groups_links": [ { "rel": "next", "href": "https://{Endpoint}/v2.0/security-groups?limit=1&marker=0431c9c5-1660-42e0-8a00-134bec7f03e2" }, { "rel": "previous", "href": "https://{Endpoint}/v2.0/security-groups?limit=1&marker=0431c9c5-1660-42e0-8a00-134bec7f03e2&page_reverse=True" } ]}
  • 响应示例 { "security_group": { "id": "d29ae17d-f355-4992-8747-1fb66cc9afd2", "name": "sg-test", "description": "", "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "security_group_rules": [ { "id": "3f51e52c-0e85-40f7-a137-85927392e436", "direction": "egress", "protocol": null, "ethertype": "IPv4", "description": null, "remote_group_id": null, "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "d29ae17d-f355-4992-8747-1fb66cc9afd2", "remote_address_group_id": null }, { "id": "6332de3e-98fb-4f8c-b44a-fcb8ff09881e", "direction": "egress", "protocol": null, "ethertype": "IPv6", "description": null, "remote_group_id": null, "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "d29ae17d-f355-4992-8747-1fb66cc9afd2", "remote_address_group_id": null } ], "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:15:34" }}
  • 响应参数 表3 响应参数 参数名称 类型 说明 security_group security_group object security group对象。请参见表4。 表4 Security Group对象 属性 类型 说明 id String 安全组的id 使用说明:查询安全组列表非必选 tenant_id String 项目ID name String 安全组名称 description String 安全组描述 security_group_rules Array of Security Group Rule objects security_group_rule列表,参见表5 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表5 Security Group Rule对象 属性 类型 说明 id String 安全组规则id 使用说明:查询安全组规则非必选 description String 安全组规则描述 security_group_id String 所属安全组id remote_group_id String 所属安全组的对端id direction String 规则方向 remote_ip_prefix String 对端ip网段 protocol String 协议类型或直接指定IP协议号 port_range_max Integer 最大端口,当协议类型为ICMP时,该值表示ICMP的code port_range_min Integer 最小端口,当协议类型为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)。 ethertype String 网络类型 支持IPv4,IPv6 tenant_id String 项目ID remote_address_group_id String 功能说明:远端IP地址组ID 约束:和remote_ip_prefix,remote_group_id互斥 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss
  • 响应示例 { "security_group": { "id": "d29ae17d-f355-4992-8747-1fb66cc9afd2", "name": "sg-test02", "description": "", "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "security_group_rules": [ { "id": "6332de3e-98fb-4f8c-b44a-fcb8ff09881e", "direction": "egress", "protocol": null, "ethertype": "IPv6", "description": null, "remote_group_id": null, "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "d29ae17d-f355-4992-8747-1fb66cc9afd2", "remote_address_group_id": "0150a3a7-82ca-4569-865c-04e46e5e9249" }, { "id": "3f51e52c-0e85-40f7-a137-85927392e436", "direction": "egress", "protocol": null, "ethertype": "IPv4", "description": null, "remote_group_id": null, "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "d29ae17d-f355-4992-8747-1fb66cc9afd2", "remote_address_group_id": null } ], "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:16:31" }}
  • 响应参数 表3 响应参数 参数名称 类型 说明 security_group security_group object security_group对象。请参见表4。 表4 Security Group对象 属性 类型 说明 id String 安全组的id 使用说明:查询安全组列表非必选 tenant_id String 项目ID name String 安全组名称 description String 安全组描述 security_group_rules Array of Security Group Rule objects security_group_rule列表,参见表5 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表5 Security Group Rule对象 属性 类型 说明 id String 安全组规则id 使用说明:查询安全组规则非必选 description String 安全组规则描述 security_group_id String 所属安全组id remote_group_id String 所属安全组的对端id direction String 规则方向 remote_ip_prefix String 对端ip网段 protocol String 协议类型或直接指定IP协议号 port_range_max Integer 最大端口,当协议类型为ICMP时,该值表示ICMP的code port_range_min Integer 最小端口,当协议类型为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)。 ethertype String 网络类型 支持IPv4,IPv6 tenant_id String 项目ID remote_address_group_id String 功能说明:远端IP地址组ID 约束:和remote_ip_prefix,remote_group_id互斥 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss
  • 请求示例 更新id为d29ae17d-f355-4992-8747-1fb66cc9afd2的安全组,名称更新为sg-test02。 PUT https://{Endpoint}/v2.0/security-groups/d29ae17d-f355-4992-8747-1fb66cc9afd2 { "security_group": { "name": "sg-test02" }}
  • 响应示例 { "security_group_rule": { "remote_group_id": null, "direction": "egress", "remote_ip_prefix": null, "protocol": null, "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f", "port_range_max": null, "security_group_id": "723bc02c-d7f7-49b5-b6ff-d08320f315e2", "port_range_min": null, "ethertype": "IPv4", "description": null, "id": "1755bc80-cf3a-4f57-8ae9-d9796482ddc0", "project_id": "6fbe9263116a4b68818cf1edce16bc4f", "created_at": "2018-09-20T02:15:34", "updated_at": "2018-09-20T02:15:34" }}
  • 响应参数 表1 响应参数 参数名称 类型 说明 security_group_rule security_group_rule object security group rule对象。请参见表2。 表2 Security Group Rule对象 属性 类型 说明 id String 安全组规则id 使用说明:查询安全组规则非必选 description String 安全组规则描述 security_group_id String 所属安全组id remote_group_id String 所属安全组的对端id direction String 规则方向 remote_ip_prefix String 对端ip网段 protocol String 协议类型或直接指定IP协议号 port_range_max Integer 最大端口,当协议类型为ICMP时,该值表示ICMP的code port_range_min Integer 最小端口,当协议类型为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)。 ethertype String 网络类型 支持IPv4,IPv6 tenant_id String 项目ID remote_address_group_id String 功能说明:远端IP地址组ID 约束:和remote_ip_prefix,remote_group_id互斥 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss
  • 响应示例 { "security_group": { "id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "name": "sg-ad3f", "description": "", "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "security_group_rules": [ { "id": "d90e55ba-23bd-4d97-b722-8cb6fb485d69", "direction": "ingress", "protocol": null, "ethertype": "IPv4", "description": null, "remote_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_address_group_id": "0150a3a7-82ca-4569-865c-04e46e5e9249" }, { "id": "aecff4d4-9ce9-489c-86a3-803aedec65f7", "direction": "egress", "protocol": null, "ethertype": "IPv4", "description": null, "remote_group_id": null, "remote_ip_prefix": null, "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c", "port_range_max": null, "port_range_min": null, "security_group_id": "0431c9c5-1660-42e0-8a00-134bec7f03e2", "remote_address_group_id": null } ], "created_at": "2018-09-12T08:24:14", "updated_at": "2018-09-12T08:24:14" }}
  • 响应参数 表1 响应参数 参数名称 类型 说明 security_group security_group object security group对象。请参见表2。 表2 Security Group对象 属性 类型 说明 id String 安全组的id 使用说明:查询安全组列表非必选 tenant_id String 项目ID name String 安全组名称 description String 安全组描述 security_group_rules Array of Security Group Rule objects security_group_rule列表,参见表3 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss 表3 Security Group Rule对象 属性 类型 说明 id String 安全组规则id 使用说明:查询安全组规则非必选 description String 安全组规则描述 security_group_id String 所属安全组id remote_group_id String 所属安全组的对端id direction String 规则方向 remote_ip_prefix String 对端ip网段 protocol String 协议类型或直接指定IP协议号 port_range_max Integer 最大端口,当协议类型为ICMP时,该值表示ICMP的code port_range_min Integer 最小端口,当协议类型为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)。 ethertype String 网络类型 支持IPv4,IPv6 tenant_id String 项目ID remote_address_group_id String 功能说明:远端IP地址组ID 约束:和remote_ip_prefix,remote_group_id互斥 project_id String 项目ID,请参见获取项目ID。 created_at String 资源创建时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss updated_at String 资源更新时间,UTC时间 格式:yyyy-MM-ddTHH:mm:ss
  • 响应示例 { "firewall_policies": [ { "description": "", "firewall_rules": [ "6c6803e0-ca8c-4aa9-afb3-4f89275b6c32" ], "tenant_id": "23c8a121505047b6869edf39f3062712", "public": false, "id": "6b70e321-0c21-4b83-bb8a-a886d1414a5f", "audited": false, "name": "fwp1", "project_id": "23c8a121505047b6869edf39f3062712" }, { "description": "", "firewall_rules": [ "6c6803e0-ca8c-4aa9-afb3-4f89275b6c32" ], "tenant_id": "23c8a121505047b6869edf39f3062712", "public": false, "id": "fce92002-5a15-465d-aaca-9b44453bb738", "audited": false, "name": "fwp2", "project_id": "23c8a121505047b6869edf39f3062712" } ], "firewall_policies_links": [ { "rel": "previous", "href": "https://{Endpoint}/v2.0/fwaas/firewall_policies?marker=6b70e321-0c21-4b83-bb8a-a886d1414a5f&page_reverse=True" } ]}
  • 响应参数 表2 响应参数 参数名称 类型 说明 firewall_policies Array of firewall Policy object firewall policy对象列表。请参见表3。 firewall_policies_links Array of firewall_policies_link object firewall_policies_link对象。请参见表4。 只有在使用limit过滤,并且资源个数超过limit或者资源个数超过2000时(limit默认值),该参数的rel和href取值才会显示为next和其对应的link。 表3 firewall_Policy对象 属性 类型 说明 id String 网络ACL策略uuid标识。 name String 网络ACL策略名称。 description String 网络ACL策略描述。 tenant_id String 项目ID firewall_rules Array of strings 策略引用的网络ACL规则链。 audited Boolean 审计标记。 public Boolean 是否支持跨租户共享。 project_id String 项目ID,请参见获取项目ID。 表4 firewall_policies_link对象 名称 参数类型 说明 href String API链接 rel String API链接与该API版本的关系
  • URI GET /v2.0/fwaas/firewall_policies 分页查询样例: GET https://{Endpoint}/v2.0/fwaas/firewall_policies?limit=2&marker=6b70e321-0c21-4b83-bb8a-a886d1414a5f&page_reverse=False 参数说明请参见表1 表1 参数说明 名称 是否必选 参数类型 说明 id 否 String 按照网络ACL策略对应的ID过滤查询 name 否 String 按照网络ACL策略的名称过滤查询 description 否 String 按照网络ACL策略的描述过滤查询 tenant_id 否 String 按照网络ACL策略所属的项目ID过滤查询 marker 否 String 分页查询的起始资源ID,表示从指定资源的下一条记录开始查询。 marker需要和limit配合使用: 若不传入marker和limit参数,查询结果返回第一页全部资源记录。 若不传入marker参数,limit为10,查询结果返回第1~10条资源记录。 若marker为第10条记录的资源ID,limit为10,查询结果返回第11~20条资源记录。 若marker为第10条记录的资源ID,不传入limit参数,查询结果返回第11条及之后的所有资源记录。 limit 否 Integer 分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。 limit需要和marker配合使用,详细规则请见marker的参数说明。
  • 请求示例 路由器删除接口,路由器id为b625c58c-0cfe-49e0-acc8-f2374f8187ff,子网id为4b910a10-0860-428b-b463-d84dbc5e288e。 PUT https://{Endpoint}/v2.0/routers/b625c58c-0cfe-49e0-acc8-f2374f8187ff/remove_router_interface{"subnet_id": "4b910a10-0860-428b-b463-d84dbc5e288e"}
  • 响应示例 { "subnet_id": "4b910a10-0860-428b-b463-d84dbc5e288e", "tenant_id": "3d72597871904daeb6887f75f848b531", "project_id": "3d72597871904daeb6887f75f848b531", "port_id": "34d7d063-8f40-4958-b420-096db40d4067", "id": "b625c58c-0cfe-49e0-acc8-f2374f8187ff"}
共100000条