Found 0 result in total
Content is empty
If you don't find the content you expect, please try another search term
Last updated:2021-07-20 11:45:43
You can call this operation to obtain the usage data in specified areas for specified domain names or a specified business type in a specified time period. The usage data includes the traffic in bytes, bandwidth in bit/s, and the number of requests (including dynamic HTTP requests, static HTTPS requests, dynamic HTTPS requests, static QUIC requests, and dynamic QUIC requests).
The API request contains the specified directory /2020-06-30/statistics/GetDomainUsageData, common request headers, and operation-specific request parameters. For more information, see the sample request.
Parameter | Required | Type | Description |
---|---|---|---|
StartTime | Yes | String | The beginning of the time range to query. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm+0800 format. The time must be in UTC+8. Example: 2016-08-01T21:14+0800. |
EndTime | Yes | String | The end of the time range to query. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm+0800 format. The time must be in UTC+8. The end time must be later than the start time. Example: 2016-08-01T21:14+0800. |
Metric | Yes | String | The metric to query. You can specify only one metric at a time. Valid values: traffic, bandwidth, static-https (number of static HTTPS requests), dynamic-http (number of dynamic HTTP requests), dynamic-https (number of dynamic HTTPS requests), static-quic (number of static QUIC requests), and dynamic-quic (number of dynamic QUIC requests). The Areas parameter takes effect only when the Metric parameter is set to bandwidth or traffic. |
CdnType | Yes | String | The business type. You can specify only one type at a time. Valid values: file, video, and page. |
Domains | No | String | The domain names to query. Separate multiple domain names with commas (,). By default, all domain names of the current account that are online in the specified time period are queried. When both the CdnType and Domains parameters are specified, a strong check is performed. |
Areas | No | String | The name of the area. For more information, see Usage notes. The Areas parameter takes effect only when the Metric parameter is set to bandwidth or traffic. In this case, you can specify only one area at a time, and the default value is CN. When the Metric parameter is set to static-https, dynamic-http, dynamic-https, static-quic, or dynamic-quic, this parameter does not take effect, and the statistics of all areas are returned. |
Interval | No | Long | The time granularity of the statistics data. Valid values: 5 (five minutes), 60 (one hour), and 1440 (one day). For granularities that are greater than or equal to 5 minutes, the peak bandwidth collected in the five-minute periods contained in the granularity is used. The default granularity is 5 minutes. You can query data within the past year. The start time and the end time cannot be more than 31 days apart. |
Parameter | Type | Description |
---|---|---|
StartTime | String | The beginning of the time range that is queried. |
EndTime | String | The end of the time range that is queried. |
CdnType | String | The business type. |
Domains | String | The domain names, separated with commas (,). |
Areas | String | The area. |
Interval | Long | The time granularity. |
Metric | Metric[] | The metric that is queried. |
RequestId | String | The ID of the request. |
PeakTime | String | The time when the bandwidth peaked. This parameter is returned only when the Metric parameter is set to bandwidth. |
Parameter | Type | Description |
---|---|---|
Time | String | The time point. The value is the time when the bandwidth peaked when the Metric parameter is set to bandwidth. |
Value | Long | The metric value. Unit: bytes, bit/s, or count. |
Sample request
GET method:
GET /2020-06-30/statistics/GetDomainUsageData?StartTime=2020-09-01T08%3a00%2b0800&EndTime=2020-09-01T08%3a05%2b0800&Metric=bandwidth&CdnType=video
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: GetDomainUsageData
x-version: 2020-06-30
POST method:
POST /2020-06-30/statistics/GetDomainUsageData
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: GetDomainUsageData
x-version: 2020-06-30
Content-Type: application/json
{
"StartTime":"2020-09-01T08:00+0800",
"EndTime":"2020-09-01T08:05+0800",
"Metric":"bandwidth",
"CdnType":"video"
}
Sample response
Pure Mode