API

eventproc

btrdbextras.eventproc.deregister(conn, handler_id)

Removes an existing event handler by ID.

Parameters
  • conn (Connection) – btrdbextras Connection object containing a valid address and api key.

  • handler_id (int) – ID of the event handler to remove.

btrdbextras.eventproc.hooks(conn)

List registered hooks.

Parameters

conn (Connection) – btrdbextras Connection object containing a valid address and api key.

btrdbextras.eventproc.list_handlers(conn, hook='')

List registered handlers. An optional hook name is allowed to filter results.

Parameters
  • conn (Connection) – btrdbextras Connection object containing a valid address and api key.

  • hook (str) – Optional hook name to filter registered handlers.

btrdbextras.eventproc.register(conn, name, hook, notify_on_success, notify_on_failure, tags=None)

decorator to submit (register) an event handler function

Parameters
  • conn (Connection) – btrdbextras Connection object containing a valid address and api key.

  • name (str) – Friendly name of this event handler for display purposes.

  • hook (str) – Name of the hook that this event handler responds to.

  • notify_on_success (str) – Email address of user to notify when event handler completes successfully.

  • notify_on_failure (str) – Email address of user to notify when event handler does not complete successfully.

  • tags (list of str) – Filtering tags that users can choose when identifying handlers to execute. An empty list will match all tags.

btrdbextras.eventproc.upload_file(file, file_name)

Uploads file to S3. Returns a link to download the file. If the function runs outside of an eventproc handler executing in response to a hook, it will just check the inputs, raise a warning, and return None.

Parameters
  • file (string) – Path to the file.

  • file_name (string) – Name that the file will be called on download. Maximum 36 characters.

Raises
  • TypeError – file must be a string.:

  • TypeError – file_name must be a string.:

  • ValueError – file must be a path to a file, relative to the home directory.:

  • ValueError – file_name cannot be longer than 200 characters, is <actual length>.:

Returns

string

Return type

Download link to the object. None if upload was not attempted.