跳转至

查询策略组列表

1. 接口描述

接口请求路径:POST /prod-api/waf/wafv3/acl/describeWebACLs

describeWebACLs 用于分页查询指定套餐下的 Web 应用防火墙(WAF 3.0)策略组列表,支持按策略组名称、备注筛选,并返回关联域名信息。

Token 获取方式见 密钥鉴权

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
pageNum Integer 当前页数
示例值:1
pageSize Integer 每页显示条目个数
示例值:10
oid String 套餐号
示例值:20240412279097884616
filters Array 搜索条件列表
filters.label String 搜索字段,支持以下值:
aclName:策略组名称
remark:备注
示例值:aclName
filters.value Array of String 搜索值。传入单个值为模糊搜索,多个值为精确搜索
示例值:["WAF策略组"]

3. 示例

示例1 分页查询策略组

输入示例

{
  "pageNum": 1,
  "pageSize": 10,
  "oid": "20240412279097884616"
}

代码调用

请将 {登录域名}token 替换为实际值。

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class DescribeWebACLsTest {

    public static void main(String[] args) throws Exception {
        String url = "https://{登录域名}/prod-api/waf/wafv3/acl/describeWebACLs";
        String token = "eyJhbGciOiJIUzUxMiJ9.xxxxxx";

        String requestBody = "{"
                + "\"pageNum\":1,"
                + "\"pageSize\":10,"
                + "\"oid\":\"20240412279097884616\""
                + "}";

        try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
            HttpPost httpPost = new HttpPost(url);
            httpPost.setHeader("Authorization", "Bearer " + token);
            httpPost.setEntity(new StringEntity(requestBody, ContentType.APPLICATION_JSON));

            try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
                int statusCode = response.getStatusLine().getStatusCode();
                String body = EntityUtils.toString(response.getEntity(), "UTF-8");
                System.out.println("Status Code: " + statusCode);
                System.out.println("Body: " + body);
            }
        }
    }
}
package main

import (
    "bytes"
    "fmt"
    "io"
    "net/http"
)

func main() {
    url := "https://{登录域名}/prod-api/waf/wafv3/acl/describeWebACLs"
    token := "eyJhbGciOiJIUzUxMiJ9.xxxxxx"

    requestBody := []byte(`{
  "pageNum": 1,
  "pageSize": 10,
  "oid": "20240412279097884616"
}`)

    req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(requestBody))
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer "+token)
    req.Header.Set("Content-Type", "application/json")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }
    fmt.Println("Status Code:", resp.StatusCode)
    fmt.Println("Body:", string(body))
}

输出示例

{
  "total": 3,
  "rows": [
    {
      "wafId": 23,
      "aclName": "huijjj",
      "aclStatus": "DetectionOnly",
      "paranoiaLevel": "balanced",
      "oid": "20240412279097884616",
      "updateTime": "2025-10-14 15:18:51",
      "remark": null,
      "domainIds": [],
      "associatedDomainName": null
    },
    {
      "wafId": 22,
      "aclName": "WAF策略组",
      "aclStatus": "DetectionOnly",
      "paranoiaLevel": "strict",
      "oid": "20240412279097884616",
      "updateTime": "2025-12-30 11:18:45",
      "remark": "1234656565454",
      "domainIds": [215, 219, 233],
      "associatedDomainName": [
        {
          "domainId": 215,
          "domainName": "waf2.ruisuyun.com",
          "port": 0
        },
        {
          "domainId": 219,
          "domainName": "gbp.gloria.com.cn",
          "port": 21000
        },
        {
          "domainId": 233,
          "domainName": "lwtest.ruisuyun.com",
          "port": 0
        }
      ]
    }
  ],
  "code": 200,
  "msg": "成功"
}

4. 输出参数

参数名称 类型 描述
code Integer 状态码。示例值:200
msg String 提示信息。示例值:成功
total Integer 符合条件的总条数。示例值:3
rows Array 策略组列表
rows[].wafId Long 策略组 ID。示例值:23
rows[].aclName String 策略组名称。示例值:huijjj
rows[].aclStatus String 策略组状态,支持以下值:
On:启用
Off:关闭
DetectionOnly:仅记录
示例值:DetectionOnly
rows[].paranoiaLevel String 防护等级,支持以下值:
lenient:宽松模式
balanced:平衡模式
strict:严格模式
示例值:balanced
rows[].oid String 所属套餐号。示例值:20240412279097884616
rows[].updateTime String 更新时间,格式 yyyy-MM-dd HH:mm:ss
示例值:2025-10-14 15:18:51
rows[].remark String 备注;可能为空
rows[].domainIds Array of Long 关联域名 ID 列表。示例值:[215, 219, 233]
rows[].associatedDomainName Array 关联域名详情列表;无关联时可能为 null
rows[].associatedDomainName[].domainId Long 域名 ID。示例值:215
rows[].associatedDomainName[].domainName String 域名。示例值:waf2.ruisuyun.com
rows[].associatedDomainName[].port Integer 端口。示例值:0

5. 错误码

HTTP 状态码 / 业务提示 描述
200 成功
401 未鉴权或 Token 无效
403 无权限
oid不能为空 未传 oid
参数异常 filters.label 不是 aclName / remark