airflow.providers.alibaba.cloud.sensors.oss_key

Module Contents

Classes

OSSKeySensor

Waits for a key (a file-like instance on OSS) to be present in an OSS bucket.

class airflow.providers.alibaba.cloud.sensors.oss_key.OSSKeySensor(bucket_key, region, bucket_name=None, oss_conn_id='oss_default', **kwargs)[source]

Bases: airflow.sensors.base.BaseSensorOperator

Waits for a key (a file-like instance on OSS) to be present in an OSS bucket.

OSS being a key/value, it does not support folders. The path is just a key resource.

Parameters
  • bucket_key (str) – The key being waited on. Supports full oss:// style url or relative path from root level. When it’s specified as a full oss:// url, please leave bucket_name as None.

  • region (str) – OSS region

  • bucket_name (str | None) – OSS bucket name

  • oss_conn_id (str | None) – The Airflow connection used for OSS credentials.

property get_hook: airflow.providers.alibaba.cloud.hooks.oss.OSSHook[source]

Create and return an OSSHook.

template_fields: Sequence[str] = ('bucket_key', 'bucket_name')[source]
poke(context)[source]

Check if the object exists in the bucket to pull key.

Parameters
  • self – the object itself

  • context (airflow.utils.context.Context) – the context of the object

Returns

True if the object exists, False otherwise

hook()[source]

Create and return an OSSHook.

Was this entry helpful?