CreateETL

Updated at:

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

log:CreateETL

create

*Project

acs:log:{#regionId}:{#accountId}:project/{#project}/etl/{#etlName}

None None

Request syntax

POST /etls HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

project

string

Yes

The name of the project.

ali-test-project

body

object

No

The configuration of the data transformation job.

configuration ETLConfiguration

Yes

The detailed configuration of the data transformation job.

description

string

No

The description of the data transformation job.

this is ETL

displayName

string

Yes

The display name of the data transformation job.

sls-test-etl

name

string

Yes

The name of the job. The naming rules are as follows:

The job name must be unique within the same 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 name must be 4 to 64 characters in length.

etl-123456

To create a new-version data transformation job, you must additionally 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 You do not have access permissions. User authentication is required.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.