General Purpose Webhook API Support with User Defined Headers and Payload

Registered by Dexter Fryar on 2015-02-02

Provide alarm notification support for general purpose webhook API endpoints. Allow user defined HTTP methods, payloads, and headers. Support for custom headers to prevent server logs from storing authentication tokens. Provide an alarm data substitution mechanism to allow users to define static webhook notifications which can map predefined alarm data to the payload.

The general webhook mechanism shall provide similar behavior to cURL which is the command line tool and library for transferring data with URL.

User stories
: As an operator using Monasca to monitor my cloud solutions, I want to specify alarm notifications that automatically post messages to my operators using services like HipChat.
: As an operator using Monasca to monitor my cloud solutions, I want to specify alarm notifications that automatically create Gists from alarm data to a private or public endpoints to share snippets and pastes with others.
: As an operator using Monasca to monitor my cloud solutions, I want to specify alarm notifications that allow batched webhook notifications such that I could post a Gist and post the link to a chat room for operators to examine.

Applicable Webhook API's

* https://www.hipchat.com/docs/apiv2/method/send_room_notification
* https://developer.github.com/v3/gists/#create-a-gist

Anatomy of a user defined webhook alarm notification

1) URL
2) Method
3) Headers
4) Payload
5) Alarm data to variable mapping e.g. substitution from key:value alarm data to webhook payload insertion

Example static alarm payload that can be included via substitution, or added as a complete JSON payload to the webhook payload.

* Specific key/value substitution
* Entire alarm JSON structure insertion

{
    "alarm_definition": {
        "severity": "LOW",
        "id": "3174f224-ef0b-45db-95bc-39c1dde59edf",
        "links": [
            {
                "href": "http://192.168.10.4:8080/v2.0/alarm-definitions/3174f224-ef0b-45db-95bc-39c1dde59edf",
                "rel": "self"
            }
        ],
        "name": "Disk Inode Usage"
    },
    "alarm": {
        "id": "1cbf6a9b-2106-42a0-8981-245becfcccbe",
        "state": "UNDETERMINED",
        "links": [
            {
                "href": "http://192.168.10.4:8080/v2.0/alarms/1cbf6a9b-2106-42a0-8981-245becfcccbe",
                "rel": "self"
            }
        ]
    }
}

Prototype code:

https://github.com/dlfryar/monasca-webhook-api

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Dexter Fryar
Direction:
Needs approval
Assignee:
None
Definition:
Drafting
Series goal:
None
Implementation:
Deferred
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

Work items:
Design the UI: TODO
Test the UI: TODO
Design the retry mechanism: TODO
Add notification support for general purpose webhooks: TODO
Test general purpose webhooks against HipChat and GitHub: TODO
Document the usage: TODO

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.