功能介绍
查询提交请求的租户有权限操作的所有网络ACL规则信息。单次查询最多返回2000条数据,超过2000后会返回分页标记,分页查询请参见分页查询
调试
您可以在API Explorer中调试该接口。
URI
GET /v2.0/fwaas/firewall_rules
样例:
GET https://{Endpoint}/v2.0/fwaas/firewall_rules?name={firewall_rule_name}&
tenant_id={tenant_id}&public={is_public}&protocol={protocol}&ip_version={ip_version}&
action={action}&enabled={is_enabled}
分页查询样例:
GET https://{Endpoint}/v2.0/fwaas/firewall_rules?limit=2&
marker=2a193015-4a88-4aa1-84ad-d4955adae707&page_reverse=False
名称 |
是否必选 |
参数类型 |
说明 |
---|---|---|---|
id |
否 |
String |
按照网络ACL规则对应的ID过滤查询 |
name |
否 |
String |
按照网络ACL规则的名称过滤查询 |
description |
否 |
String |
按照网络ACL规则的描述过滤查询 |
ip_version |
否 |
Integer |
按照网络ACL规则的IP协议版本过滤查询 取值范围:4,6 |
action |
否 |
String |
按照网络ACL规则的行为过滤查询 取值范围:allow or deny |
enabled |
否 |
Boolean |
按照网络ACL规则是否使能过滤查询 取值范围:true or false |
tenant_id |
否 |
String |
按照网络ACL规则所属的项目ID过滤查询 |
marker |
否 |
String |
分页查询的起始资源ID,表示从指定资源的下一条记录开始查询。 marker需要和limit配合使用:
|
limit |
否 |
Integer |
分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。 limit需要和marker配合使用,详细规则请见marker的参数说明。 |
请求参数
无。
请求示例
GET https://{Endpoint}/v2.0/fwaas/firewall_rules
响应参数
参数名称 |
类型 |
说明 |
---|---|---|
firewall_rules |
firewall rule对象列表,参见表4。单次查询最多返回2000条数据,超过2000后会返回分页标记,分页查询请参见分页查询。 |
|
firewall_rules_links |
只有在使用limit过滤,并且资源个数超过limit或者资源个数超过2000时(limit默认值),该参数的rel和href取值才会显示为next和其对应的link。 |
属性 |
类型 |
说明 |
---|---|---|
id |
String |
网络ACL规则的uuid标识。 |
name |
String |
网络ACL规则名称。 |
description |
String |
网络ACL规则描述。 |
tenant_id |
String |
项目ID |
public |
Boolean |
是否支持跨租户共享。 |
protocol |
String |
IP协议。 |
source_port |
String |
源端口号或者一段端口范围。 |
destination_port |
String |
目的端口号或者一段端口范围。 |
ip_version |
Integer |
IP协议版本。 |
source_ip_address |
String |
源地址或者CIDR。 |
destination_ip_address |
String |
目的地址或者CIDR。 |
action |
String |
对通过网络ACL的流量执行的操作。 |
enabled |
Boolean |
是否使能网络ACL规则。 |
project_id |
String |
项目ID,请参见获取项目ID。 |
响应示例
{
"firewall_rules": [
{
"protocol": "tcp",
"description": "update check parameter",
"source_ip_address": "116.66.184.0/24",
"destination_ip_address": "0.0.0.0/0",
"destination_port": null,
"source_port": null,
"id": "2a193015-4a88-4aa1-84ad-d4955adae707",
"name": "crhfwruleupdate",
"tenant_id": "a1c6f90c94334bd2953d9a61b8031a68",
"project_id": "a1c6f90c94334bd2953d9a61b8031a68",
"enabled": true,
"action": "allow",
"ip_version": 4,
"public": false
},
{
"protocol": "tcp",
"description": "update check parameter",
"source_ip_address": null,
"destination_ip_address": null,
"destination_port": "40:60",
"source_port": "20:50",
"id": "db7a204c-9eb1-40a2-9bd6-ed5cfd3cff32",
"name": "update_firewall-role-tommy",
"tenant_id": "a1c6f90c94334bd2953d9a61b8031a68",
"project_id": "a1c6f90c94334bd2953d9a61b8031a68",
"enabled": false,
"action": "deny",
"ip_version": 4,
"public": false
}
],
"firewall_rules_links": [
{ "rel": "previous",
"href": "https://{Endpoint}/v2.0/fwaas/firewall_rules?
marker=2a193015-4a88-4aa1-84ad-d4955adae707&page_reverse=True"
}
]
}
状态码
请参见状态码。
错误码
请参见错误码。