查询域名列表¶
1. 接口描述¶
接口请求路径:POST /prod-api/acdn/tcdn/domainRest/describeDomains
describeDomains 用于分页查询当前账号下的国内 TCDN 加速域名列表,支持按域名、状态、加速区域及业务类型筛选。账号需具备 tcdn:DescribeAllDomains 权限。
Token 获取方式见 密钥鉴权。
注意:
searchHeader.status为offline或processing时,服务端会同时匹配这两种状态。
2. 输入参数¶
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| pageNum | 否 | Integer | 当前页。默认值:1。示例值:1 |
| pageSize | 否 | Integer | 每页条数。默认值:10。示例值:10 |
| filters | 否 | [SearchFilter] | 搜索条件列表 |
| searchHeader | 否 | SearchHeader | 表头筛选 |
3. 输出参数¶
| 参数名称 | 类型 | 描述 |
|---|---|---|
| code | Integer | 状态码。示例值:200 |
| msg | String | 提示信息。示例值:success |
| total | Integer | 域名总条数。示例值:2 |
| rows | [TCDNDescribeDomains] | 当前页域名列表 |
4. 示例¶
示例1 分页查询域名列表¶
输入示例¶
{
"pageNum": 1,
"pageSize": 10,
"filters": [
{
"label": "domain",
"value": ["lw111.demo.com"]
}
],
"searchHeader": {
"status": "offline",
"area": "mainland",
"serviceType": "web"
}
}
代码调用¶
请将 {登录域名}、token 替换为实际值。
curl -X POST 'https://{登录域名}/prod-api/acdn/tcdn/domainRest/describeDomains' \
-H 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.xxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"pageNum": 1,
"pageSize": 10,
"filters": [
{
"label": "domain",
"value": ["lw111.demo.com"]
}
],
"searchHeader": {
"status": "offline",
"area": "mainland",
"serviceType": "web"
}
}'
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 DescribeDomainsTest {
public static void main(String[] args) throws Exception {
String url = "https://{登录域名}/prod-api/acdn/tcdn/domainRest/describeDomains";
String token = "eyJhbGciOiJIUzUxMiJ9.xxxxxx";
String requestBody = "{"
+ "\"pageNum\":1,"
+ "\"pageSize\":10,"
+ "\"filters\":[{\"label\":\"domain\",\"value\":[\"lw111.demo.com\"]}],"
+ "\"searchHeader\":{\"status\":\"offline\",\"area\":\"mainland\",\"serviceType\":\"web\"}"
+ "}";
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/acdn/tcdn/domainRest/describeDomains"
token := "eyJhbGciOiJIUzUxMiJ9.xxxxxx"
requestBody := []byte(`{
"pageNum": 1,
"pageSize": 10,
"filters": [
{
"label": "domain",
"value": ["lw111.demo.com"]
}
],
"searchHeader": {
"status": "offline",
"area": "mainland",
"serviceType": "web"
}
}`)
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": [
{
"resourceId": "cdn-h9odj4uu",
"appId": 1370897931,
"domain": "lw111.demo.com",
"cname": "",
"status": "offline",
"projectId": 1000006311,
"serviceType": "web",
"createTime": "2025-09-03 14:34:46",
"updateTime": "2025-09-03 14:42:35",
"origin": {
"serverName": "lw111.demoq.com",
"origins": ["1.1.1.1"],
"originType": "ip",
"originPullProtocol": "http"
},
"disable": "normal",
"area": "mainland",
"readonly": "normal",
"product": "cdn",
"parentHost": "",
"oid": "202505271234561329409",
"id": 12,
"tag": []
}
],
"code": 200,
"msg": "success"
}
5. 错误码¶
| HTTP 状态码 / 业务提示 | 描述 |
|---|---|
| 200 | 成功 |
| 401 | 未鉴权或 Token 无效 |
| 403 | 无权限 |
| error code:{0},message:{1} | 上游查询失败,{0} 为错误码,{1} 为原因 |
6. 数据模型¶
SearchFilter¶
搜索条件。label 为 domain 时仅使用 value 的第一个元素。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| label | 是 | String | 搜索字段。取值:domain(加速域名)、tag(资源标签)。示例值:domain |
| value | 是 | Array of String | 搜索值。示例值:["lw111.demo.com"] |
SearchHeader¶
表头筛选。字段均可省略;省略或空字符串表示不按该条件过滤。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| status | 否 | String | 域名状态。取值:online(已启动)、offline(已关闭)、deleted(已删除)、closing(关闭中)、processing(部署中)。示例值:online |
| area | 否 | String | 加速区域。取值:mainland(中国境内)、overseas(中国境外)、global(全球)。示例值:mainland |
| serviceType | 否 | String | 加速业务类型。取值:web(网页)、download(下载)、media(点播)。示例值:web |
TCDNDescribeDomains¶
域名列表项。
| 参数名称 | 类型 | 描述 |
|---|---|---|
| resourceId | String | 域名资源 ID。示例值:cdn-h9odj4uu |
| appId | Long | 应用 ID。示例值:1370897931 |
| domain | String | 加速域名。示例值:lw111.demo.com |
| cname | String | CNAME 接入域名 |
| status | String | 域名状态。取值:online(已启动)、offline(已关闭)、deleted(已删除)、closing(关闭中)、processing(部署中)。示例值:offline |
| projectId | Long | 项目 ID。示例值:1000006311 |
| serviceType | String | 加速业务类型。取值:web(网页)、download(下载)、media(点播)。示例值:web |
| createTime | String | 创建时间。示例值:2025-09-03 14:34:46 |
| updateTime | String | 更新时间。示例值:2025-09-03 14:42:35 |
| origin | Origin | 源站配置 |
| disable | String | 封禁状态。示例值:normal |
| area | String | 加速区域。取值:mainland(中国境内)、overseas(中国境外)、global(全球)。示例值:mainland |
| readonly | String | 只读状态。示例值:normal |
| product | String | 产品标识。示例值:cdn |
| parentHost | String | 父域名 |
| oid | String | 所属套餐号。示例值:202505271234561329409 |
| id | Long | 本地域名记录 ID。未入库时可能为 null。示例值:12 |
| tag | Array of String | 资源标签列表。示例值:[] |
Origin¶
源站配置。
| 参数名称 | 类型 | 描述 |
|---|---|---|
| origins | Array of String | 源站地址列表。示例值:["1.1.1.1"] |
| originType | String | 源站类型,如 ip、domain、cos。示例值:ip |
| serverName | String | 回源 Host。示例值:lw111.demoq.com |
| originPullProtocol | String | 回源协议,如 http、https、follow。示例值:http |