You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
Log management API
DescribeDownloadTasks
Copy page
Download PDF
DescribeDownloadTasks
Call the DescribeDownloadTasks API to retrieve the list of log download tasks for a specified log topic.​
Instructions​
This API is limited to 20 calls per second. If exceeded, an ExceedQPSLimit error will be returned.​
Request instructions​
  • Request method: GET​
  • Request URL: https://{tls-endpoint}/DescribeDownloadTasks​
Request parameters​
The following table lists request parameters unique to this API and some common parameters. For more information, see Common parameters.​
Query​
​
Parameters​
Type​
Required​
Example value​
Description​
PageNumber​
Integer​
No​
10​
Page number for paginated queries. Defaults to 1, which returns data starting from the first page.​
PageSize​
Integer​
No​
20​
Page size. Default is 20; maximum is 100.​
TopicId​
String​
Yes​
4a9bd4bd-53f1-43ff-b88a-64ee1be5****​
Log topic ID.​
TaskName​
String​
No​
task1​
Filter by task name; supports fuzzy search.​
​
Return parameters​
The following table lists only the unique return parameters of this API. For more information, see Return Structure.​
​
Parameters​
Type​
Example value​
Description​
Tasks​
Array of DownloadTaskResp​
Refer to the returned example.​
Download task details.​
Total​
Integer​
1​
Number of log download tasks. TLS only supports saving download task information for up to one day.​
​
DownloadTaskResp​
​
Parameters​
Type​
Example value​
Description​
Query​
String​
*​
Log query and analysis statement.​
TaskId​
String​
4a************​
ID of the download task.​
EndTime​
String​
2022-08-25 15:00:02​
You must specify a log time range when performing query and analysis. Use this parameter to specify the end time. The format is yyyy-MM-dd HH:mm:ss.​
LogSize​
Integer​
1024​
The original log size; the unit is byte.​
TopicId​
String​
4a************​
Name of the log topic.​
LogCount​
Integer​
20​
Number of downloaded log entries.​
TaskName​
String​
test-task​
Name of the download task.​
StartTime​
String​
2022-08-25 15:00:01​
When performing query and analysis, you must specify the log time range. This parameter defines the start time. The format is yyyy-MM-dd HH:mm:ss.​
CreateTime​
String​
2022-08-25 15:00:03​
The creation time of the download task, formatted as yyyy-MM-dd HH:mm:ss.​
DataFormat​
String​
json​
Supported export formats: CSV, JSON, JSONL.​
TaskStatus​
String​
creating​
Download task status, indicating the generation status of the log compressed file. including:​
  • Creating: Generating file​
  • Created_cut: File generation interrupted​
  • Success: File has been generated​
  • Wait: Waiting​
  • Fail: Failed​
For more details on status, see the download log.​
Compression​
String​
gzip​
Export file compression format.​
  • none: No compression.​
  • gzip: Compress using gzip format.​
  • zip: Compress using zip format.​
TaskType​
Integer​
0​
Type of log to download.​
  • 0: Download query log type.​
  • 1: Download analysis log type.​
  • 2: download logs for the context type.​
AllowIncomplete​
Boolean​
false​
Allow downloading logs for imprecise query results.​
  • true: Allowed.​
  • false: Not allowed.​
LogContextInfos​
Object of LogContextInfos​
/​
Download the log information required for context query, including the source host, LogGroup ID, and the Serial number of the log within the LogGroup.​
This parameter will be returned when TaskType is 2.​
​
LogContextInfos​
​
Parameters​
Type​
Example value​
Description​
Source​
String​
127.10.10.**​
Hostname of the log source.​
You can get this value from the Logs in the response of the SearchLogs API.​
ContextFlow​
String​
e61050c-f7b3a4bf-2​
Specify the LogGroup ID where the log is located.​
You can obtain this value from the Logs in the response of the SearchLogs API.​
PackageOffset​
Long​
66​
Specify the log's serial number in the LogGroup.​
You can get this value from Logs in the SearchLogs API response.​
​
Sample request​
​
GET https://{tls-endpoint}/DescribeDownloadTasks?&PageNumber=10&PageSize=20&TopicId=4a9bd4bd-53f1-43ff-b88a-64ee1be5****&TaskName=task1 HTTP/1.1​
Content-Type: application/json​
​
Sample response​
​
Content-Type: application/json; charset=utf-8​
{​
"Tasks": [​
{​
"Query": "*",​
"TaskId": "4a************",​
"EndTime": "2022-08-25 15:00:02",​
"LogSize": 1024,​
"TopicId": "4a9bd4bd-53f1-43ff-b88a-64ee1be5****",​
"LogCount": 1000,​
"TaskName": "ProjectName-TopicName-timestamp",​
"TaskType": 0,​
"StartTime": "2022-08-25 15:00:01",​
"CreateTime": "2022-08-25 15:00:03",​
"DataFormat": "json",​
"TaskStatus": "creating",​
"Compression": "gzip",​
"AllowIncomplete": false​
}​
}​
],​
"Total": 1​
}​
​
Error Code​
The table below lists error codes related to the business logic of this API. For public error codes, see the Public Error Codes documentation.​
​
HTTP status code​
Error Code​
Error message​
Description​
404​
ErrIndexNotExists​
Index does not exist​
The index does not exist.​
500​
InternalServerError​
We encountered an unexpected server error, please try again later.​
Internal server error.​
​
Last updated: 2025.12.31 11:16:32