- 接口描述:调用本接口查询状态码请求数,请求状态码占比
- 请求方式:post
- 请求路径:/statistics/query-http-status-code-data
- 使用说明:
- 单个用户一分钟限制调用10000次,并发不超过100;
- 单次查询输入域名的个数不能超过100个;
- 单次查询输入结果聚合维度(group_by)的个数不能超过4个;
- 时间粒度为24h时,查询开始时间与结束时间需要跨天;
- 若查询结束时间不包含在该批次的最后一秒,默认end_time为该批次最后一秒,例如:时间粒度为1h,end_time设置为17:30对应的时间戳,此时end_time默认成17:59:59;
- 时间片统计数据均为前打点,假如请求5分钟粒度数据,time_stamp= "2021-10-13 00:00"对应的时间戳,表示统计的数据为时间区间[2021-10-13 00:00, 2021-10-13 00:05);
- 根据请求参数时间粒度(Interval)和聚合维度(group_by)个数的不同,单次请求可查询历史数据范围,数据延迟, 支持最大的时间跨度均不同,对应如下:
时间粒度 | 可查询历史数据时间范围 | 数据延迟 | 2 ≥ 聚合维度个数 ≥ 0 ,支持最大时间跨度 | 4 ≥ 聚合维度个数 >2 支持最大的时间跨度 |
---|---|---|---|---|
1m | 最近31天 | 5分钟 | 7天 | 3小时 |
5m | 最近183天 | 20分钟 | 31天 | 1天 |
1h | 最近183天 | 20分钟 | 93天 | 3天 |
24h | 最近183天 | 20分钟 | 93天 | 3天 |
请求JSON参数
参数 | 类型 | 是否必传 | 名称 | 描述 |
---|---|---|---|---|
start_time | int | 是 | 开始时间戳 | 起始时间,时间戳(秒)。 |
end_time | int | 是 | 结束时间戳 | 结束时间,时间戳(秒)。 |
interval | string | 否 | 时间粒度 | 时间粒度,目前支持1m,5m,1h和24h,默认5m。 |
product_type | List | 否 | 产品类型列表 | 产品类型列表,不传默认名下所有产品,可多个产品类型,作为统计筛选项。支持: “001”(静态加速),“003”(下载加速),“004”(视频点播加速),“008”(CDN加速), “014”(下载加速闲时),“007”(安全加速),“005”(直播加速),“006”(全站加速),“009”(应用加速), “010”(web应用防火墙(边缘云版)),“011”(高防DDoS(边缘云版)) |
domain | list | 否 | 域名列表 | 域名,不传默认名下所有域名,可多个域名,作为统计筛选项。 |
province | list | 否 | 省编码列表 | 省编码,不传默认所有省份,可多个省编码,作为统计筛选项,点击查看省份及对应的省编码 |
isp | list | 否 | 运营商编码列表 | 运营商编码,不传默认所有运营商,可多个运营商编码,作为统计筛选项,点击查看运营商及对应的运营商编码 |
network_layer_protocol | string | 否 | 网络层协议 | 网络层协议,不传默认所有网络层协议,支持作为统计筛选项,可以为ipv4、ipv6,other。 |
application_layer_protocol | string | 否 | 应用层协议 | 应用层协议,不传默认所有络层协议,支持作为统计筛选项,可以为http,https,rtmp,quic,other。 |
group_by | list | 否 | 结果聚合维度 | 指标在计算结果的聚合维度,不传或为空默认按照时间粒度聚合,可多个统计维度,可以为 product_type,domain,province,isp,network_layer_protocol,application_layer_protocol。 |
响应Json参数
参数 | 类型 | 是否必传 | 名称及描述 |
---|---|---|---|
code | int | 是 | 状态码 |
message | string | 是 | 描述信息 |
start_time | int | 是 | 开始时间戳,时间戳(秒) |
end_time | int | 是 | 结束时间戳,时间戳(秒) |
interval | string | 是 | 时间粒度 |
req_http_status_code_data_interval | list | 是 | 每个时间间隔的请求数数据 |
req_http_status_code_data_interval[*].time_stamp | int | 是 | 时间片开始时间戳 |
req_http_status_code_data_interval[*].product_type | string | 否 | 产品类型 |
req_http_status_code_data_interval[*].domain | string | 否 | 域名 |
req_http_status_code_data_interval[*].province | int | 否 | 省编码 |
req_http_status_code_data_interval[*].isp | string | 否 | 运营商编码 |
req_http_status_code_data_interval[*].network_layer_protocol | string | 否 | 网络层协议 |
req_http_status_code_data_interval[*].application_layer_protocol | string | 否 | 应用层协议 |
req_http_status_code_data_interval[*].http_status_code | string | 否 | 状态码 |
req_http_status_code_data_interval[*].http_status_code_num | int | 是 | 状态码个数 |
req_http_status_code_data_interval[*].http_status_code_proportion | float | 是 | 状态码占比(百分比,保留两位小数) |
示例
路径: https://cdnapi-global.ctapi.ctyun.cn/statistics/query-http-status-code-data
示例1
请求参数
{
"start_time": "1662413100",
"end_time": "1662413700",
"domain": [
"ctyun.cn",
"ctyun.cn1"
],
"group_by": [
"application_layer_protocol"
]
}
返回结果
{
"start_time": 1662413100,
"end_time": 1662413700,
"interval": "5m",
"code": 100000,
"message": "success",
"req_http_status_code_data_interval": [
{
"time_stamp": 1662413100,
"http_status_code": "200",
"http_status_code_proportion": 1.28,
"application_layer_protocol": "http",
"http_status_code_num": 13831
},
{
"time_stamp": 1662413100,
"http_status_code": "200",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
},
{
"time_stamp": 1662413100,
"http_status_code": "0",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
},
{
"time_stamp": 1662413100,
"http_status_code": "403",
"http_status_code_proportion": 3.77,
"application_layer_protocol": "http",
"http_status_code_num": 40610
},
{
"time_stamp": 1662413100,
"http_status_code": "416",
"http_status_code_proportion": 0.14,
"application_layer_protocol": "http",
"http_status_code_num": 1502
},
{
"time_stamp": 1662413100,
"http_status_code": "206",
"http_status_code_proportion": 95.96,
"application_layer_protocol": "https",
"http_status_code_num": 15253
},
{
"time_stamp": 1662413100,
"http_status_code": "403",
"http_status_code_proportion": 0.72,
"application_layer_protocol": "https",
"http_status_code_num": 115
},
{
"time_stamp": 1662413100,
"http_status_code": "206",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
},
{
"time_stamp": 1662413100,
"http_status_code": "499",
"http_status_code_proportion": 0.27,
"application_layer_protocol": "http",
"http_status_code_num": 2861
},
{
"time_stamp": 1662413100,
"http_status_code": "400",
"http_status_code_proportion": 0,
"application_layer_protocol": "http",
"http_status_code_num": 2
},
{
"time_stamp": 1662413100,
"http_status_code": "499",
"http_status_code_proportion": 0.15,
"application_layer_protocol": "https",
"http_status_code_num": 24
},
{
"time_stamp": 1662413100,
"http_status_code": "200",
"http_status_code_proportion": 3.15,
"application_layer_protocol": "https",
"http_status_code_num": 500
},
{
"time_stamp": 1662413100,
"http_status_code": "408",
"http_status_code_proportion": 0,
"application_layer_protocol": "http",
"http_status_code_num": 1
},
{
"time_stamp": 1662413100,
"http_status_code": "400",
"http_status_code_proportion": 0.02,
"application_layer_protocol": "https",
"http_status_code_num": 3
},
{
"time_stamp": 1662413100,
"http_status_code": "206",
"http_status_code_proportion": 94.54,
"application_layer_protocol": "http",
"http_status_code_num": 1017693
},
{
"time_stamp": 1662413400,
"http_status_code": "424",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
},
{
"time_stamp": 1662413400,
"http_status_code": "200",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
},
{
"time_stamp": 1662413400,
"http_status_code": "416",
"http_status_code_proportion": 0.01,
"application_layer_protocol": "http",
"http_status_code_num": 70
},
{
"time_stamp": 1662413400,
"http_status_code": "499",
"http_status_code_proportion": 0.1,
"application_layer_protocol": "https",
"http_status_code_num": 17
},
{
"time_stamp": 1662413400,
"http_status_code": "400",
"http_status_code_proportion": 0.02,
"application_layer_protocol": "https",
"http_status_code_num": 4
},
{
"time_stamp": 1662413400,
"http_status_code": "403",
"http_status_code_proportion": 0.79,
"application_layer_protocol": "https",
"http_status_code_num": 130
},
{
"time_stamp": 1662413400,
"http_status_code": "200",
"http_status_code_proportion": 3.19,
"application_layer_protocol": "https",
"http_status_code_num": 527
},
{
"time_stamp": 1662413400,
"http_status_code": "206",
"http_status_code_proportion": 95.89,
"application_layer_protocol": "https",
"http_status_code_num": 15835
},
{
"time_stamp": 1662413400,
"http_status_code": "499",
"http_status_code_proportion": 0.26,
"application_layer_protocol": "http",
"http_status_code_num": 2937
},
{
"time_stamp": 1662413400,
"http_status_code": "504",
"http_status_code_proportion": 0,
"application_layer_protocol": "http",
"http_status_code_num": 1
},
{
"time_stamp": 1662413400,
"http_status_code": "206",
"http_status_code_proportion": 95.28,
"application_layer_protocol": "http",
"http_status_code_num": 1065794
},
{
"time_stamp": 1662413400,
"http_status_code": "206",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
},
{
"time_stamp": 1662413400,
"http_status_code": "200",
"http_status_code_proportion": 1.2,
"application_layer_protocol": "http",
"http_status_code_num": 13478
},
{
"time_stamp": 1662413400,
"http_status_code": "403",
"http_status_code_proportion": 3.24,
"application_layer_protocol": "http",
"http_status_code_num": 36244
},
{
"time_stamp": 1662413400,
"http_status_code": "502",
"http_status_code_proportion": 0,
"application_layer_protocol": "http",
"http_status_code_num": 3
},
{
"time_stamp": 1662413400,
"http_status_code": "0",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
},
{
"time_stamp": 1662413400,
"http_status_code": "304",
"http_status_code_proportion": 0,
"application_layer_protocol": "http",
"http_status_code_num": 2
},
{
"time_stamp": 1662413400,
"http_status_code": "424",
"http_status_code_proportion": 0,
"application_layer_protocol": "http",
"http_status_code_num": 5
},
{
"time_stamp": 1662413400,
"http_status_code": "408",
"http_status_code_proportion": 0,
"application_layer_protocol": "http",
"http_status_code_num": 2
},
{
"time_stamp": 1662413700,
"http_status_code": "200",
"http_status_code_proportion": 3.28,
"application_layer_protocol": "https",
"http_status_code_num": 553
},
{
"time_stamp": 1662413700,
"http_status_code": "499",
"http_status_code_proportion": 0.25,
"application_layer_protocol": "http",
"http_status_code_num": 2915
},
{
"time_stamp": 1662413700,
"http_status_code": "0",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
},
{
"time_stamp": 1662413700,
"http_status_code": "400",
"http_status_code_proportion": 0.06,
"application_layer_protocol": "https",
"http_status_code_num": 10
},
{
"time_stamp": 1662413700,
"http_status_code": "200",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
},
{
"time_stamp": 1662413700,
"http_status_code": "403",
"http_status_code_proportion": 0.76,
"application_layer_protocol": "https",
"http_status_code_num": 129
},
{
"time_stamp": 1662413700,
"http_status_code": "416",
"http_status_code_proportion": 0.01,
"application_layer_protocol": "http",
"http_status_code_num": 87
},
{
"time_stamp": 1662413700,
"http_status_code": "200",
"http_status_code_proportion": 1.18,
"application_layer_protocol": "http",
"http_status_code_num": 13608
},
{
"time_stamp": 1662413700,
"http_status_code": "499",
"http_status_code_proportion": 0.08,
"application_layer_protocol": "https",
"http_status_code_num": 14
},
{
"time_stamp": 1662413700,
"http_status_code": "502",
"http_status_code_proportion": 0,
"application_layer_protocol": "http",
"http_status_code_num": 2
},
{
"time_stamp": 1662413700,
"http_status_code": "403",
"http_status_code_proportion": 2.97,
"application_layer_protocol": "http",
"http_status_code_num": 34233
},
{
"time_stamp": 1662413700,
"http_status_code": "206",
"http_status_code_proportion": 95.59,
"application_layer_protocol": "http",
"http_status_code_num": 1102841
},
{
"time_stamp": 1662413700,
"http_status_code": "408",
"http_status_code_proportion": 0,
"application_layer_protocol": "http",
"http_status_code_num": 1
},
{
"time_stamp": 1662413700,
"http_status_code": "424",
"http_status_code_proportion": 0,
"application_layer_protocol": "http",
"http_status_code_num": 15
},
{
"time_stamp": 1662413700,
"http_status_code": "206",
"http_status_code_proportion": 95.82,
"application_layer_protocol": "https",
"http_status_code_num": 16174
},
{
"time_stamp": 1662413700,
"http_status_code": "206",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
},
{
"time_stamp": 1662413700,
"http_status_code": "424",
"http_status_code_proportion": null,
"application_layer_protocol": "other",
"http_status_code_num": 0
}
]
}
示例2
请求参数
{
"start_time": "1662413100",
"domain": [
"ctyun.cn",
"ctyun.cn1"
],
"group_by": [
"application_layer_protocol"
]
}
返回结果
{
"code": 100007,
"message": "无法找到必须的请求参数:end_time"
}
错误码请参考:参数code和message含义