
# 批量查询域名的统计明细-按域名单独返回
#### 功能介绍
- 支持查询90天内的数据。
- 查询跨度不能超过7天。
- 最多同时指定100个域名。
- 起始时间和结束时间，左闭右开，需要同时指定。
- 开始时间、结束时间必须传毫秒级时间戳，且必须为5分钟整时刻点，如：0分、5分、10分、15分等，如果传的不是5分钟时刻点，返回数据可能与预期不一致。
- 统一用开始时间表示一个时间段，如：2019-01-24 20:15:00 表示取 \[20:15:00, 20:20:00)的统计数据，且左闭右开。
- 流量类指标单位统一为Byte（字节）、带宽类指标单位统一为bit/s（比特/秒）、请求数类指标单位统一为次数。用于查询指定域名、指定统计指标的明细数据。
- 如果传的是多个域名，则每个域名的数据分开返回。
- 支持同时查询多个指标，不超过10个。
 
#### URI
GET /v1.0/cdn/statistics/domain-item-details
表1Query参数 
| 参数                    | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|:---|:---|:---|:---|
| enterprise_project_id | 否    | String | 当用户开启企业项目功能时，该参数生效，表示查询资源所属项目，"all"表示所有项目。注意：当使用子账号调用接口时，该参数必传。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| start_time            | 是    | Long   | 查询起始时间戳，必须设为5分钟整时刻点                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| end_time              | 是    | Long   | 查询结束时间戳，必须设为5分钟整时刻点                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| domain_name           | 是    | String | 域名列表，多个域名以逗号（半角）分隔，如：www.test1.com,www.test2.com，all表示查询名下全部域名                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| service_area          | 否    | String | mainland_china(中国大陆)，outside_mainland_china(中国大陆境外)，默认为mainland_china。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| stat_type             | 是    | String | 网络资源消耗： - bw（带宽）  - flux（流量）  - bs_bw(回源带宽)  - bs_flux（回源流量）   访问情况： - req_num（请求总数）  - hit_num（请求命中次数）  - bs_num(回源总数)  - bs_fail_num(回源失败数)  - hit_flux（命中流量）   HTTP状态码（组合指标）： - http_code_2xx(状态码汇总2xx)  - http_code_3xx(状态码汇总3xx)  - http_code_4xx(状态码汇总4xx)  - http_code_5xx(状态码汇总5xx)  - bs_http_code_2xx（回源状态码汇总2xx）  - bs_http_code_3xx（回源状态码汇总3xx）  - bs_http_code_4xx（回源状态码汇总4xx）  - bs_http_code_5xx（回源状态码汇总5xx）  - status_code_2xx（状态码详情2xx）  - status_code_3xx（状态码详情3xx）  - status_code_4xx（状态码详情4xx）  - status_code_5xx（状态码详情5xx）  - bs_status_code_2xx（回源状态码详情2xx）  - bs_status_code_3xx（回源状态码详情3xx）  - bs_status_code_4xx（回源状态码详情4xx）  - bs_status_code_5xx（回源状态码详情5xx）  - status_code和bs_status_code不能一起查询，否则数据会不准确，status_code不支持指定服务区域   |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                     |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。 通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
   
#### 响应参数
**状态码： 200**
表3响应Body参数 
| 参数                  | 参数类型                                                               | 描述       |
|:---|:---|:---|
| domain_item_details | [DomainItemDetail] object | 域名详情数据列表 |
   
 表4DomainItemDetail 
| 参数         | 参数类型                                  | 描述                           |
|:---|:---|:---|
| start_time | Long                                  | 数据起始时间戳，可能与请求时间不一致           |
| end_time   | Long                                  | 数据结束时间戳，可能与请求时间不一致           |
| stat_type  | String                                | 指标类型                         |
| domains    | Array of Map\<String,Object\> objects | 指标统计数据列表，如果该时间段内无值，则为空数组\[\] |
   
#### 请求示例
```
GET https://cdn.myhuaweicloud.com/v1.0/cdn/statistics/domain-item-details?start_time=1515996000000&end_time=1515999600000&domain_name=www.test1.com,www.test2.com&stat_type=flux
```
#### 响应示例
**状态码： 200**
OK
```
{
  "domain_item_details" : {
    "start_time" : 1515996000000,
    "end_time" : 1515999600000,
    "stat_type" : "flux",
    "domains" : [ {
      "domain_name" : "www.test1.com",
      "flux" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
    }, {
      "domain_name" : "www.test2.com",
      "flux" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
    } ]
  }
}
```
#### 状态码
| 状态码 | 描述 |
|:---|:---|
| 200 | OK |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-cdn/ErrorCode.html)。
