Statistical Interface (old version)
Last Updated:2020-09-17
Query Domain Name pv
def test_get_domain_pv_stat(self):
"""
use new stat api
params is optional
no domain->all domains by uid
no endTime->time by now
no startTime->24hour before endTime
no period->3600
no withDistribution->false
"""
error = None
try:
response = self.cdn_client.get_domain_pv_stat(
domain = 'opencdn3.sys-qa.com',
startTime = '2017-01-17T12:00:00Z',
endTime = '2017-01-17T13:00:00Z',
period = 3600, withRegion = '')
print response
except BceServerError as e:
error = e
finally:
self.assertIsNone(error)
Note When the domainName is not specified, the result of the query return is the sum of the pv statistics of all the user’s accelerated domain names
Query Domain Name Traffic
def test_get_domain_flow_stat(self):
"""
use new stat api
params is optional
no domain->all domains by uid
no endTime->time by now
no startTime->24hour before endTime
no period->3600
no withDistribution->false
"""
error = None
try:
response = self.cdn_client.get_domain_flow_stat(
domain = 'opencdn3.sys-qa.com',
startTime = '2017-01-17T12:00:00Z',
endTime = '2017-01-17T13:00:00Z',
period = 3600, withRegion = '')
print response
except BceServerError as e:
error = e
finally:
self.assertIsNone(error)
Note When domainName is not specified, return the sum of traffic statistics of all accelerated domain names of the user.
Query Domain Name Status Code Statistics
def test_get_domain_httpcode_stat(self):
"""
use new stat api
params is optional
"""
error = None
try:
response = self.cdn_client.get_domain_httpcode_stat(
domain = 'opencdn3.sys-qa.com',
startTime = '2017-01-17T12:00:00Z',
endTime = '2017-01-17T13:00:00Z',
period = 3600)
print response
except BceServerError as e:
error = e
finally:
self.assertIsNone(error)
Note When domainName is not specified, return the sum of status code statistics of all accelerated domain names of the user.
Query the Domain Name Hit Rate
def test_get_domain_hitrate_stat(self):
"""
use new stat api
params is optional
"""
error = None
try:
response = self.cdn_client.get_domain_hitrate_stat(
domain = 'opencdn3.sys-qa.com',
startTime = '2017-01-17T12:00:00Z',
endTime = '2017-01-17T13:00:00Z',
period = 3600)
print response
except BceServerError as e:
error = e
finally:
self.assertIsNone(error)
Note When domainName is not specified, return the sum of the hit rate statistics of all accelerated domain names of the user.
Query the url with Top 100 Domain Name Accesses in the Past
def test_get_domain_tpon_url_stat(self):
"""
use new stat api
params is optional
"""
error = None
try:
params = {}
params['domain'] = 'opencdn3.sys-qa.com'
params['startTime'] = '2017-01-16T12:00:00Z'
params['endTime'] = '2017-01-16T14:00:00Z'
params['period'] = 3600
response = self.cdn_client.get_domain_topn_url_stat(
domain = 'opencdn3.sys-qa.com',
startTime = '2017-01-16T12:00:00Z',
endTime = '2017-01-16T14:00:00Z',
period = 3600)
print response
except BceServerError as e:
error = e
finally:
self.assertIsNone(error)
Note When domainName is not specified, return the sum of statistics of all accelerated domain names of the user.
Query the Referer with Top 100 Domain Name Accesses in the Past
def test_get_domain_topn_referer_stat(self):
"""
use new stat api
params is optional
"""
error = None
try:
response = self.cdn_client.get_domain_topn_referer_stat(
domain = 'opencdn3.sys-qa.com',
startTime = '2017-01-16T12:00:00Z',
endTime = '2017-01-16T14:00:00Z',
period = 3600)
print response
except BceServerError as e:
error = e
finally:
self.assertIsNone(error)
Note When domainName is not specified, return the sum of statistics of all accelerated domain names of the user.