查询多个域名的日志下载地址。日志文件粒度默认为24小时,返回的数据以实际配置为准。
| 参数名称 | 描述 |
|---|---|
domain-listObject | 域名列表: 1.域名数量默认上限为20个(可联系技术支持调整), 最大上限为500. |
*domain-nameList | 域名 |
*datefromString | 开始时间: 1.格式为yyyy-MM-ddTHH:mm:ss+00:00 ; 2.必须小于当前时间和dateTo ; 3.dateFrom和dateTo相差不能超过31天(可联系技术支持调整) ; 4.只能查询最近2年内数据.(实际可查询的日志范围,取决于域名配置的日志保留天数) . |
*datetoString | 结束时间,格式为yyyy-MM-ddTHH:mm:ss+00:00(实际可查询的日志范围,取决于域名配置的日志保留天数). |
logTypeString | 默认值:cdnbot 可选值:cdnbotddoswaapwaf 日志类型,可选值: cdn,bot,ddos,waap,waf; 多个通过英文逗号分隔,若未传则默认按logtype=cdn,bot查询数据 |
areaCodeString | 可选值:查看参数值 加速区域 |
| 参数名称 | 描述 |
|---|---|
logsList | |
domainString | 域名 |
areaCodeString | 加速区域 |
filesList | |
dateFromString | 日志文件的开始时间,格式为yyyy-MM-dd-HHmm |
dateToString | 日志文件的结束时间,格式为yyyy-MM-dd-HHmm |
logUrlString | 日志文件下载地址 |
fileSizeInteger | 日志文件大小 |
| 错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
|---|---|---|---|
| NotAcceptable | Accept request header not supported, API supports json and xml format only, default is json format | 400 | Accept请求头不支持,接口仅支持json和xml格式,默认为json格式 |
| MalformedXML | Request body XML format error | 400 | 请求体XML格式错误 |
| DomainNameIsRequired | Requrest body is specified and domain array is empty | 400 | 请求体有传递且域名数组为空 |
| DomainsExcessive | Number of queried domains exceeds limits set to the account | 403 | 传递的任务个数超过账号限制 |
| NoSuchDomain | Domain does not exist, or does not belong to the current account that calls the interface | 404 | 传递的域名不存在 |
| InvalidDatePeriod | Date from or dateto does not conform to the specification | 400 | datefrom或dateto不符合规范 |
| DateSpanError | Datefrom and dateto differ by more than 31 days | 400 | datefrom和dateto相差超过31天 |
| ReportError | System error ( log group interface response error and error code not 200 and 404) (no longer available, to be deleted) | 400 | 系统发生错误(日志组接口返回错误,且错误码非200和404) |
| InternalError | System error | 500 | 系统发生错误 |
| PARAM_INVALID | The parameter fileMd5 does not conform to specification | 400 | 参数fileMd5不符合规范 |
#!/bin/bash
# Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.cdnetworks.com/api/report/log/downloadLink" \
-X "POST" \
-H "X-Time-Zone:GMT+00:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{
"domain-list": {
"domain-name": ["www.example1.com","www.example2.com"]
},
"datefrom":"2017-06-14T00:00:00+00:00",
"dateto":"2017-06-17T00:00:00+00:00",
"logType":"cdn"
}'{
"logs": [
{
"domainName": "www.example1.com",
"files": [
{
"dateFrom": "2017-06-14-0000",
"dateTo": "2017-06-14-2359",
"logUrl": "http://dx.wslog.chinanetcenter.com/log/c/www.example1.com/2017-06-14-0000-2330_www.example1.com.cn.log.gz?wskey=00c6ae5d3570005382bc74485900f4edac8d5f00152a",
"fileSize": 17397875
},
{
"dateFrom": "2017-06-16-0000",
"dateTo": "2017-06-16-2359",
"logUrl": "http://dx.wslog.chinanetcenter.com/log/c/www.example1.com/2017-06-16-0000-2330_www.example1.com.cn.log.gz?wskey=00c65bc688020053c99ef01a59008f8234e55f00983e",
"fileSize": 10570627
}
]
}
]
}