跳到主要内容

查詢防火牆規則

描述

查詢防火牆規則,可根據條件查詢出多條記錄。

請求引數

引數名引數型別是否必填引數說明
ActionString操作方法:DescribeFirewallRules
RegionString機房標識,取值參見地域列表
OffsetInteger記錄偏移量,預設取 0
CountInteger記錄數量,預設為全部
FirewallRuleString防火牆規則ID
Firewall.NString防火牆Id,支援批次,N為自然數,格式:&Firewall.0=xxx0&Firewall.1=xxx1

返回引數

名稱型別說明
ActionString執行的操作
TaskIdString請求標識
TotalCountInteger過濾條件下總共記錄數
FirewallRuleSetFirewallRuleType由FirewallRuleType組成的陣列格式,返回防火牆規則列表

FirewallRuleType

防火牆規則的資料型別

名稱型別說明
IdString防火牆規則標識
FirewallIdString防火牆ID
NameString名稱
DirectionString方向:ingress,egress
PortStartInteger開始埠
PortEndInteger結束埠
ProtocolString協議:TCP,UDP,ICMP
PriorityInteger優先順序
RemoteIpPrefixString允許的 IP 地址範圍
EnabledBoolean是否啟用

請求示例

https://api.yunpanel.com/v2/?Action=DescribeFirewalls
&Region=cn-wuxi1
&<公共請求引數>

返回示例

{
"code": 10000,
"message": "",
"data": {
"TaskId": "mirroriuc11520170510094042491",
"Action": "DescribeFirewallRules",
"TotalCount": 5,
"FirewallRuleSet": [{
"Id": "fr-099ih3ke4g85n",
"Name": "HTTP",
"Uuid": null,
"FirewallId": "f-1r9ih3ke3g112",
"Direction": "ingress",
"PortStart": 80,
"PortEnd": 80,
"Protocol": "TCP",
"Priority": 4,
"RemoteIpPrefix": "0.0.0.0/0",
"Enabled": "true",
"UserId": "18359229",
"IdLong": "fr-099ih3ke4g85n-c90fb02e-cf17-4bc6-8796-fde90a6153d3"
},
{
"Id": "fr-z59ih3ke4934k",
"Name": "Linux SSH",
"Uuid": null,
"FirewallId": "f-1r9ih3ke3g112",
"Direction": "ingress",
"PortStart": 22,
"PortEnd": 22,
"Protocol": "TCP",
"Priority": 3,
"RemoteIpPrefix": "0.0.0.0/0",
"Enabled": "true",
"UserId": "18359229",
"IdLong": "fr-z59ih3ke4934k-cbad1104-c669-45eb-956c-423d14110fdf"
},
{
"Id": "fr-9i9ih3ke4174n",
"Name": "windows遠端桌面",
"Uuid": null,
"FirewallId": "f-1r9ih3ke3g112",
"Direction": "ingress",
"PortStart": 3389,
"PortEnd": 3389,
"Protocol": "TCP",
"Priority": 2,
"RemoteIpPrefix": "0.0.0.0/0",
"Enabled": "true",
"UserId": "18359229",
"IdLong": "fr-9i9ih3ke4174n-ddd761b1-3e41-4540-8b94-396d92a78352"
},
{
"Id": "fr-0s9ih3ke4u71",
"Name": "PING",
"Uuid": null,
"FirewallId": "f-1r9ih3ke3g112",
"Direction": "ingress",
"PortStart": 8,
"PortEnd": 0,
"Protocol": "ICMP",
"Priority": 1,
"RemoteIpPrefix": "0.0.0.0/0",
"Enabled": "true",
"UserId": "18359229",
"IdLong": "fr-0s9ih3ke4u71-cbd1459d-dec1-444b-a89b-b1a2a11cb899"
},
{
"Id": "fr-l29ih3ke4i40a",
"Name": "651uy20170420144018",
"Uuid": null,
"FirewallId": "f-1r9ih3ke3g112",
"Direction": "egress",
"PortStart": null,
"PortEnd": null,
"Protocol": "ALL",
"Priority": 1,
"RemoteIpPrefix": "0.0.0.0/0",
"Enabled": "true",
"UserId": "18359229",
"IdLong": "fr-l29ih3ke4i40a-ecc7f573-d12f-405e-a245-944e4a1879e3"
}]
}
}