airflow.contrib.operators.imap_attachment_to_s3_operator

Module Contents

class airflow.contrib.operators.imap_attachment_to_s3_operator.ImapAttachmentToS3Operator(imap_attachment_name, s3_key, imap_mail_folder='INBOX', imap_check_regex=False, s3_overwrite=False, imap_conn_id='imap_default', s3_conn_id='aws_default', *args, **kwargs)[source]

Bases: airflow.models.BaseOperator

Transfers a mail attachment from a mail server into s3 bucket.

Parameters
  • imap_attachment_name (str) – The file name of the mail attachment that you want to transfer.

  • s3_key (str) – The destination file name in the s3 bucket for the attachment.

  • imap_mail_folder (str) – The folder on the mail server to look for the attachment.

  • imap_check_regex (bool) – If set checks the imap_attachment_name for a regular expression.

  • s3_overwrite (bool) – If set overwrites the s3 key if already exists.

  • imap_conn_id (str) – The reference to the connection details of the mail server.

  • s3_conn_id (str) – The reference to the s3 connection details.

template_fields = ['imap_attachment_name', 's3_key'][source]
execute(self, context)[source]

This function executes the transfer from the email server (via imap) into s3.

Parameters

context (dict) – The context while executing.

Was this entry helpful?