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

Torch Log Service

Copy page
Download PDF
SQL analysis API
DescribeScheduleSqlTasks
Copy page
Download PDF
DescribeScheduleSqlTasks
Call the DescribeScheduleSqlTasks API to view details of all schedule SQL analysis tasks in the specified region. Supports pagination queries.​
Request instructions​
  • Request method: GET​
  • Request URL: https://{tls-endpoint}/DescribeScheduleSqlTasks​
Request parameters​
The following table lists only the unique parameters for this API and some common parameters. For more information, see Common Parameters.​
Query​
​
Parameter​
Type​
Required​
Example value​
Description​
ProjectId​
String​
No​
f3e901c3-b17f-42fd-aa8c-dc91a6c7****​
ID of the project that contains the source log topic.​
ProjectName​
String​
No​
yyj-test​
The name of the project associated with the source log topic.​
IamProjectName​
String​
No​
test​
IAM log project name​
TopicId​
String​
No​
f3e901c3-b17f-42fd-aa8c-dc91a6c7****​
Source topic ID.​
SourceTopicName​
String​
No​
topic-name​
Name of the source log topic.​
TaskId​
String​
No​
f3e901c3-b17f-42fd-aa8c-dc91a6c7****​
Scheduled SQL analysis task ID.​
TaskName​
String​
No​
test-task​
Name of scheduled SQL analysis task.​
Status​
String​
No​
0​
Status of schedule SQL tasks​
PageNumber​
Integer​
Not supported​
10​
The page number used for paginated queries The default value is 1, which returns data starting from the first page​
PageSize​
Integer​
No​
20​
Page size. The default is 20, and the maximum is 100.​
​
Return parameters​
This API does not have any specific return parameters. For more details, see Return structure.​
​
Parameter​
Type​
Example value​
Description​
Tasks​
[{"TaskId":"2de5d435-0480-4139-9c79-b4241e88****","TaskName":"test2","Description":"Test","SourceProjectID":"abd6b3a7-c730-4527-8d5f-e527b381****","SourceProjectName":"projectName","SourceTopicID":"c5c6b3a7-c730-4527-8d5f-e527b381****","SourceTopicName":"sourceTopicName","DestRegion":"cn-shanghai","DestProjectID":"c4737fdd-0c72-4c1f-b35e-3ae4a02d****","DestTopicID":"66b42cb6-3436-44ae-97bf-efab3043****","DestTopicName":"destTopicName","Status":1,"ProcessStartTime":1689042649,"RequestCycle":{"Type":"Period","Time":1},"ProcessTimeWindow":"@m-m,@m","CreateTimeStamp":1689042649,"ModifyTimeStamp":1689042649,"Query":"","ProcessSqlDelay":0}]​
Scheduled SQL analysis task list.​
Total​
Integer​
1​
Total number of returned tasks.​
​
DescribeScheduleSqlTaskResp​
​
Parameter​
Type​
Example value​
Description​
Query​
String​
* | select count(*)​
SQL query and analysis statement executed periodically by the scheduled SQL analysis task.​
Status​
Integer​
0​
Whether to start the scheduled SQL analysis task immediately after configuring the task.​
  • 0: Task is turned off and must be started manually later.​
  • 1: Start immediately.​
TaskId​
String​
2de5d435-0480-4139-9c79-b4241e88****​
Scheduled SQL analysis task ID.​
TaskName​
String​
task-name​
Name of the scheduled SQL analysis task.​
DestRegion​
String​
cn-shanghai​
The region where the target project is located.​
Description​
String​
This is a test ins.​
A brief description of the scheduled SQL analysis task.​
DestTopicID​
String​
d49a16d3-8711-445d-82a2-ab1689f4****​
Target log topic ID for storing scheduled SQL analysis results.​
RequestCycle​
Object of RequestCycle​
{"Type":"Period","Time":1}​
Scheduling cycle for periodic SQL analysis tasks.​
  • Type: scheduling cycle type.​
  • Period: schedules tasks at regular intervals.​
  • Fixed: schedules tasks at a fixed time every day.​
  • Time: the interval or the exact time when periodic execution occurs (number of minutes past 00:00). Valid range is 1–1440 minutes.​
