文档中心 API文档 查询域名请求数(云解析)

查询域名请求数(云解析)

更新时间:2019-08-27 11:09:17

适用产品

云解析CloudDNS

接口描述

获取域名请求数报表数据

请求参数

Body 参数

JSON
参数名称类型必填描述
domain
List包含两个子参数:domainName、dcName
┗domainName
Stringdomain的子参数,是指域名名称
┗dcName
Stringdomain的子参数,指主机记录(如果dcName为空,则返回请求总数) 【备注:如果查询某个域名的总请求数,需在dcName输入所有主机头,请务必别忘了“@“主机头”】
timeType
String时间粒度: 1day 10分钟粒度(仅支持最近1天的数据,数据可能延迟1小时左右) 7day 小时粒度(仅支持最近7天的数据查询) month 天粒度(仅支持最近1个月的数据查询) q 天粒度(仅支持最近3个月的数据查询)
language
string为空返回中文结果(默认) en:返回英文提示结果

返回参数

Body 参数

JSON
参数名称类型描述
resCode
Int状态码。resCode的详细说明请参见“附录1业务状态码”。
msg
String状态码的详细说明
time
String时间
value
Int请求数

错误码

错误代码(code)描述(message)HTTP状态码语义
100服务器端错误200
101参数不能为空200
102参数格式错误200
202域名不存在200

示例

