All Products
Search
Document Center

Simple Log Service:CreateETL

Last Updated:Nov 14, 2025

Creates a data transformation job in a specified project.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /etls HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

project

string

Yes

The project name.

ali-test-project

body

object

No

The configuration of the data transformation job.

name

string

Yes

The job name. The naming convention is as follows:

The job name must be unique within the project.

  • The name can contain only lowercase letters, digits, hyphens (-), and underscores (_).

  • The name must start and end with a lowercase letter or a digit.

  • The length must be 2 to 64 characters.

etl-123456

displayName

string

Yes

The display name of the data transformation job.

sls-test-etl

description

string

No

The description of the data transformation job.

this is ETL

configuration ETLConfiguration

Yes

The detailed configuration of the data transformation job.

To create a data transformation job that uses the new feature, you must also specify the lang and datasets parameters. The following Python code provides 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 elements

Element

Type

Description

Example

None defined.

Examples

Success response

JSON format

{}

Error codes

HTTP status code

Error code

Error message

Description

401 AuthorizationRequired Authorization Required

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.