All Products
Search
Document Center

Simple Log Service:CreateETL

Last Updated:Jun 11, 2026

Membuat Pekerjaan transformasi data di Proyek tertentu.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Sintaks permintaan

POST /etls HTTP/1.1

Parameter permintaan

Parameter

Type

Required

Description

Example

project

string

Yes

Nama Proyek.

ali-test-project

body

object

No

Konfigurasi Pekerjaan transformasi data.

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.

Untuk membuat Pekerjaan transformasi data yang menggunakan fitur baru, Anda juga harus menentukan parameter lang dan datasets. Kode Python berikut memberikan contoh.

# -*- 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:])

Elemen respons

Element

Type

Description

Example

Tidak ada yang didefinisikan.

Contoh

Respons sukses

JSONformat

{}

Kode kesalahan

HTTP status code

Error code

Error message

Description

401 AuthorizationRequired Authorization Required

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.