官网DescribeCdnData 接口,不能查询多域名,状态码明细,只能查询单域名明细。
https://cloud.tencent.com/document/product/228/30986
接口:DescribeCdnData 只能查询单个域名,暂不支持查询多个域名。
未公开接口:DescribeCdnDetailData Metric 选statusCode 不能打印状态码明细,Metric 选2xx这类的可以,如果要查询所有状态码得分别查询2xx/3xx/4xx/5xx ,客户希望: 当Metric 选statusCode 可以打印状态码明细 如:200/206/302/304/403/404/502/503... 的个数
使用方法:
点击DescribeCdnData调试,跳转调试页面,生成的代码修改接口名为DescribeCdnDetailData
先获取 SecretId SecretKey
DescribeCdnDetailData接口的必填参数有:StartTime 、EndTime 、Metric、Domains.N、Interval 点击发送请求,即可看到结果,
点击真实请求,就是该页面发送的命令,复制下来,把DescribeCdnData替换为DescribeCdnDetailData
注1:Interval在DescribeCdnDetailData里为必填参数,在DescribeCdnData为非必填参数
注2:复制出来的请求命令有效期很短。
请求命令:
curl -X POST https://cdn.tencentcloudapi.com -H "Authorization: TC3-HMAC-SHA256 Credential=AKIDlcDYNxYJ5bWKsFDL7dt40iCSTYQseiHc/2020-12-18/cdn/tc3_request, SignedHeaders=content-type;host, Signature=c0ff851177a978f246f5240f2016bc127069d43ecc7dcdf330f748b806aa8ee4" -H "Content-Type: application/json" -H "Host: cdn.tencentcloudapi.com" -H "X-TC-Action: DescribeCdnDetailData" -H "X-TC-Timestamp: 1608289706" -H "X-TC-Version: 2018-06-06" -H "X-TC-Language: zh-CN" -d '{"Domains":["www.wsficdn.cn","a.wsficdn.cn"],"Metric":"2xx","StartTime":"2020-12-16 18:10:00","EndTime":"2020-12-16 18:15:00","Interval":"min"}'
结果:
{"Response":{"RequestId":"d8228f57-5c48-473f-b1a1-9c47a25f63f4","Data":[{"Resource":"www.wsficdn.cn","CdnData":[{"Metric":"2xx","DetailData":[{"Time":"2020-12-16 18:10:00","Value":0},{"Time":"2020-12-16 18:11:00","Value":0},{"Time":"2020-12-16 18:12:00","Value":14},{"Time":"2020-12-16 18:13:00","Value":3},{"Time":"2020-12-16 18:14:00","Value":0},{"Time":"2020-12-16 18:15:00","Value":0}],"SummarizedData":{"Name":"sum","Value":17}},{"Metric":"200","DetailData":[{"Time":"2020-12-16 18:10:00","Value":0},{"Time":"2020-12-16 18:11:00","Value":0},{"Time":"2020-12-16 18:12:00","Value":14},{"Time":"2020-12-16 18:13:00","Value":3},{"Time":"2020-12-16 18:14:00","Value":0},{"Time":"2020-12-16 18:15:00","Value":0}],"SummarizedData":{"Name":"sum","Value":17}}]},{"Resource":"a.wsficdn.cn","CdnData":[{"Metric":"2xx","DetailData":[{"Time":"2020-12-16 18:10:00","Value":0},{"Time":"2020-12-16 18:11:00","Value":0},{"Time":"2020-12-16 18:12:00","Value":0},{"Time":"2020-12-16 18:13:00","Value":0},{"Time":"2020-12-16 18:14:00","Value":0},{"Time":"2020-12-16 18:15:00","Value":0}],"SummarizedData":{"Name":"sum","Value":0}}]}],"Interval":"min"}}