功能介紹
查詢提交請(qǐng)求的租戶有權(quán)限操作的所有網(wǎng)絡(luò)ACL規(guī)則信息。單次查詢最多返回2000條數(shù)據(jù),超過2000后會(huì)返回分頁標(biāo)記,分頁查詢請(qǐng)參見分頁查詢
調(diào)試
您可以在API Explorer中調(diào)試該接口。
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
|
名稱 |
是否必選 |
參數(shù)類型 |
說明 |
|---|---|---|---|
|
id |
否 |
String |
按照網(wǎng)絡(luò)ACL規(guī)則對(duì)應(yīng)的ID過濾查詢 |
|
name |
否 |
String |
按照網(wǎng)絡(luò)ACL規(guī)則的名稱過濾查詢 |
|
description |
否 |
String |
按照網(wǎng)絡(luò)ACL規(guī)則的描述過濾查詢 |
|
ip_version |
否 |
Integer |
按照網(wǎng)絡(luò)ACL規(guī)則的IP協(xié)議版本過濾查詢 取值范圍:4,6 |
|
action |
否 |
String |
按照網(wǎng)絡(luò)ACL規(guī)則的行為過濾查詢 取值范圍:allow or deny |
|
enabled |
否 |
Boolean |
按照網(wǎng)絡(luò)ACL規(guī)則是否使能過濾查詢 取值范圍:true or false |
|
tenant_id |
否 |
String |
按照網(wǎng)絡(luò)ACL規(guī)則所屬的項(xiàng)目ID過濾查詢 |
|
marker |
否 |
String |
分頁查詢的起始資源ID,表示從指定資源的下一條記錄開始查詢。 marker需要和limit配合使用:
|
|
limit |
否 |
Integer |
分頁查詢每頁返回的記錄個(gè)數(shù),取值范圍為0~intmax(2^31-1),默認(rèn)值2000。 limit需要和marker配合使用,詳細(xì)規(guī)則請(qǐng)見marker的參數(shù)說明。 |
請(qǐng)求參數(shù)
無。
請(qǐng)求示例
GET https://{Endpoint}/v2.0/fwaas/firewall_rules
響應(yīng)參數(shù)
|
參數(shù)名稱 |
類型 |
說明 |
|---|---|---|
|
firewall_rules |
firewall rule對(duì)象列表,參見表4。單次查詢最多返回2000條數(shù)據(jù),超過2000后會(huì)返回分頁標(biāo)記,分頁查詢請(qǐng)參見分頁查詢。 |
|
|
firewall_rules_links |
只有在使用limit過濾,并且資源個(gè)數(shù)超過limit或者資源個(gè)數(shù)超過2000時(shí)(limit默認(rèn)值),該參數(shù)的rel和href取值才會(huì)顯示為next和其對(duì)應(yīng)的link。 |
|
屬性 |
類型 |
說明 |
|---|---|---|
|
id |
String |
網(wǎng)絡(luò)ACL規(guī)則的uuid標(biāo)識(shí)。 |
|
name |
String |
網(wǎng)絡(luò)ACL規(guī)則名稱。 |
|
description |
String |
網(wǎng)絡(luò)ACL規(guī)則描述。 |
|
tenant_id |
String |
項(xiàng)目ID |
|
public |
Boolean |
是否支持跨租戶共享。 |
|
protocol |
String |
IP協(xié)議。 |
|
source_port |
String |
源端口號(hào)或者一段端口范圍。 |
|
destination_port |
String |
目的端口號(hào)或者一段端口范圍。 |
|
ip_version |
Integer |
IP協(xié)議版本。 |
|
source_ip_address |
String |
源地址或者CIDR。 |
|
destination_ip_address |
String |
目的地址或者CIDR。 |
|
action |
String |
對(duì)通過網(wǎng)絡(luò)ACL的流量執(zhí)行的操作。 |
|
enabled |
Boolean |
是否使能網(wǎng)絡(luò)ACL規(guī)則。 |
|
project_id |
String |
項(xiàng)目ID,請(qǐng)參見獲取項(xiàng)目ID。 |
響應(yīng)示例
{
"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"
}
]
}
狀態(tài)碼
請(qǐng)參見狀態(tài)碼。
錯(cuò)誤碼
請(qǐng)參見錯(cuò)誤碼。
