event.handler.s3

Module Contents

Classes

S3Handler

Event handler that relies on AWS S3.

class event.handler.s3.S3Handler(event_s3_url: str, log_s3_url: str, sse: str = 'AES256', profile: str | None = None)

Bases: e3.event.EventHandler

Event handler that relies on AWS S3.

classmethod decode_config(config_str: str) dict[str, str | None]

Decode a config string into a dict.

Parameters:

config_str – the string containing configuration information

Returns:

a dict that can be used as **kwargs for the handler initialization method

encode_config() str

Encode the handler configuration into a string.

This default implementation can be used for handlers that do not need any configuration parameters (i.e: for which __init__ does not take any parameter apart for self).

Returns:

a string that contains the current handler configuration. The string should not contain the ‘|’ character.

s3_prefix(event: e3.event.Event) str

Additional prefix that depends on the event itself.

This hook allows a user to add a prefix that depends on the event itself. Note that sufixes are still automatically computed so distinct events can return the same prefix. The final s3 url used will be {log_s3_url}/{s3_prefix}{automatic suffix} for logs and {event_s3_url}/{s3_prefix}{automatic suffix} for events metadata.

Parameters:

event – an event

Returns:

the prefix

send_event(event: e3.event.Event) bool

Send an event.

Parameters:

event – an Event

Returns:

True on success, False otherwise