Help Center/ Content Delivery Network/ API Reference/ Out-of-Date APIs/ Statistics Analysis/ Querying Statistics About Domain Names Under a Region or Carrier
Updated on 2024-09-02 GMT+08:00

Querying Statistics About Domain Names Under a Region or Carrier

You can query data within the past 90 days.

The time span of data queried cannot exceed 31 days.

You can specify up to 100 domain names at a query.

The start time and end time must be specified at the same time. The start time and end time must be precise down to the millisecond, but only exact sampling intervals are allowed. For example, if the sampling interval is 5 minutes, the start time and end time can be 2020-07-01 08:05:00 and 2020-07-01 08:10:00.

If the start time and end time do not meet the requirements, the returned data may be different from what was expected.

Function

This API is used to query the statistics of domain names under a specified carrier in a specified region and specified time period.

URI

GET /v1.0/cdn/statistics/region-carrier-detail

Request

Request parameters

Table 1 describes the request parameters.

Table 1 Request parameters

Parameter

Mandatory

Type

Description

start_time

No

Long

Query start timestamp, in milliseconds.

end_time

No

Long

Query end timestamp, in milliseconds.

domain_name

Yes

String

Domain name list. Use commas (,) to separate domain names, for example, www.test1.com,www.test2.com. The value ALL indicates that all domain names under a tenant are queried.

stat_type

Yes

String

Statistic types, including flux (traffic), bw (bandwidth), and req_num (total requests).

region

Yes

String

Region list, which covers the 34 provincial-level divisions (including Hong Kong, Macao, and Taiwan) of China, regions outside China, and others. Separate these regions with commas (,). For example, beijing,neimenggu.

NOTE:
  • Use Chinese Pinyin for a region name, for example beijing (Beijing), shanghai (Shanghai), and gangaotai (Hong Kong, Macao, and Taiwan). Use haiwai for regions outside China.
  • Use shanxi for Shanxi and shaanxi for Shaanxi.

The value ALL indicates that all regions are queried.

carrier

Yes

String

Carrier list. Abbreviated names of the carriers are used here. Currently, valid values are CTCC (China Telecom), CUCC (China Unicom), ENET (China Education and Research Network), CMCC (China Mobile), and CRC (Tietong). The carrier names are separated by commas (,). For example, CTCC,CMCC.

The value ALL indicates that all carriers are queried.

region and carrier cannot both be set to ALL.

interval

No

Integer

Sampling interval, in seconds.

For a time span of 1 day, the value can be 5 minutes, 1 hour, 4 hours, or 8 hours.

For a time span of 2 to 7 days, the value can be 5 minutes, 1 hour, 4 hours, 8 hours, or 1 day.

For a time span of 8 to 31 days, the value can be 4 hours, 8 hours, or 1 day.

If this parameter is not passed, the system uses the smallest value corresponding to the queried time span by default.

If you need to specify it in the request, convert the interval into seconds.

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.

Example request

Requested path

GET https://cdn.myhuaweicloud.com/v1.0/cdn/statistics/region-carrier-detail?start_time=1559318400000&end_time=1559577600000&domain_name=www.test1.com,www.test2.com,www.test3.com,www.test4.com&stat_type=req_num&region=beijing&carrier=CMCC&interval=86400&enterprise_project_id=0

Response

Response parameters

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

region

Array of strings

Region.

carrier

Array of strings

Carrier.

start_time

Integer

Query start timestamp, in milliseconds.

end_time

Integer

Query end timestamp, in milliseconds.

stat_type

String

Statistic types, including flux (traffic), bw (bandwidth), and req_num (total requests).

interval

Integer

Sampling interval.

values

Array of integers

Return value of a query. Data of a certain period of time is displayed based on the query time granularity. The values are separated by commas (,). The traffic unit is byte. The bandwidth unit is bit/s.

NOTE:

If multiple domain names are queried, the returned value is the total query results of all domain names.

Example response
{
    "region": [
        "beijing"
    ],
    "carrier": [
        "all"
    ],
    "start_time": 1559318400000,
    "end_time": 1559577600000,
    "stat_type": "req_num",
    "values": [
        66,
        64,
        68
    ],
    "interval": 86400
}

Status Codes

See Status Codes.

Error Codes

See Error Codes.