JSON
JSON
请求示例
复制代码 复制成功
#!/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://open.chinanetcenter.com/clouddns/DomainRequest" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{
    "domain": [
         {
            "domainName":"yhclub.top",
            "dcName":"@"
        },
         {
            "domainName":"yhclub.top",
            "dcName":"www"
        }
    ],

    "timeType":"q"
}'
返回示例
复制代码 复制成功
{

    "resCode":0,
    "msg":"操作成功",
    "content":[
        {
            "time":"2017-11-11 00:00",
            "value":8
        },
        {
            "time":"2017-11-12 00:00",
            "value":14
        },
        {
            "time":"2017-11-13 00:00",
            "value":12
        },
        {
            "time":"2017-11-14 00:00",
            "value":49
        },
        {
            "time":"2017-11-15 00:00",
            "value":109
        },
        {
            "time":"2017-11-16 00:00",
            "value":261
        },
        {
            "time":"2017-11-17 00:00",
            "value":130
        },
        {
            "time":"2017-11-18 00:00",
            "value":0
        },
        {
            "time":"2017-11-19 00:00",
            "value":0
        },
        {
            "time":"2017-11-20 00:00",
            "value":0
        },
        {
            "time":"2017-11-21 00:00",
            "value":0
        },
        {
            "time":"2017-11-22 00:00",
            "value":14
        },
        {
            "time":"2017-11-23 00:00",
            "value":0
        },
        {
            "time":"2017-11-24 00:00",
            "value":0
        },
        {
            "time":"2017-11-25 00:00",
            "value":0
        },
        {
            "time":"2017-11-26 00:00",
            "value":0
        },
        {
            "time":"2017-11-27 00:00",
            "value":0
        },
        {
            "time":"2017-11-28 00:00",
            "value":4
        },
        {
            "time":"2017-11-29 00:00",
            "value":36
        },
        {
            "time":"2017-11-30 00:00",
            "value":35
        },
        {
            "time":"2017-12-01 00:00",
            "value":17
        },
        {
            "time":"2017-12-02 00:00",
            "value":17
        },
        {
            "time":"2017-12-03 00:00",
            "value":14
        },
        {
            "time":"2017-12-04 00:00",
            "value":18
        },
        {
            "time":"2017-12-05 00:00",
            "value":13
        },
        {
            "time":"2017-12-06 00:00",
            "value":7
        },
        {
            "time":"2017-12-07 00:00",
            "value":8
        },
        {
            "time":"2017-12-08 00:00",
            "value":8
        },
        {
            "time":"2017-12-09 00:00",
            "value":5
        },
        {
            "time":"2017-12-10 00:00",
            "value":5
        },
        {
            "time":"2017-12-11 00:00",
            "value":35
        },
        {
            "time":"2017-12-12 00:00",
            "value":5
        },
        {
            "time":"2017-12-13 00:00",
            "value":10
        },
        {
            "time":"2017-12-14 00:00",
            "value":4
        },
        {
            "time":"2017-12-15 00:00",
            "value":9
        },
        {
            "time":"2017-12-16 00:00",
            "value":2
        },
        {
            "time":"2017-12-17 00:00",
            "value":12
        },
        {
            "time":"2017-12-18 00:00",
            "value":9
        },
        {
            "time":"2017-12-19 00:00",
            "value":7
        },
        {
            "time":"2017-12-20 00:00",
            "value":15
        },
        {
            "time":"2017-12-21 00:00",
            "value":20
        },
        {
            "time":"2017-12-22 00:00",
            "value":3
        },
        {
            "time":"2017-12-23 00:00",
            "value":5
        },
        {
            "time":"2017-12-24 00:00",
            "value":17
        },
        {
            "time":"2017-12-25 00:00",
            "value":15
        },
        {
            "time":"2017-12-26 00:00",
            "value":11
        },
        {
            "time":"2017-12-27 00:00",
            "value":19
        },
        {
            "time":"2017-12-28 00:00",
            "value":7
        },
        {
            "time":"2017-12-29 00:00",
            "value":3
        },
        {
            "time":"2017-12-30 00:00",
            "value":6
        },
        {
            "time":"2017-12-31 00:00",
            "value":10
        },
        {
            "time":"2018-01-01 00:00",
            "value":6
        },
        {
            "time":"2018-01-02 00:00",
            "value":7
        },
        {
            "time":"2018-01-03 00:00",
            "value":9
        },
        {
            "time":"2018-01-04 00:00",
            "value":7
        },
        {
            "time":"2018-01-05 00:00",
            "value":17
        },
        {
            "time":"2018-01-06 00:00",
            "value":15
        },
        {
            "time":"2018-01-07 00:00",
            "value":22
        },
        {
            "time":"2018-01-08 00:00",
            "value":6
        },
        {
            "time":"2018-01-09 00:00",
            "value":21
        },
        {
            "time":"2018-01-10 00:00",
            "value":6
        },
        {
            "time":"2018-01-11 00:00",
            "value":6
        },
        {
            "time":"2018-01-12 00:00",
            "value":14
        },
        {
            "time":"2018-01-13 00:00",
            "value":16
        },
        {
            "time":"2018-01-14 00:00",
            "value":8
        },
        {
            "time":"2018-01-15 00:00",
            "value":14
        },
        {
            "time":"2018-01-16 00:00",
            "value":12
        },
        {
            "time":"2018-01-17 00:00",
            "value":5
        },
        {
            "time":"2018-01-18 00:00",
            "value":14
        },
        {
            "time":"2018-01-19 00:00",
            "value":7
        },
        {
            "time":"2018-01-20 00:00",
            "value":8
        },
        {
            "time":"2018-01-21 00:00",
            "value":7
        },
        {
            "time":"2018-01-22 00:00",
            "value":0
        },
        {
            "time":"2018-01-23 00:00",
            "value":0
        },
        {
            "time":"2018-01-24 00:00",
            "value":0
        },
        {
            "time":"2018-01-25 00:00",
            "value":0
        },
        {
            "time":"2018-01-26 00:00",
            "value":0
        },
        {
            "time":"2018-01-27 00:00",
            "value":0
        },
        {
            "time":"2018-01-28 00:00",
            "value":0
        },
        {
            "time":"2018-01-29 00:00",
            "value":0
        },
        {
            "time":"2018-01-30 00:00",
            "value":0
        },
        {
            "time":"2018-01-31 00:00",
            "value":0
        },
        {
            "time":"2018-02-01 00:00",
            "value":0
        },
        {
            "time":"2018-02-02 00:00",
            "value":0
        },
        {
            "time":"2018-02-03 00:00",
            "value":0
        },
        {
            "time":"2018-02-04 00:00",
            "value":0
        },
        {
            "time":"2018-02-05 00:00",
            "value":0
        },
        {
            "time":"2018-02-06 00:00",
            "value":0
        },
        {
            "time":"2018-02-07 00:00",
            "value":0
        },
        {
            "time":"2018-02-08 00:00",
            "value":8
        },
        {
            "time":"2018-02-09 00:00",
            "value":11
        },
        {
            "time":"2018-02-10 00:00",
            "value":8
        }
    ]
}
本篇文档内容对您是否有帮助?
有帮助
没帮助
提交成功!非常感谢您的反馈,我们会继续努力做到更好!