
# 批量查询域名的区域、运营商统计明细-按域名单独返回
#### 功能介绍
- 支持查询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-location-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表示查询名下全部域名                                                                                                                                                                                                         |
| stat_type             | 是    | String | 指标类型列表 网络资源消耗：bw（带宽），flux（流量），ipv6_bw(ipv6带宽)，ipv6_flux(ipv6流量), https_bw(https带宽)，https_flux(https流量) 访问情况：req_num（请求总数），hit_num（请求命中次数），req_time(请求时长) HTTP状态码（组合指标）：status_code_2xx(状态码2xx)，status_code_3xx(状态码3xx)，status_code_4xx(状态码4xx)，status_code_5xx(状态码5xx) |
| region                | 是    | String | 区域列表，以逗号分隔，all表示查询全部区域                                                                                                                                                                                                                                                 |
| isp                   | 是    | String | 运营商列表，以逗号分隔，all表示查询全部运营商                                                                                                                                                                                                                                               |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                        |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。 通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
   
#### 响应参数
**状态码： 200**
表3响应Body参数 
| 参数                           | 参数类型                                                                                 | 描述       |
|:---|:---|:---|
| domain_item_location_details | [DomainItemLocationDetails] object | 域名详情数据列表 |
   
 表4DomainItemLocationDetails 
| 参数         | 参数类型                                                                 | 描述                 |
|:---|:---|:---|
| start_time | Long                                                                 | 数据起始时间戳，可能与请求时间不一致 |
| end_time   | Long                                                                 | 数据结束时间戳，可能与请求时间不一致 |
| stat_type  | String                                                               | 指标类型               |
| domains    | Array of [DomainRegion] objects | 域名详情数据列表           |
   
 表5DomainRegion 
| 参数                 | 参数类型                                  | 描述                           |
|:---|:---|:---|
| domain_name        | String                                | 域名                           |
| region_isp_details | Array of Map\<String,Object\> objects | 指标统计数据列表，如果该时间段内无值，则为空数组\[\] |
   
#### 请求示例
```
GET https://cdn.myhuaweicloud.com/v1.0/cdn/statistics/domain-item-location-details?start_time=1515996000000&end_time=1515999600000&domain_name=www.test1.com,www.test2.com&stat_type=flux&region=sichuan,guizhou&isp=dianxin
```
#### 响应示例
**状态码： 200**
OK
```
{
  "domain_item_location_details" : {
    "start_time" : 1515996000000,
    "end_time" : 1515999600000,
    "stat_type" : "flux",
    "domains" : [ {
      "domain_name" : "www.test1.com",
      "region_isp_details" : [ {
        "region" : "sichuan",
        "isp" : "dianxin",
        "flux" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
      }, {
        "region" : "guizhou",
        "isp" : "dianxin",
        "flux" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
      } ]
    }, {
      "domain_name" : "www.test2.com",
      "region_isp_details" : [ {
        "region" : "sichuan",
        "isp" : "dianxin",
        "flux" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
      }, {
        "region" : "guizhou",
        "isp" : "dianxin",
        "flux" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
      } ]
    } ]
  }
}
```
#### 状态码
| 状态码 | 描述 |
|:---|:---|
| 200 | OK |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-cdn/ErrorCode.html)。
