Updated on 2023-06-13 GMT+08:00

Querying Details of Network Bandwidth

You can query data within the past 90 days.

The time span ranges from 1 hour to 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. If the sampling interval is less than or equal to 1 hour, the time granularity must be one hour, for example, 2020-07-01 08:00:00 and 2020-07-01 09:00:00. If the sampling interval is longer than 1 hour, the time granularity must be a whole day, for example, 2020-07-01 00:00:00 and 2020-07-02 00:00: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 details of the network bandwidth.

The minimum time span supported is one hour.

URI

GET /v1.0/cdn/statistics/bandwidth-detail

Request

Request parameters

Table 1 describes the request parameters.

Table 1 Request parameters

Parameter

Mandatory

Type

Description

start_time

No

Long

Specifies the start time of a query (timestamp, in milliseconds).

end_time

No

Long

Specifies the end time of a query (timestamp, in milliseconds).

domain_name

Yes

String

Specifies a 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.

interval

No

Interger

Specifies the sampling interval. interval is measured by seconds, and its values are described as follows:

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 you do not specify a value for interval, 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/bandwidth-detail?start_time=1498838400000&end_time=1502380500000&domain_name=www.example.com&interval=300&enterprise_project_id=0

Response

Response parameters

Table 2 describes the response parameter.

Table 2 Response parameter

Parameter

Type

Description

bandwidth_detail

Object

Specifies the detailed data. For details, see Table 3.

bandwidth parameter description

Table 3 describes the parameters.

Table 3 bandwidth parameter description

Parameter

Type

Description

start_time

Interger

Specifies the start time of a query (timestamp, in milliseconds).

end_time

Interger

Specifies the end time of a query (timestamp, in milliseconds).

stat_type

String

Specifies the statistics type.

interval

Interger

Specifies the sampling interval, measured by seconds.

values

Array of integers

Specifies the values of bandwidth data. The values are displayed in chronological order from the point of start_time (unit: bit/s).

Example response
{
  "bandwidth_detail": {
        "interval": 300,
        "values": [835038583,835038544],
        "start_time": 1498838400000,
        "end_time": 1502380500000,
        "stat_type" : "bw"
   }
}

Status Code

See Status Codes.

Error Code

See Error Codes.