All Products
Search
Document Center

Simple Log Service:CreateETL

Last Updated:Mar 27, 2026

Creates a data transformation job in a project.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /etls HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
projectstringYes

Project name.

ali-test-project
bodyobjectNo

The configurations of the job.

namestringYes

The name of the job (unique within a project).

etl-123456
displayNamestringYes

The display name of the job.

sls-test-etl
descriptionstringNo

The description of the job.

this is ETL
configurationETLConfigurationYes

The detailed configuration of the job.

When you create a data transformation job of the new version, you must add the lang and datasets parameters. In this topic, Python code is used as an example.

# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import os
import sys

from typing import List

from alibabacloud_sls20201230.client import Client as Sls20201230Client
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_sls20201230 import models as sls_20201230_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient


class Sample:
    def __init__(self):
        pass

    @staticmethod
    def create_client() -> Sls20201230Client:
        """
        @return: Client
        @throws Exception
        config = open_api_models.Config(
            access_key_id=os.environ['ALIBABA_CLOUD_ACCESS_KEY_ID'],
            access_key_secret=os.environ['ALIBABA_CLOUD_ACCESS_KEY_SECRET']
        )
        config.endpoint = f'cn-hangzhou.log.aliyuncs.com'
        return Sls20201230Client(config)

    @staticmethod
    def main(
        args: List[str],
    ) -> None:
        client = Sample.create_client()
        etlconfiguration_etlconfiguration_sink_0 = sls_20201230_models.ETLConfigurationSink(
            name='my-test',
            project='my-test',
            endpoint='cn-hangzhou.log.aliyuncs.com',
            logstore='target',
            role_arn='***',
            datasets=["__UNNAMED__"]
        )
        etlconfiguration = sls_20201230_models.ETLConfiguration(
            script='* | where 1 = 1',
            lang='SPL',
            logstore='mock',
            role_arn='***',
            from_time=1729740027,
            to_time=0,
            sinks=[
                etlconfiguration_etlconfiguration_sink_0
            ]
        )
        create_etlrequest = sls_20201230_models.CreateETLRequest(
            name='etl-my-test',
            display_name='my-test',
            configuration=etlconfiguration
        )
        runtime = util_models.RuntimeOptions()
        headers = {}
        try:
            client.create_etlwith_options('my-test', create_etlrequest, headers, runtime)
        except Exception as error:
            print(error.message)
            print(error.data.get("Recommend"))
            UtilClient.assert_as_string(error.message)



if __name__ == '__main__':
    Sample.main(sys.argv[1:])

Response parameters

ParameterTypeDescriptionExample
headersobject
Serverstring

Server name.

nginx
Content-Typestring

The content type of the response body.

application/json
Content-Lengthstring

The content length of the response body.

100
Connectionstring

Indicates whether the connection is persistent. Valid values:

  • close: The connection is non-persistent. Each HTTP request requires a new TCP connection.
  • keep-alive: The connection is persistent. The TCP connection remains open, saving time and bandwidth.
close
x-log-requestidstring

The request ID.

5B0A6B60BB6EE39764D458B5

Examples

Sample success responses

JSONformat

{}

Error codes

HTTP status codeError codeError message
401AuthorizationRequiredAuthorization Required

For a list of error codes, visit the Service error codes.