查询多个域名的日志下载地址。日志文件粒度默认为24小时,返回的数据以实际配置为准。
参数名称 | 描述 |
---|---|
*dateFromString | 开始时间:
1.格式为yyyy-MM-ddTHH:mm:ss+08:00 ;
2.必须小于当前时间和dateTo ;
3.dateFrom和dateTo相差不能超过31天(可联系技术支持调整) ;
4.只能查询最近2年内数据.(实际可查询的日志范围,取决于域名配置的日志保留天数) . |
*dateToString | 结束时间,格式为yyyy-MM-ddTHH:mm:ss+08:00(实际可查询的日志范围,取决于域名配置的日志保留天数). |
logTypeString | 日志类型,可选值: cdn,bot,ddos ;
多个通过英文逗号分隔,若未传则默认按logtype=cdn,bot查询数据 |
参数名称 | 描述 |
---|---|
*domain-listObject | |
*domain-nameList | 域名数量默认上限为20个(可联系技术支持调整), 最大上限为500. |
参数名称 | 描述 |
---|---|
logsList | |
domainString | 域名 |
areaCodeString | 加速区域 |
filesList | |
dateFromString | 日志文件的开始时间,格式为yyyy-MM-dd-HHmm |
dateToString | 日志文件的结束时间,格式为yyyy-MM-dd-HHmm |
logUrlString | 日志文件下载地址(链接有效期24小时) |
fileSizeInteger | 日志文件大小 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
NotAcceptable | The accept header specified in your request is not acceptable. | 400 | Accept请求头不支持,接口仅支持json和xml格式,默认为json格式 |
MalformedXML | The XML you provided was not well-formed or did not validate against our published schema. | 400 | 请求体XML格式错误 |
DomainNameIsRequired | The domain name is required. | 400 | 请求体有传递且域名数组为空 |
DomainsExcessive | The number of domain is excessive once. | 403 | 传递的任务个数超过账号限制 |
NoSuchDomain | The specified domain does not exist. | 404 | 传递的域名不存在 |
InvalidDatePeriod | The date specified is invalid. | 400 | datefrom或dateto不符合规范 |
DateSpanError | You cannot specify a period greater than 31. | 400 | datefrom和dateto相差超过31天 |
ReportError | report error. | 400 | 系统发生错误(日志组接口返回错误,且错误码非200和404) |
InternalError | We encountered an internal error. Please try again. | 500 | 系统发生错误 |
PARAM_INVALID | param: fileMd5 is null or invalid. | 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?datefrom=2017-06-14T00:00:00%2B08:00&dateto=2017-06-17T00:00:00%2B08:00&logtype=cdn" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{ "domain-list": { "domain-name": ["www.example1.com","www.example2.com"] } }'
{ "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 } ] } ] }