flux icon indicating copy to clipboard operation
flux copied to clipboard

Create events API functions for PagerDuty

Open pauldix opened this issue 6 years ago • 2 comments

Flux users should be able to send events to PagerDuty. PagerDuty functions should go in the pagerduty namespace in the standard library. Details on PD's API can be found here: https://v2.developer.pagerduty.com/docs/send-an-event-events-api-v2

We can start with three functions:

trigger which will have arguments for each of the items in the API. token, routing_key, summary, source, and severity are all required arguments where the others are optional.

acknowledge which will take token, routing_key, and dedup_key as required arguments with no other optional arguments.

resolve which will take token, routing_key, and dedup_key as required arguments with no other optional arguments.

How should the responses be materialized? As a table? As an object of the parsed JSON response? Also, should we have a routing_key that is an integration for InfluxDB that is set to the default? I'm not sure if that's something that makes sense or if it should always be provided by the user.

//cc @rawkode @nathanielc @timhallinflux @russorat

pauldix avatar May 15 '19 22:05 pauldix

Hi @pauldix,

Thanks for your thoughts. I understand the use-case for trigger and resolve, but would we ever auto-acknowledge an incident?

With regards to what is returned, perhaps for an initial implementation it should just return the HTTP status code?

rawkode avatar May 16 '19 11:05 rawkode

acknowledge is for completeness and it's something we may need in the UI at some point. For the responses, we need them on trigger if the user doesn't specify a dedup_key since that will be auto-created and included in the response. For now I'd have it return an object like:

{
    "status_code": 202,
    "result": {
        "status": "success",
        "message": "Event processed",
        "dedup_key": "samplekeyhere"
    }
}

Where result is the parsed response body.

pauldix avatar May 16 '19 12:05 pauldix

This issue has had no recent activity and will be closed soon.

github-actions[bot] avatar Aug 05 '24 01:08 github-actions[bot]