Webhooks

Webhooks allow to register an url to a specific event (or alls) and the event will be posted on this URL. Each events can triger a post on a given url.

for example to listen all create events on http://echohttp.com/echo you can add this line in the webhooks sections of the gaffer setting file:

[webhooks]
create = http://echohttp.com/echo you

Or programatically:

from gaffer.manager import Manager
from gaffer.webhooks import WebHooks
hooks = [("create", "http://echohttp.com/echo you ")
webhooks = WebHooks(hooks=hooks)

manager = Manager()
manager.start(apps=[webhooks])

This gaffer application is started like other applications in the manager. All Gaffer events are supported.

The webhooks Module

class gaffer.webhooks.WebHooks(hooks=[])[source]

Bases: object

webhook app

close()[source]
decref()[source]
incref()[source]
maybe_start_monitor()[source]
maybe_stop_monitor()[source]
refcount
register_hook(event, url)[source]

associate an url to an event

restart()[source]
start(loop, manager)[source]

start the webhook app

stop()[source]

stop the webhook app, stop monitoring to events

unregister_hook(event, url)[source]

unregister an url for this event