Updated on 2024-09-02 GMT+08:00

Querying Domain Consumption by Region

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. Their values must be precise down to the millisecond, but exact, 5-minute, 1-hour, or 4-hour intervals are allowed. If the time span is less than or equal to one day, the time granularity is 5 minutes, for example, 2020-07-01 08:05:00 and 2020-07-01 08:10:00. If the time span is longer than 1 day but shorter than or equal to 7 days, the time granularity is 1 hour. If the time span is longer than 7 days, the time granularity is 4 hours.

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 consumption of domain names by region within a time range.

URI

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

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

No

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.

If this parameter is set to ALL or is not carried in a request, all regions are queried.

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-detail-summary?start_time=1511366400000&end_time=1511452799640&domain_name=ALL&stat_type=req_num&region=beijing,neimenggu&enterprise_project_id=0

Response

Response parameters

Table 2 describes the response parameter.

Table 2 Response parameter

Parameter

Type

Description

region_data

Array of objects

Region list. For details, see Table 3.

region_data parameter description

Table 3 describes the parameters.

Table 3 region_data parameter description

Parameter

Type

Description

region

String

Region.

value

Integer

Value of the queried metric. The traffic unit is byte. The bandwidth unit is bit/s.

Example response
{
   "region_data":
   [
      {
        "region": "beijing",
        "value": 586
      },
      {
        "region": "neimenggu",
        "value": 862
      }
   ]
}

Status Codes

See Status Codes.

Error Codes

See Error Codes.