全站加速、上传加速、PCDN、DMS、移动加速、应用安全解决方案、政企安全加速解决方案、IPv6一体化解决方案、下载分发、网页加速、WSS、WEB应用防火墙、应用安全加速解决方案、BotGuard爬虫管理、区块链安全加速解决方案、电商安全加速解决方案、动态加速、金融安全加速解决方案、IPv6安全加速解决方案、点播分发、DDoS云清洗、S-P2P、应用性能管理
多域名的状态码统计,针对的是所有边缘节点的数据。
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
dateFrom | String | 否 | 开始时间 1.格式为yyyy-MM-ddTHH:mm:ss+08:00; 2.必须大于当前时间-183天,并且小于当前时间和dateTo; 3.dateFrom和dateTo相差不能超过7天(可联系技术支持调整); 4.dateFrom和dateTo要么都传递,要么都不传递; 5.dateFrom和dateTo都未传递,则默认查询过去24小时的数据 |
dateTo | String | 否 | 结束时间 1.格式为yyyy-MM-ddTHH:mm:ss+08:00; 2.必须大于dateFrom;如果大于当前时间,则重新赋值为当前时间; |
domain | List | 否 | 域名: 1.可传递域名数量上限默认为20个(可联系技术支持调整); 2.未传递该入参时查询账号下所有域名 |
dataInterval | String | 否 | 数据粒度,5m:5分钟粒度 |
groupBy | List | 否 | 分组维度 1.可选值为domain; 2.有传入则按照该维度展示明细数据; |
dataPadding | Boolean | 否 | 是否补0,取值为true或false,默认为false 当dataPadding取值为true时,对没有数据的时间点填充数据,取值为0 当dataPadding取值为false时,不做处理 |
queryBy | String | 否 | 查询维度,可选值:statusCode、statusCodeType;不传默认statusCode 1.statusCode :返回状态码明细; 2.statusCodeType:返回状态码类型对应明细(如Success、Redirect、Not-Modified、Permission、Not-Found、Server Error、Other对应的请求数) |
参数名称 | 类型 | 描述 |
---|---|---|
result | List | 结果 |
domain | String | 域名 |
statusCodeData | List | 状态码数据 |
statusCode | String | 状态码 |
totalRequest | String | 总请求数 |
statusCodeType | String | Success, Redirect, Not-Modified, Permission, Not-Found, Server Error, Other |
requestData | List | 请求数数据 |
timestamp | String | 时间,格式为yyyy-MM-dd HH:mm;每一个时间片数据值代表的是前一个时间粒度范围内的数据值。比如yyyy-MM-dd 00:05,代表00:00到00:05范围内的数据。 |
value | String | 状态码对应的请求数 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
MissingBody | This operation requires a body. Ensure that the body is present and the Content-Type header is set. | 400 | 请求体没有传递 |
NotAcceptable | The accept header specified in your request is not acceptable. | 400 | Accept请求头不支持,接口仅支持json和xml格式,默认为json格式 |
InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 | 请求体格式错误 |
InvalidDatePeriod | The date specified is invalid. | 400 | dateFrom或dateTo不符合规范 |
DateSpanError | You cannot specify a period greater than 7. | 400 | dateFrom和dateTo相差超过7天 |
PARAM_INVALID | param: groupBy is null or invalid. | 400 | 参数groupBy不符合规范 |
NumberLimitExceeded | The request was rejected because the number of domain({actual}) exceeds the limit ({expect}). | 400 | 传递的域名数量超过限制 |
InternalError | We encountered an internal error. Please try again. | 500 | 系统发生错误 |
PARAM_INVALID | param: domain is null or invalid. | 400 | 参数domain不符合规范 |
PARAM_INVALID | param: dataInterval is null or invalid. | 400 | 参数dataInterval不符合规范 |
PARAM_INVALID | param: dataPadding is null or invalid. | 400 | 参数 dataPadding 不符合规范 |
#!/bin/bash # Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response 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://open.chinanetcenter.com/api/report/status-code" \ -X "POST" \ -H "X-Time-Zone:GMT+08:00" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{"dateFrom": "2019-01-01T10:00:00+08:00","dateTo": "2019-01-02T10:00:00+08:00","domain": ["www.111.com","www.222.com"],"dataInterval": "5m","groupBy": ["domain"],"dataPadding":true,"queryBy":"statusCode" }'
{ "result":[ { "domain":"www.111.com", "statusCodeData":[ { "statusCode":"200", "totalRequest":"1332", "requestData":[ { "timestamp":"2019-01-01 00:05", "value":"844" }, { "timestamp":"2019-01-01 00:10", "value":"0" } ] }, { "statusCode":"400", "totalRequest":"1332", "requestData":[ { "timestamp":"2019-01-01 00:05", "value":"641" }, { "timestamp":"2019-01-01 00:10", "value":"36" } ] } ] }, { "domain":"www.222.com", "statusCodeData":[ { "statusCode":"200", "totalRequest":"1332", "requestData":[ { "timestamp":"2019-01-01 00:05", "value":"785" } ] } ] } ] }