Skip to content

winebarrel/pd_event_v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'
      #   }

About

PagerDuty Events API v2 Ruby Client.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published