blob: d99eada248bc94f80c05aa64c31c838987f33143 [file] [log] [blame]
:mod:`airflow.contrib.sensors.imap_attachment_sensor`
=====================================================
.. py:module:: airflow.contrib.sensors.imap_attachment_sensor
Module Contents
---------------
.. py:class:: ImapAttachmentSensor(attachment_name, mail_folder='INBOX', check_regex=False, conn_id='imap_default', *args, **kwargs)
Bases: :class:`airflow.sensors.base_sensor_operator.BaseSensorOperator`
Waits for a specific attachment on a mail server.
:param attachment_name: The name of the attachment that will be checked.
:type attachment_name: str
:param check_regex: If set to True the attachment's name will be parsed as regular expression.
Through this you can get a broader set of attachments
that it will look for than just only the equality of the attachment name.
The default value is False.
:type check_regex: bool
:param mail_folder: The mail folder in where to search for the attachment.
The default value is 'INBOX'.
:type mail_folder: str
:param conn_id: The connection to run the sensor against.
The default value is 'imap_default'.
:type conn_id: str
.. attribute:: template_fields
:annotation: = ['attachment_name']
.. method:: poke(self, context)
Pokes for a mail attachment on the mail server.
:param context: The context that is being provided when poking.
:type context: dict
:return: True if attachment with the given name is present and False if not.
:rtype: bool