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

Torch Log Service

Copy page
Download PDF
Data transformation API
CreateETLTask
Copy page
Download PDF
CreateETLTask
Call the CreateETLTask API to create a transformation task.​
Request instructions​
  • Request method: POST​
  • Request URL: https://{tls-endpoint}/CreateETLTask​
Request parameters​
The table below lists only the parameters specific to this API and some common parameters. For more information, see Common parameters.​
Body​
​
Parameter​
Type​
Required​
Example value​
Description​
DSLType​
String​
Yes​
NORMAL​
DSL type, always NORMAL.​
Description​
String​
No​
This is a test project​
Brief description of the data transformation task.​
  • Does not support <>, ', \, \\.​
  • Length must be between 0 and 64 characters.​
Enable​
Boolean​
Yes​
true​
Enable data transformation tasks.​
  • true: Start.​
  • false: Stop.​
FromTime​
Integer​
No​
1643684482​
Start time for data transformation.​
Name​
String​
Yes​
etl-task-name​
Processing task name. For naming rules, refer to Resource naming rules.​
Script​
String​
Yes​
f_set("key","value")​
Processing rules.​
SourceTopicId​
String​
Yes​
4a9bd4bd-53f1-43ff-b88a-64ee1be5****​
The log topic containing logs to be processed for data transformation​
TargetResources​
Array of TargetResources​
Yes​
-​
Information about the output target.​
TaskType​
String​
Yes​
Resident​
Task type, fixed as Resident.​
ToTime​
Integer​
No​
1675393337​
End time for the data to be processed.​
​
TargetResources​
​
Parameter​
Type​
Required​
Example value​
Description​
Alias​
String​
Yes​
test​
Custom name for the output target, which is referenced in data transformation rules​
TopicId​
String​
Yes​
4a9bd4bd-53f1-43ff-b88a-64ee1be5****​
Used to store the log topic for processed logs​
Region​
String​
Yes​
cn-beijing​
The region of the log topic used to store processed logs​
RoleTrn​
String​
No​
trn:iam::2100000001:role/TLSETLAccessForUserA​
Cross-account authorized role name. You can log in to the IAM console. On Role Management, click the relevant role name and view the Basic Information to find the Role TRN.​
​
Return parameters​
The following table lists only the return parameters specific to this API. For more information, see Return structure.​
​
Parameter​
Type​
Example value​
Description​
TaskId​
String​
063e66a3-7764-4bdc-****-709a2f4219b4​
Processing task ID.​
​
Sample request​
​
POST https://{tls-endpoint}/CreateETLTask HTTP/1.1​
Content-Type: application/json​
{​
"DSLType": "NORMAL",​
"Description": "This is a test project",​
"Enable": true,​
"FromTime": 1643684482,​
"Name": "etl-task-name",​
"Script": "f_set("key","value")",​
"SourceTopicId": "4a9bd4bd-53f1-43ff-b88a-64ee1be5****",​
"TargetResources": [​
{​
"Alias": "test",​
"RoleTrn": "trn:iam::2100000001:role/TLSETLAccessForUserA",​
"TopicId": "4a9bd4bd-53f1-43ff-b88a-64ee1be5****",​
"Region":"cn-beijing"​
}​
],​
"TaskType": "Resident",​
"ToTime": 1675393337​
}​
​
Sample response​
​
{"TaskId": "063e66a3-7764-4bdc-****-709a2f4219b4"}​
​
Error Code​
You can visit Public Error Codes for more details on error codes.​
Last updated: 2025.10.28 18:42:01