DestProjectID​
String​
c253c122-aa35-42bd-9a9e-30f47c95****​
The project ID associated with the target log topic.​
DestTopicName​
String​
dest-topic-name​
Target log topic name for storing schedule SQL analysis results.​
ProcessEndTime​
Integer​
1702118732​
Set the end time for scheduling the schedule SQL analysis task The format uses a second-level timestamp​
CreateTimeStamp​
Integer​
1702032332​
Creation time of the scheduled SQL analysis task.​
ModifyTimeStamp​
Integer​
1702032332​
Last modified time of the scheduled SQL analysis task.​
ProcessSqlDelay​
Integer​
0​
Delay time for each schedule, in seconds.​
SourceProjectID​
String​
d49a16d3-8711-445d-82a2-ab1689f4****​
ID of the project that contains the source log topic.​
SourceTopicName​
String​
topicName​
Name of the source log topic containing the original logs for scheduled SQL analysis.​
ProcessStartTime​
Integer​
1702032332​
Specifies the start time for scheduling SQL tasks. This is when the first instance is triggered. Use a second-level timestamp format.​
ProcessTimeWindow​
String​
@m-m,@m​
SQL time window.​
SourceProjectName​
String​
d49a16d3-8711-445d-82a2-ab1689f4****​
Name of the project that contains the source log topic.​
SourceTopicID​
String​
66b42cb6-3436-44ae-97bf-efab3043**​
Source log topic ID for the original logs used in scheduled SQL analysis​
​
RequestCycle​
​
Parameter​
Type​
Example value​
Description​
Time​
Integer​
10​
The interval for scheduling or the time when periodic tasks execute (minutes from 00:00), ranging from 1 to 1440, measured in minutes.​
Type​
String​
Period​
Scheduling cycle type. Optional values:​
  • Period: Schedule at regular intervals.​
  • Fixed: Schedule at a fixed time each day.​
  • Cron: Use a Cron expression.​
CronTab​
String​
0 18 * * *​
Cron expression: TLS uses Cron expressions to schedule alert tasks. The minimum granularity of Cron expressions is one minute, using the 24-hour format. For example, 0 18 * * * means the alert task runs every day at 18:00.​
CronTimeZone​
String​
GMT+0800​
When Type is set to Cron, you must also specify the time zone. For a list of common time zones, see Select Time Zone.​
​
Sample request​
​
GET https://{tls-endpoint}/DescribeScheduleSqlTasks?&ProjectId=f3e901c3-b17f-42fd-aa8c-dc91a6c7****&ProjectName=&TopicId=f3e901c3-b17f-42fd-aa8c-dc91a6c7****&SourceTopicName=topic名称&TaskId=f3e901c3-b17f-42fd-aa8c-dc91a6c7****&TaskName=test-task&PageNumber=10&PageSize=20 HTTP/1.1​
Content-Type: application/json​
​
Sample response​
​
{​
"Total": 1,​
"Tasks": [​
{​
"TaskId": "2de5d435-0480-4139-9c79-b4241e88****",​
"TaskName": "test2",​
"Description": "This is a test ins.",​
"SourceProjectID": "abd6b3a7-c730-4527-8d5f-e527b381****",​
"SourceProjectName": "projectName",​
"SourceTopicID": "c5c6b3a7-c730-4527-8d5f-e527b381****",​
"SourceTopicName": "sourceTopicName",​
"DestRegion": "cn-shanghai",​
"DestProjectID": "c4737fdd-0c72-4c1f-b35e-3ae4a02d****",​
"DestTopicID": "66b42cb6-3436-44ae-97bf-efab3043****",​
"DestTopicName": "destTopicName",​
"Status": 1,​
"ProcessStartTime": 1689042649,​
"RequestCycle": {​
"Type": "Period",​
"Time": 1​
},​
"ProcessTimeWindow": "@m-m,@m",​
"CreateTimeStamp": 1689042649,​
"ModifyTimeStamp": 1689042649,​
"Query": "",​
"ProcessSqlDelay": 0​
}​
]​
}​
​
Error Code​
The table below lists error codes related to the business logic of this API. For general error codes, refer to the general error code documentation.​
​
HTTP status code​
Error Code​
Error message​
Description​
400​
InvalidArgument​
Invalid argument key %s, value %s, please check argument.​
Invalid parameter.​
404​
ScheduleSqlTaskNotExist​
Task %s does not exist.​
The schedule SQL analysis task does not exist.​
500​
InternalServerError​
We encountered an unexpected server error, please try again later.​
Internal server error​
​
Last updated: 2025.10.28 18:42:01