Help Center> Content Delivery Network> API Reference> Out-of-Date APIs> Statistics Analysis> Querying Statistics About Domain Names by Region and Carrier
Updated on 2024-05-16 GMT+08:00

Querying Statistics About Domain Names by Region and Carrier

Function

  • You can query data within the past 90 days.
  • The query time span is 7 days.
  • You can specify up to 100 domain names at a query.
  • The start time and end time must be both specified.
  • The start time and end time must be timestamps in milliseconds. Only exact 5-minute intervals are allowed, for example, 0 minutes, 5 minutes, 10 minutes, and 15 minutes. If the values are not exact 5-minute intervals, the returned data may not be the expected data.
  • If the start time is 2019-01-24 20:15:00, the statistics in [20:15:00, 20:20:00) are collected.
  • Unit: byte for traffic-related metrics, bit/s for bandwidth-related metrics, and number of times for request quantity.
  • You can query statistics about specific domain names and details about specific metrics.
  • If multiple domain names are passed, the data of each domain name is returned separately.
  • You can query statistics by region and carrier, except origin pull statistics.
  • You can query up to 10 metrics each time.
  • This API is not applicable to domain names whose service area is outside the Chinese mainland.

URI

GET /v1.0/cdn/statistics/domain-item-location-details

Table 1 Query parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Enterprise project that the resource belongs to. This parameter is valid only when the enterprise project function is enabled. The value all indicates all projects. This parameter is mandatory when you use an IAM user to call this API.

start_time

Yes

Long

Query start time (timestamp). Only exact 5-minute intervals are allowed.

end_time

Yes

Long

Query end time (timestamp). Only exact 5-minute intervals are allowed.

domain_name

Yes

String

Domain name list. Domain names are separated by commas (,), for example, www.test1.com,www.test2.com. The value all indicates that all domain names under your account are queried.

stat_type

Yes

String

Metric types.

  • Network resource consumption statistics
    • bw (bandwidth)
    • flux (traffic)
    • ipv6_bw (IPv6 bandwidth)
    • ipv6_flux (IPv6 traffic)
    • https_bw (HTTPS bandwidth)
    • https_flux (HTTPS traffic)
  • Access statistics
    • req_num (total number of requests)
    • hit_num (number of hits)
    • req_time (request duration)
  • HTTP status code statistics (one or more types can be returned)
    • status_code_2xx (status codes 2xx)
    • status_code_3xx (status codes 3xx)
    • status_code_4xx (status codes 4xx)
    • status_code_5xx (status codes 5xx)

region

Yes

String

Region list. Regions are separated by commas (,). The value all indicates that all regions are queried.

isp

Yes

String

Carrier list. Carriers are separated by commas (,). The value all indicates that all carriers are queried.

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameter

Parameter

Type

Description

domain_item_location_details

DomainItemLocationDetails object

Domain name details.

Table 4 DomainItemLocationDetails

Parameter

Type

Description

start_time

Long

Time when data collection starts (timestamp). The time may be different from the request time.

end_time

Long

Time when data collection ends (timestamp). The time may be different from the request time.

stat_type

String

Metric type.

domains

Array of DomainRegion objects

Domain name details.

Table 5 DomainRegion

Parameter

Type

Description

domain_name

String

Domain name.

region_isp_details

Array of Map<String,Object> objects

Metric data. If there is no data in the query time segment, an empty array [] is returned.

Example Request

GET https://cdn.myhuaweicloud.com/v1.0/cdn/statistics/domain-item-location-details?start_time=1515996000000&end_time=1515999600000&domain_name=www.test1.com,www.test2.com&stat_type=flux&region=sichuan,guizhou&isp=dianxin

Example Response

Status code: 200

OK

{
  "domain_item_location_details" : {
    "start_time" : 1515996000000,
    "end_time" : 1515999600000,
    "stat_type" : "flux",
    "domains" : [ {
      "domain_name" : "www.test1.com",
      "region_isp_details" : [ {
        "region" : "sichuan",
        "isp" : "dianxin",
        "flux" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
      }, {
        "region" : "guizhou",
        "isp" : "dianxin",
        "flux" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
      } ]
    }, {
      "domain_name" : "www.test2.com",
      "region_isp_details" : [ {
        "region" : "sichuan",
        "isp" : "dianxin",
        "flux" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
      }, {
        "region" : "guizhou",
        "isp" : "dianxin",
        "flux" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
      } ]
    } ]
  }
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.