文档中心 API文档 查询多域名的指定传输协议的请求数

查询多域名的指定传输协议的请求数

更新时间:2022-12-13 17:19:12

适用产品

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

接口描述

查询多域名的指定传输协议的请求数,针对的是所有边缘节点的数据。

推荐使用 Open API在线调试

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

请求参数

Body 参数

参数名称类型必填描述
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; 3.如果大于当前时间,则重新赋值为当前时间;
domain
List域名,域名个数限制根据账号可调,默认为20个
dataInterval
String数据粒度 : 1m , 5m ,默认5m
protocolType
String传输协议 1.可选值为http、https; 2.不传默认查询https; 3.查询http时出参展示httpRequestData,查询https时出参展示httpsRequestData;
groupBy
List分组维度 1.可选值为domain; 2.有传入则按照该维度展示明细数据;

返回参数

Body 参数

参数名称类型描述
result
List
domain
String域名
httpsRequestData
List
timestamp
String时间,格式为yyyy-MM-dd HH:mm;每一个时间片数据值代表的是前一个时间粒度范围内的数据值。比如yyyy-MM-dd 00:05,代表00:00到00:05范围内的数据。
value
String请求数

错误码

错误代码(code)描述(message)HTTP状态码语义
NotAcceptableThe   accept header specified in your request is not acceptable.400Accept请求头不支持,接口仅支持json和xml格式,默认为json格式
MissingBodyThis   operation requires a body. Ensure that the body is present and the   Content-Type header is set.400请求体没有传递
InvalidHTTPRequestThere   was an error in the body of your HTTP request.400请求体格式错误
InvalidDatePeriodThe   date specified is invalid.400dateFrom或dateTo不符合规范
DateSpanErrorYou   cannot specify a period greater than 7.400dateFrom和dateTo相差超过7天
NumberLimitExceededThe   request was rejected because the number of domain({actual}) exceeds the limit   ({expect}).400传递的域名个数超过账号限制
PARAM_INVALIDparam:   groupBy is null or invalid.400参数groupBy不符合规范
InternalErrorWe   encountered an internal error. Please try again.500系统发生错误
PARAM_INVALIDparam: domain is null or invalid.400参数domain不符合规范
PARAM_INVALIDparam: dataInterval is null or invalid.400参数dataInterval不符合规范
PARAM_INVALIDparam: protocolType is null or invalid.400参数protocolType不符合规范

示例

JSON
XML
JSON
请求示例
复制代码 复制成功
#!/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/request/protocol" \
  -X "POST" \
-H "X-Time-Zone:GMT+08:00" \
  -u "$username:$password" \
  -H "Date: $date" \
  -H "Accept: application/json" \
  -d '{
        "dateFrom":"2017-09-20T16:52:16+08:00",
        "dateTo":"2017-09-20T16:52:16+08:00",
      "domain":[
          "test.com"
      ],
        "dataInterval":"5m",
        "protocolType":"https",
      "groupBy":[
          "domain"
      ]
  }'
返回示例
复制代码 复制成功
{
      "result":[
          {
                "domain":"test.com",
                "httpsRequestData":[
                  {
                        "timestamp":"2017-07-10 00:00",
                        "value":"100"
                  },
                  {
                        "timestamp":"2017-07-10 00:05",
                        "value":"200"
                  },
                  {
                        "timestamp":"2017-07-10 23:55",
                        "value":"100"
                  }
              ]
          }
      ]
  }
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!