跳到主要内容

查询防火墙规则

描述

查询防火墙规则,可根据条件查询出多条记录。

请求参数

参数名参数类型是否必填参数说明
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.chinac.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"
}]
}
}