所有文档

          内容分发网络 CDN

          统计接口(旧版)

          查询域名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)

          注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的pv统计之和。

          查询域名流量

          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)

          注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的流量统计之和。

          查询域名状态码统计

          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)

          注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的状态码统计之和。

          查询域名命中率

          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)

          注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的命中率统计之和。

          查询过去域名访次数Top 100的url

          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)

          注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的统计汇总。

          查询过去域名访次数Top 100的referer

          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)

          注意: 当不指定domainName的时候,查询返回的结果为用户所有加速域名的统计汇总。

          上一篇
          统计接口(新版)
          下一篇
          日志接口