airflow.providers.alibaba.cloud.operators.oss

This module contains Alibaba Cloud OSS operators.

Module Contents

Classes

OSSCreateBucketOperator

This operator creates an OSS bucket

OSSDeleteBucketOperator

This operator to delete an OSS bucket

OSSUploadObjectOperator

This operator to upload an file-like object

OSSDownloadObjectOperator

This operator to Download an OSS object

OSSDeleteBatchObjectOperator

This operator to delete OSS objects

OSSDeleteObjectOperator

This operator to delete an OSS object

class airflow.providers.alibaba.cloud.operators.oss.OSSCreateBucketOperator(region, bucket_name=None, oss_conn_id='oss_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

This operator creates an OSS bucket

Parameters
  • region (str) -- OSS region you want to create bucket

  • bucket_name (Optional[str]) -- This is bucket name you want to create

  • oss_conn_id (str) -- The Airflow connection used for OSS credentials.

execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.alibaba.cloud.operators.oss.OSSDeleteBucketOperator(region, bucket_name=None, oss_conn_id='oss_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

This operator to delete an OSS bucket

Parameters
  • region (str) -- OSS region you want to create bucket

  • bucket_name (Optional[str]) -- This is bucket name you want to delete

  • oss_conn_id (str) -- The Airflow connection used for OSS credentials.

execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.alibaba.cloud.operators.oss.OSSUploadObjectOperator(key, file, region, bucket_name=None, oss_conn_id='oss_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

This operator to upload an file-like object

Parameters
  • key (str) -- the OSS path of the object

  • file (str) -- local file to upload.

  • region (str) -- OSS region you want to create bucket

  • bucket_name (Optional[str]) -- This is bucket name you want to create

  • oss_conn_id (str) -- The Airflow connection used for OSS credentials.

execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.alibaba.cloud.operators.oss.OSSDownloadObjectOperator(key, file, region, bucket_name=None, oss_conn_id='oss_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

This operator to Download an OSS object

Parameters
  • key (str) -- key of the object to download.

  • local_file -- local path + file name to save.

  • region (str) -- OSS region

  • bucket_name (Optional[str]) -- OSS bucket name

  • oss_conn_id (str) -- The Airflow connection used for OSS credentials.

execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.alibaba.cloud.operators.oss.OSSDeleteBatchObjectOperator(keys, region, bucket_name=None, oss_conn_id='oss_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

This operator to delete OSS objects

Parameters
  • key -- key list of the objects to delete.

  • region (str) -- OSS region

  • bucket_name (Optional[str]) -- OSS bucket name

  • oss_conn_id (str) -- The Airflow connection used for OSS credentials.

execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

class airflow.providers.alibaba.cloud.operators.oss.OSSDeleteObjectOperator(key, region, bucket_name=None, oss_conn_id='oss_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

This operator to delete an OSS object

Parameters
  • key (str) -- key of the object to delete.

  • region (str) -- OSS region

  • bucket_name (Optional[str]) -- OSS bucket name

  • oss_conn_id (str) -- The Airflow connection used for OSS credentials.

execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?