功能介紹
創(chuàng)建網(wǎng)絡(luò)ACL規(guī)則。
調(diào)試
您可以在API Explorer中調(diào)試該接口。
URI
POST /v2.0/fwaas/firewall_rules
請求參數(shù)
|
屬性 |
是否必選 |
類型 |
約束 |
說明 |
|---|---|---|---|---|
|
name |
否 |
String |
最長255個(gè)字符 |
網(wǎng)絡(luò)ACL規(guī)則名稱。 使用說明:最長255個(gè)字符 |
|
description |
否 |
String |
最長255個(gè)字符 |
網(wǎng)絡(luò)ACL規(guī)則描述。 使用說明:最長255個(gè)字符 |
|
protocol |
否 |
String |
支持TCP,UDP,ICMP, ICMPV6 |
IP協(xié)議。 取值范圍:支持TCP,UDP,ICMP, ICMPV6 |
|
source_port |
否 |
String |
位于[1,65535]中一個(gè)整數(shù)或者一段端口范圍a:b |
源端口號或者一段端口范圍。 取值范圍:位于[1,65535]中一個(gè)整數(shù)或者一段端口范圍a:b |
|
destination_port |
否 |
String |
位于[1,65535]中一個(gè)整數(shù)或者一段端口范圍a:b |
目的端口號或者一段端口范圍。 取值范圍:位于[1,65535]中一個(gè)整數(shù)或者一段端口范圍a:b |
|
ip_version |
否 |
Integer |
4/6 |
IP協(xié)議版本。 取值范圍:4、6,分別表示創(chuàng)建ipv4和ipv6。 |
|
source_ip_address |
否 |
String |
N/A |
源地址或者CIDR。 |
|
destination_ip_address |
否 |
String |
N/A |
目的地址或者CIDR。 |
|
action |
否 |
String |
deny/allow |
對通過網(wǎng)絡(luò)ACL的流量執(zhí)行的操作。 取值范圍:deny(拒絕)/allow(允許) |
|
enabled |
否 |
Boolean |
true/false |
是否使能網(wǎng)絡(luò)ACL規(guī)則。 取值范圍:true/false |
請求示例
創(chuàng)建ACL規(guī)則,action為allow,IP協(xié)議為tcp,目的端口為80。
POST https://{Endpoint}/v2.0/fwaas/firewall_rules
{
"firewall_rule": {
"action": "allow",
"enabled": true,
"destination_port": "80",
"protocol": "tcp",
"name": "ALLOW_HTTP"
}
}
響應(yīng)參數(shù)
|
屬性 |
類型 |
說明 |
|---|---|---|
|
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 |
源端口號或者一段端口范圍。 |
|
destination_port |
String |
目的端口號或者一段端口范圍。 |
|
ip_version |
Integer |
IP協(xié)議版本。 |
|
source_ip_address |
String |
源地址或者CIDR。 |
|
destination_ip_address |
String |
目的地址或者CIDR。 |
|
action |
String |
對通過網(wǎng)絡(luò)ACL的流量執(zhí)行的操作。 |
|
enabled |
Boolean |
是否使能網(wǎng)絡(luò)ACL規(guī)則。 |
|
project_id |
String |
項(xiàng)目ID,請參見獲取項(xiàng)目ID。 |
響應(yīng)示例
{
"firewall_rule": {
"protocol": "tcp",
"description": "",
"source_ip_address": null,
"destination_ip_address": null,
"source_port": null,
"destination_port": "80",
"id": "b94acf06-efc2-485d-ba67-a61acf2a7e28",
"name": "ALLOW_HTTP",
"tenant_id": "23c8a121505047b6869edf39f3062712",
"enabled": true,
"action": "allow",
"ip_version": 4,
"public": false,
"project_id": "23c8a121505047b6869edf39f3062712"
}
}
狀態(tài)碼
請參見狀態(tài)碼。
錯(cuò)誤碼
請參見錯(cuò)誤碼。
