查询策略组列表¶
1. 接口描述¶
接口请求路径:POST /prod-api/waf/nlaV1/basic/describeNlaACLs
describeNlaACLs 用于分页查询当前账号下的 HTTP DDoS(NLA)策略组列表,支持按策略组名称、套餐号、备注筛选,并返回关联域名信息。
Token 获取方式见 密钥鉴权。
2. 输入参数¶
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| pageNum | 是 | Integer | 当前页数 示例值: 1 |
| pageSize | 是 | Integer | 每页显示条目个数 示例值: 10 |
| oid | 否 | String | 按套餐号过滤 示例值: 20240412279097884616 |
| filters | 否 | Array | 搜索条件列表 |
| filters.label | 否 | String | 搜索字段,支持以下值:aclName:策略组名称oid:套餐号remark:备注示例值: aclName |
| filters.value | 否 | Array of String | 搜索值。传入单个值为模糊搜索,多个值为精确搜索 示例值: ["酷酷酷"] |
3. 示例¶
示例1 分页查询策略组¶
输入示例¶
代码调用¶
请将 {登录域名}、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 DescribeNlaACLsTest {
public static void main(String[] args) throws Exception {
String url = "https://{登录域名}/prod-api/waf/nlaV1/basic/describeNlaACLs";
String token = "eyJhbGciOiJIUzUxMiJ9.xxxxxx";
String requestBody = "{\"pageNum\":1,\"pageSize\":10}";
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/nlaV1/basic/describeNlaACLs"
token := "eyJhbGciOiJIUzUxMiJ9.xxxxxx"
requestBody := []byte(`{
"pageNum": 1,
"pageSize": 10
}`)
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": 2,
"rows": [
{
"aclId": 74,
"aclName": "酷酷酷",
"aclStatus": "On",
"oid": "20240412279097884616",
"updateTime": "2026-03-03 13:54:20",
"remark": null,
"domainIds": [215, 233, 235],
"associatedDomainName": [
{
"domainId": 215,
"domainName": "waf2.demo.com",
"port": 0
}
]
},
{
"aclId": 73,
"aclName": "012",
"aclStatus": "DetectionOnly",
"oid": "20240412279097884616",
"updateTime": "2025-11-13 17:03:02",
"remark": null,
"domainIds": [522, 635],
"associatedDomainName": [
{
"domainId": 522,
"domainName": "waf.demo.com",
"port": 0
}
]
}
],
"code": 200,
"msg": "成功"
}
4. 输出参数¶
| 参数名称 | 类型 | 描述 |
|---|---|---|
| code | Integer | 状态码。示例值:200 |
| msg | String | 提示信息。示例值:成功 |
| total | Integer | 符合条件的总条数。示例值:2 |
| rows | Array | 策略组列表 |
| rows[].aclId | Long | 策略组 ID。示例值:74 |
| rows[].aclName | String | 策略组名称。示例值:酷酷酷 |
| rows[].aclStatus | String | 策略组状态,支持以下值:On:启用Off:关闭DetectionOnly:仅记录示例值: On |
| rows[].oid | String | 所属套餐号。示例值:20240412279097884616 |
| rows[].updateTime | String | 更新时间,格式 yyyy-MM-dd HH:mm:ss示例值: 2026-03-03 13:54:20 |
| rows[].remark | String | 备注;可能为空 |
| rows[].domainIds | Array of Long | 关联域名 ID 列表。示例值:[215, 233, 235] |
| rows[].associatedDomainName | Array | 关联域名详情列表 |
| rows[].associatedDomainName[].domainId | Long | 域名 ID。示例值:215 |
| rows[].associatedDomainName[].domainName | String | 域名。示例值:waf2.demo.com |
| rows[].associatedDomainName[].port | Integer | 端口。示例值:0 |
5. 错误码¶
| HTTP 状态码 / 业务提示 | 描述 |
|---|---|
| 200 | 成功 |
| 401 | 未鉴权或 Token 无效 |
| 403 | 无权限 |
| 参数异常 | filters.label 不是 aclName / oid / remark |