防火墙规则列表

更新时间:2019-06-04 14:41:47

描述

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

请求参数

参数名参数类型是否必填参数说明
ActionString

操作方法

RegionString

机房标识,取值参见地域列表

OffsetInteger

记录偏移量,默认取 0

CountInteger

记录数量,默认为全部

FirewallRuleString

防火墙规则ID

Firewall.NString

防火墙Id,支持批量,N为自然数,格式:&Firewall.0=xxx0&Firewall.1=xxx1

返回参数

名称 类型 说明
Action String 执行的操作
TaskId String 请求标识
TotalCount Integer 过滤条件下总共记录数
FirewallRuleSet FirewallRuleType 由FirewallRuleType组成的数组格式,返回防火墙规则列表

FirewallRuleType 节点

防火墙规则的数据类型

名称 类型 说明
Id String 防火墙规则标识
FirewallId String 防火墙ID
Name String 名称
Direction String 方向:ingress,egress
PortStart Integer 开始端口
PortEnd Integer 结束端口
Protocol String 协议:TCP,UDP,ICMP
Priority Integer 优先级
RemoteIpPrefix String 允许的 IP 地址范围
Enabled Boolean 是否启用

请求示例

https://api.chinac.com/v2/?Action=DescribeFirewalls
&Region=cn-wuxi1
&<公共请求参数>

返回示例

旧版只返回data里面的数据

{
    "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"
        }]
    }
}
*
*