0.0
No commit activity in last 3 years
No release in over 3 years
PagerDuty Events API v2 Ruby Client.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 3

Runtime

 Project Readme

PdEventV2

PagerDuty Events API v2 Ruby Client.

Gem Version Build Status

Installation

Add this line to your application's Gemfile:

gem 'pd_event_v2'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pd_event_v2

Usage

require 'pd_event_v2'

# routing_key: Integration Key
client = PdEventV2::Client.new(routing_key: 'ZAPZAPZAP')

# see https://v2.developer.pagerduty.com/v2/docs/send-an-event-events-api-v2
res = client.trigger(
  payload: {
    summary: 'Example alert on host1.example.com',
    source: 'monitoringtool:cloudvendor:central-region-dc-01:852559987:cluster/api-stats-prod-003',
    severity: 'info'
  }
)

p res #=> {
      #     'status' => 'success',
      #     'message' => 'Event processed',
      #     'dedup_key' => '3c053fc438cc4608b8382b28adc0af8d'
      #   }