
# 查询网络ACL详情 - ShowFirewall
#### 功能介绍
查询网络ACL详情。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/IEC/doc?api=ShowFirewall)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-iec/iec_05_0600.html)。
#### URI
GET /v1/firewalls/{firewall_id}
表1路径参数 
| 参数          | 是否必选 | 参数类型   | 描述       |
|:---|:---|:---|:---|
| firewall_id | 是    | String | 网络ACL ID |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                        |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。 通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数       | 参数类型                                                | 描述       |
|:---|:---|:---|
| firewall | [Firewall] object | 网络ACL对象。 |
   
 表4Firewall 
| 参数                          | 参数类型                                                                    | 描述                                                                         |
|:---|:---|:---|
| id                          | String                                                                  | 网络ACL ID                                                                   |
| name                        | String                                                                  | 网络ACL名称。                                                                   |
| admin_state_up              | Boolean                                                                 | 网络ACL使能开关。 取值范围：true（开启），false（关闭）。默认为true |
| status                      | String                                                                  | 网络ACL状态。 取值范围：INACTIVE                     |
| description                 | String                                                                  | 网络ACL描述。                                                                   |
| domain_id                   | String                                                                  | 租户domainID                                                                 |
| egress_firewall_policy      | [FirewallPolicyResp] object | 出方向网络ACL策略。 创建或查询防火墙列表时只返回ACL策略ID。         |
| egress_firewall_rule_count  | Integer                                                                 | 出方向网络ACL规则个数。                                                              |
| ingress_firewall_policy     | [FirewallPolicyResp] object | 入方向网络ACL策略。 创建或查询防火墙列表时只返回ACL策略ID。         |
| ingress_firewall_rule_count | Integer                                                                 | 入方向网络ACL规则个数。                                                              |
   
 表5FirewallPolicyResp 
| 参数             | 参数类型                                                                          | 描述                         |
|:---|:---|:---|
| id             | String                                                                        | 网络ACL策略ID。                 |
| name           | String                                                                        | 网络ACL策略名称。                 |
| firewall_rules | Array of [FirewallRuleResp] objects | 网络ACL规则列表对象。               |
| insert_after   | String                                                                        | ACL规则ID，表示在此ACL规则之后添加ACL规则 |
| insert_before  | String                                                                        | ACL规则ID，表示在此ACL规则之前添加ACL规则 |
   
 表6FirewallRuleResp 
| 参数                     | 参数类型    | 描述                                                                                                                                     |
|:---|:---|:---|
| action                 | String  | 策略是否允许 取值范围：allow，deny，reject                                                                          |
| description            | String  | 网络ACL规则描述。                                                                                                                             |
| destination_ip_address | String  | 目的地IP地址，IPv4或IPv6的CIDR格式                                                                                                               |
| destination_port       | String  | 目的地端口范围 取值范围：整数，比如80，或者以"-"隔开的范围，比如80-90                                                               |
| enabled                | Boolean | 网络ACL规则使能开关。 取值范围：true，false                                                                           |
| id                     | String  | 网络ACL规则ID。 进行更新规则时，如果operate_type为add，则该值为空。                                                           |
| ip_version             | Integer | IP协议版本 取值范围：4, 表示ipv4；6, 表示ipv6                                                                        |
| name                   | String  | 网络ACL规则名称。                                                                                                                             |
| operate_type           | String  | 网络ACL规则操作状态，作为请求时取值为"add"/"modify"/"delete"，作为返回值时为"normal"。 当请求更新规则时，本参数值为delete时，除id之外，本请求体其他参数均可为空。 |
| protocol               | String  | IP协议，为any时代表所有协议 取值范围： icmp，tcp，udp，icmpv6，any                         |
| source_ip_address      | String  | 源IP地址，IPv4或IPv6的CIDR格式                                                                                                                 |
| source_port            | String  | 源地端口范围 取值范围：整数，比如80，或者以"-"隔开的范围，比如80-90                                                                |
   
#### 请求示例
```
GET https://{endpoint}/v1/firewalls/c2c5234b-67ff-11ea-a41a-00e04c9bd2a3
```
#### 响应示例
**状态码：200**
OK
```
{
  "firewall" : {
    "id" : "c2c5234b-67ff-11ea-a41a-00e04c9bd2a3",
    "domain_id" : "2b76febbe5d34eac85d26435c1f15809",
    "name" : "test",
    "description" : "test",
    "admin_state_up" : true,
    "status" : "INACTIVE",
    "ingress_firewall_policy" : {
      "id" : "dd1b46d8-bff8-41d5-b79d-b96c300371d7",
      "name" : "ingress_firewall_policy",
      "firewall_rules" : [ {
        "id" : "1d49edb1-6845-11ea-95d5-00e04c9bd2a3",
        "name" : "test",
        "description" : "test",
        "enabled" : true,
        "action" : "allow",
        "protocol" : "tcp",
        "ip_version" : 4,
        "destination_ip_address" : "0.0.0.0/12",
        "destination_port" : "443",
        "source_ip_address" : "0.0.0.0/24",
        "source_port" : "35",
        "operate_type" : "normal"
      } ]
    },
    "egress_firewall_policy" : {
      "id" : "55821488-d69b-596c-b529-9c5e16734811",
      "name" : "egress_firewall_policy",
      "firewall_rules" : [ {
        "id" : "5cb41787-6804-11ea-a41a-00e04c9bd2a3",
        "name" : "testt",
        "description" : "testt",
        "enabled" : true,
        "action" : "allow",
        "protocol" : "tcp",
        "ip_version" : 4,
        "destination_ip_address" : "0.0.0.0/12",
        "destination_port" : "443",
        "source_ip_address" : "0.0.0.0/24",
        "source_port" : "35",
        "operate_type" : "normal"
      } ]
    }
  }
}
```
#### 状态码
| 状态码 | 描述 |
|:---|:---|
| 200 | OK |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-iec/ErrorCode.html)。
