统计接口(旧版)
更新时间:2023-05-16
查询域名pv
Plain Text
1def test_get_domain_pv_stat(self):
2 """
3 use new stat api
4 params is optional
5 no domain->all domains by uid
6 no endTime->time by now
7 no startTime->24hour before endTime
8 no period->3600
9 no withDistribution->false
10 """
11 error = None
12 try:
13 response = self.cdn_client.get_domain_pv_stat(
14 domain = 'opencdn3.sys-qa.com',
15 startTime = '2017-01-17T12:00:00Z',
16 endTime = '2017-01-17T13:00:00Z',
17 period = 3600, withRegion = '')
18 print response
19 except BceServerError as e:
20 error = e
21 finally:
22 self.assertIsNone(error)
注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的pv统计之和。
查询域名流量
Plain Text
1def test_get_domain_flow_stat(self):
2 """
3 use new stat api
4 params is optional
5 no domain->all domains by uid
6 no endTime->time by now
7 no startTime->24hour before endTime
8 no period->3600
9 no withDistribution->false
10 """
11 error = None
12 try:
13 response = self.cdn_client.get_domain_flow_stat(
14 domain = 'opencdn3.sys-qa.com',
15 startTime = '2017-01-17T12:00:00Z',
16 endTime = '2017-01-17T13:00:00Z',
17 period = 3600, withRegion = '')
18 print response
19 except BceServerError as e:
20 error = e
21 finally:
22 self.assertIsNone(error)
注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的流量统计之和。
查询域名状态码统计
Plain Text
1def test_get_domain_httpcode_stat(self):
2 """
3 use new stat api
4 params is optional
5 """
6 error = None
7 try:
8 response = self.cdn_client.get_domain_httpcode_stat(
9 domain = 'opencdn3.sys-qa.com',
10 startTime = '2017-01-17T12:00:00Z',
11 endTime = '2017-01-17T13:00:00Z',
12 period = 3600)
13 print response
14 except BceServerError as e:
15 error = e
16 finally:
17 self.assertIsNone(error)
注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的状态码统计之和。
查询域名命中率
Plain Text
1def test_get_domain_hitrate_stat(self):
2 """
3 use new stat api
4 params is optional
5 """
6 error = None
7 try:
8 response = self.cdn_client.get_domain_hitrate_stat(
9 domain = 'opencdn3.sys-qa.com',
10 startTime = '2017-01-17T12:00:00Z',
11 endTime = '2017-01-17T13:00:00Z',
12 period = 3600)
13 print response
14 except BceServerError as e:
15 error = e
16 finally:
17 self.assertIsNone(error)
注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的命中率统计之和。
查询过去域名访次数Top 100的url
Plain Text
1def test_get_domain_tpon_url_stat(self):
2 """
3 use new stat api
4 params is optional
5 """
6 error = None
7 try:
8 params = {}
9 params['domain'] = 'opencdn3.sys-qa.com'
10 params['startTime'] = '2017-01-16T12:00:00Z'
11 params['endTime'] = '2017-01-16T14:00:00Z'
12 params['period'] = 3600
13 response = self.cdn_client.get_domain_topn_url_stat(
14 domain = 'opencdn3.sys-qa.com',
15 startTime = '2017-01-16T12:00:00Z',
16 endTime = '2017-01-16T14:00:00Z',
17 period = 3600)
18 print response
19 except BceServerError as e:
20 error = e
21 finally:
22 self.assertIsNone(error)
注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的统计汇总。
查询过去域名访次数Top 100的referer
Plain Text
1def test_get_domain_topn_referer_stat(self):
2 """
3 use new stat api
4 params is optional
5 """
6 error = None
7 try:
8 response = self.cdn_client.get_domain_topn_referer_stat(
9 domain = 'opencdn3.sys-qa.com',
10 startTime = '2017-01-16T12:00:00Z',
11 endTime = '2017-01-16T14:00:00Z',
12 period = 3600)
13 print response
14 except BceServerError as e:
15 error = e
16 finally:
17 self.assertIsNone(error)
注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的统计汇总。