Jump to: navigation, search

Senlin/webhook

< Senlin
Revision as of 09:19, 23 March 2015 by Yanyan Hu (talk | contribs) (Webhook)

Webhook

Webhook is used to trigger a specific action of a senlin entity, typically scaling out/in action of a cluster.

Design

Workflow

1. User create a webhook though webhook API. User need to specify what action and which senlin entity this webhook is linked to. Also for some specific actions, user can define the parameters they want to user when invoking the cluster action API, e.g. the adjustment of scaling operation;
2. Senlin service receives the request and 1)create a webhook object and generate a webhook url, like webhooks/$webhook_id/trigger; 2)make a trust with *senlin* user as trustee and cluster owner as trustor;
3. User get the url of webhook.
4. User trigger the webhook by post a http request to its url. No any credential is needed here.
5. Senlin service handles this post request and generate a new API request to cluster action. *senlin* user's credential is used in this new API request;
6. Senlin service receives the cluster action API request and perform cluster scaling operation;

Implementation