Input Modules

class wishbone.module.cron.Cron(actor_config, native_events=False, cron='*/10 * * * *', payload='wishbone', destination='data')[source]

Generates an event at the defined time

Generates an event with the defined payload at the chosen time. Time is in crontab format.

Parameters:

- native_events(bool)(False)
   |  Whether to expect incoming events to be native Wishbone events

- cron(string)("*/10 * * * *")
    | The cron expression.

- payload(str)("wishbone")
    | The content of <destination>.

- destination(str)("data")
    | The location to write <payload> to.

Queues:

- outbox
   |  Outgoing messges
class wishbone.module.generator.Generator(actor_config, native_events=False, interval=1, payload='test', destination='data')[source]

Generates an event at the chosen interval.

The payload can be just about anything including template functions.

Parameters:

- destination(str)("data")
   |  The location write the payload to

- interval(float)(1)
   |  The interval in seconds between each generated event.
   |  A value of 0 means as fast as possible.

- native_events(bool)(False)
   |  Whether to expect incoming events to be native Wishbone events

- payload(str/dict/int/float)("test")
   |  The content of the test message.

Queues:

- outbox
   |  Contains the generated events.
class wishbone.module.wb_inotify.WBInotify(actor_config, native_events=False, destination='data', initial_listing=True, glob_pattern='*', paths={'/tmp': ['IN_CREATE', 'IN_CLOSE_WRITE']})[source]

Monitors one or more paths for inotify events.

Monitors one or more paths for the defined inotify events.

Inotify events can have following values:

  • IN_ACCESS
  • IN_ALL_EVENTS
  • IN_ATTRIB
  • IN_CLOEXEC
  • IN_CLOSE
  • IN_CLOSE_NOWRITE
  • IN_CLOSE_WRITE
  • IN_CREATE
  • IN_DELETE
  • IN_DELETE_SELF
  • IN_DONT_FOLLOW
  • IN_IGNORED
  • IN_ISDIR
  • IN_MASK_ADD
  • IN_MODIFY
  • IN_MOVE
  • IN_MOVED_FROM
  • IN_MOVED_TO
  • IN_MOVE_SELF
  • IN_NONBLOCK
  • IN_ONESHOT
  • IN_ONLYDIR
  • IN_OPEN
  • IN_Q_OVERFLOW
  • IN_UNMOUNT

Outgoing events have following format:

{"path": "/tmp/test", "inotify_type": "IN_ACCESS"}

Parameters:

- destination(str)(data)
   |  In which field to store the inotify event data.

- native_events(bool)(False)
   |  Whether to expect incoming events to be native Wishbone events.

- initial_listing(bool)(True)

   |  When True, generates for each defined path an event.  This is
   |  useful to initially give depending modules the filenames they
   |  need to function.

- glob_pattern(str)(*)

   |  A glob pattern to filter out only matching files.

- paths(dict)({"/tmp": ["IN_CREATE", "IN_CLOSE_WRITE"]})

   |  A dict of paths with a list of inotify events to monitor.  When
   |  the list is empty no filtering is done and results into all
   |  inotify events going through.

Queues:

- outbox
   |  Outgoing notify events.