CreateUserUsageDataExportTask

Last updated:2021-07-20 11:45:43

CreateUserUsageDataExportTask

Description

You can call this operation to create a usage data export task for the current account. The task can generate a PDF file containing history usage that you can download.

History usage includes the values of all metrics in the specified time period. The metrics include 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).

  • You can specify a start date and end date to query data. You must specify both the start date and the end date. Do not specify the hour, minute, second, or millisecond. The default start time is 00:00:00 on the specified start date, and the default end time is 23:59:59 on the specified end date.
  • You can query data of any day or month within the past year.
  • You can specify a language for the export file. Chinese and English are supported. By default, the file is in Chinese.
  • Timeliness: You can query only data that was generated 5 minutes before.

Request syntax

The API request contains the specified directory /2020-06-30/statistics/CreateUserUsageDataExportTask, common request headers, and operation-specific request parameters. For more information, see the sample request.

Request parameters

Parameter Required Type Description
StartTime Yes String The start date. Specify the time in the ISO 8601 standard in the YYYY-MM-DD format. The time must be in UTC+8. Example: 2016-08-01.
EndTime Yes String The end date. Specify the time in the ISO 8601 standard in the YYYY-MM-DD format. The time must be in UTC+8. The end time must be later than the start time. Example: 2016-08-01.
CdnType Yes String The business type. You can specify only one type at a time. Valid values: file, video, and page.
TaskName No String The name of the task. The name can be up to 256 bytes in size.
Language No String The language of the export file. Valid values: zh-cn and en-us. Default value: zh-cn.

Response parameters

Parameter Type Description
StartTime String The start date.
EndTime String The end date.
CdnType String The business type.
TaskID String The ID of the task.
RequestId String The ID of the request.

Examples

Sample request

GET method:

GET /2020-06-30/statistics/CreateUserUsageDataExportTask?StartTime=2020-09-01T08%3a00%2b0800&EndTime=2020-09-01T08%3a05%2b0800&CdnType=video
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: CreateUserUsageDataExportTask
x-version: 2020-06-30

POST method:

POST /2020-06-30/statistics/CreateUserUsageDataExportTask
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: CreateUserUsageDataExportTask
x-version: 2020-06-30
Content-Type: application/json
{
    "StartTime":"2020-09-01T08:00+0800",
    "EndTime":"2020-09-01T08:05+0800",
    "CdnType":"video"
}

Sample response

{
    "StartTime": "2020-09-01T08:00+0800",
    "EndTime": "2020-09-01T08:05+0800",
    "CdnType": "video",
    "TaskId":"129456",
    "RequestId": "8f23d14c-539c-4458-bdbc-ba68c1a512ce"
}

Did you find the above information helpful?

Unhelpful
Mostly Unhelpful
A little helpful
Helpful
Very helpful

What might be the problems?

Insufficient
Outdated
Unclear or awkward
Redundant or clumsy
Lack of context for the complex system or functionality

More suggestions

0/200

Please give us your feedback.

Submitted

Thank you for your feedback.

问题反馈