文档中心 API文档 查询账号下所有域名的状态码汇总分布

查询账号下所有域名的状态码汇总分布

更新时间:2023-05-30 19:22:09

适用产品

网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案

接口描述

查询账号下所有域名的状态码汇总分布。只能按天统计。

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Params 参数

参数名称类型必填描述
datefrom
String开始时间 1.格式为yyyy-MM-ddTHH:mm:ss+08:00; 2.必须小于当前时间和dateto; 3.dateFrom和dateTo相差不能超过31天(可联系技术支持调整); 4.只能查询最近2年内数据。
dateto
String结束时间 1.格式为yyyy-MM-ddTHH:mm:ss+08:00; 2.必须大于datefrom;如果大于当前时间,则重新赋值为当前时间;

返回参数

Body 参数

参数名称类型描述
status-code-data
状态码汇总
status-code
状态码
hit
状态码对应的请求数

错误码

错误代码(code)描述(message)HTTP状态码语义
InvalidDatePeriodThe   date specified is invalid.400datefrom或dateto不符合规范
DateSpanErrorYou   cannot specify a period greater than 31.400datefrom和dateto相差超过31天
ReportErrorreport   error.400系统发生错误(myview接口返回错误,且错误码非200和404)
InternalErrorWe   encountered an internal error. Please try again.500系统发生错误

示例

XML
JSON
XML
请求示例
复制代码 复制成功
#!/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?datefrom=2017-11-01T00:00:00%2B08:00&dateto=2017-11-07T00:00:00%2B08:00" \

-X "GET" \

-H "X-Time-Zone:GMT+08:00" \

-u "$username:$password" \

-H "Date: $date" \

-H "Accept: application/xml"
返回示例
复制代码 复制成功
<?xml version="1.0" encoding="UTF-8"?>
<status-code-report>
   <status-code-data>
      <status-code>200</status-code>
      <hit>116416</hit>
   </status-code-data>
   <status-code-data>
      <status-code>403</status-code>
      <hit>200</hit>
   </status-code-data>
   <status-code-data>
      <status-code>404</status-code>
      <hit>360</hit>
   </status-code-data>
   <status-code-data>
      <status-code>500</status-code>
      <hit>216</hit>
   </status-code-data>
   <status-code-data>
      <status-code>other</status-code>
      <hit>9880</hit>
   </status-code-data>
</status-code-report>
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!