Types¶
flowtask.hooks.types
¶
Hook Types.
Hook Types are triggers that can be executed when an event is triggered.
- FSWatchdog: Watches a specified directory for changes.
base
¶
BaseTrigger
¶
Bases: MaskSupport, LogSupport, LocaleSupport, ABC
BaseTrigger.
Base class for all Triggers in FlowTask.
setup
¶
setup.
Configuration of Trigger when started.
Args: app (aiohttp.web.Application): Web Application.
brokers
¶
Message Brokers.
Message Brokers are services that allow applications to send and receive messages.
Supported Message Brokers on Flowtask are: - MQTT - SQS - Redis - RabbitMQ
base
¶
BaseMQTrigger
¶
Bases: BaseTrigger
rabbitmq
¶
RabbitMQTrigger
¶
RabbitMQTrigger(*args, queue_name, routing_key='', exchange_name='', exchange_type='topic', credentials=None, actions=None, **kwargs)
Bases: BaseMQTrigger
redis
¶
RedisTrigger
¶
RedisTrigger(*args, stream_name, group_name='default_group', consumer_name='default_consumer', credentials=None, actions=None, **kwargs)
Bases: BaseMQTrigger
Redis Trigger.
Trigger that listens to a Redis Stream and calls actions based on the received messages.
fs
¶
FSWatchdog
¶
FsHandler
¶
Bases: PatternMatchingEventHandler
on_modified
¶
Handle file modification events.
This method is called when a file modification event is detected. It processes the event and calls the appropriate actions if the event meets certain criteria.
event (FileSystemEvent): The event object containing information about the file modification.
Returns: None
Note: - The method returns early if the event is for a directory or if 'modified' is not in the parent's events list. - It also returns early if the file was recently created to avoid duplicate processing. - If the file has zero size, a warning is logged. - The event is processed and actions are called twice with the same arguments.
jira
¶
mail
¶
EmailTrigger
¶
EmailTrigger(*args, webhook_url, tenant_id=None, client_id=None, client_secret=None, resource=None, **kwargs)
Bases: HTTPHook
authenticate
async
¶
Authenticates the client with Azure AD and initializes the Graph client.
This method creates a ClientSecretCredential using the tenant ID, client ID, and client secret. It then sets up an AzureIdentityAuthenticationProvider, initializes a GraphRequestAdapter, and finally creates a GraphServiceClient.
The method doesn't take any parameters as it uses the instance variables for authentication details.
Returns:
| Type | Description |
|---|---|
|
None |
postgres
¶
PostgresTrigger
¶
Bases: BaseTrigger
PostgresTrigger.
Trigger that listens for PostgreSQL events and sends notifications. Using LISTEN/NOTIFY Infraestructure.
responses
¶
sharepoint
¶
SharePointTrigger
¶
SharePointTrigger(*args, webhook_url, tenant_id=None, client_id=None, client_secret=None, resource=None, **kwargs)
Bases: HTTPHook
authenticate
async
¶
Authenticates the client with Azure AD and initializes the Graph client.
This method creates a ClientSecretCredential using the tenant ID, client ID, and client secret. It then sets up an AzureIdentityAuthenticationProvider, initializes a GraphRequestAdapter, and finally creates a GraphServiceClient.
The method doesn't take any parameters as it uses the instance variables for authentication details.
Returns:
| Type | Description |
|---|---|
|
None |
ssh
¶
SFTPWatcher
¶
SFTPWatcher(host, port, username, password, path, interval=300, max_retries=5, retry_delay=60, **kwargs)
Bases: BaseWatcher