查询域名列表¶
1. 接口描述¶
接口请求路径:POST /prod-api/multiCdn/domain/describeCdnDomains
describeCdnDomains 用于分页查询当前账号下的 CDN 域名列表,支持按域名、套餐、源站地址等条件筛选。
Token 获取方式见 密钥鉴权。
2. 输入参数¶
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| pageNum | 是 | Integer | 当前页数 示例值: 1 |
| pageSize | 是 | Integer | 每页显示条目个数 示例值: 10 |
| filters | 否 | Array | 搜索条件列表 |
| filters.label | 否 | String | 搜索字段。取值:domain(域名)、oid(套餐)、originRecord(源站地址)示例值: oid |
| filters.value | 否 | Array of String | 搜索值。传入单个值为模糊搜索,多个值为精确搜索 示例值: ["2022082123456"] |
| searchHeader | 否 | Object | 筛选条件 |
| searchHeader.status | 否 | String | 状态。取值:enable(启用)、disable(禁用)示例值: enable |
| searchHeader.region | 否 | String | 地区。取值:chinese_mainland(中国大陆)、outside_chinese_mainland(中国大陆以外)、global(全球)、indonesia(印度尼西亚)、none(无区域)示例值: chinese_mainland |
3. 示例¶
示例1 分页查询域名列表¶
输入示例¶
{
"filters": [
{
"label": "oid",
"value": ["2022082123456"]
}
],
"searchHeader": {
"status": "enable",
"region": "chinese_mainland"
},
"pageSize": 10,
"pageNum": 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 DescribeCdnDomainsTest {
public static void main(String[] args) throws Exception {
String url = "https://{登录域名}/prod-api/multiCdn/domain/describeCdnDomains";
String token = "eyJhbGciOiJIUzUxMiJ9.xxxxxx";
String requestBody = "{"
+ "\"filters\":[{"
+ "\"label\":\"oid\","
+ "\"value\":[\"2022082123456\"]"
+ "}],"
+ "\"searchHeader\":{"
+ "\"status\":\"enable\","
+ "\"region\":\"chinese_mainland\""
+ "},"
+ "\"pageSize\":10,"
+ "\"pageNum\":1"
+ "}";
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/multiCdn/domain/describeCdnDomains"
token := "eyJhbGciOiJIUzUxMiJ9.xxxxxx"
requestBody := []byte(`{
"filters": [
{
"label": "oid",
"value": ["2022082123456"]
}
],
"searchHeader": {
"status": "enable",
"region": "chinese_mainland"
},
"pageSize": 10,
"pageNum": 1
}`)
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": [
{
"domainGrnId": "grn:test:multi-cdn:001:domain/01234565d940e553de8e",
"domain": "lwtest3.demo.com",
"cname": "lwtest3.demo.com.tezhengku.com",
"origins": {
"httpOriginPort": 80,
"httpsOriginPort": 443,
"originGroupGrnId": "grn:test:multi-cdn:001:origin/174c12cc214bf7d0020fc48461",
"originProtocol": "http",
"originRecords": [
{
"record": "lwtest1.com",
"weight": 0
}
]
},
"region": "chinese_mainland",
"status": "enable",
"updateTime": "2025-12-16 10:21:55",
"oid": "20250812332409"
}
],
"code": 200,
"msg": "成功"
}
4. 输出参数¶
| 参数名称 | 类型 | 描述 |
|---|---|---|
| code | Integer | 状态码。示例值:200 |
| msg | String | 提示信息。示例值:成功 |
| total | Integer | 域名总条数。示例值:2 |
| rows | Array | 当前页域名列表 |
| rows[].domainGrnId | String | 域名唯一 ID |
| rows[].domain | String | 域名 |
| rows[].cname | String | CNAME 记录 |
| rows[].origins | Object | 源站配置 |
| rows[].origins.httpOriginPort | Integer | HTTP 回源端口。示例值:80 |
| rows[].origins.httpsOriginPort | Integer | HTTPS 回源端口。示例值:443 |
| rows[].origins.originGroupGrnId | String | 源站组 ID |
| rows[].origins.originProtocol | String | 回源协议 |
| rows[].origins.originRecords | Array | 源站记录列表。元素含 record(地址)、weight(权重) |
| rows[].region | String | 地区。取值:chinese_mainland、outside_chinese_mainland、global、indonesia、none |
| rows[].status | String | 状态。取值:enable(启用)、disable(禁用) |
| rows[].updateTime | String | 更新时间。示例值:2025-12-16 10:21:55 |
| rows[].oid | String | 套餐 ID |
5. 错误码¶
| HTTP 状态码 / 业务提示 | 描述 |
|---|---|
| 200 | 成功 |
| 401 | 未鉴权或 Token 无效 |
| 403 | 无权限 |