https://github.com/winebarrel/pd_event_v2
PagerDuty Events API v2 Ruby Client.
https://github.com/winebarrel/pd_event_v2
pagerduty ruby
Last synced: over 1 year ago
JSON representation
PagerDuty Events API v2 Ruby Client.
- Host: GitHub
- URL: https://github.com/winebarrel/pd_event_v2
- Owner: winebarrel
- License: mit
- Created: 2019-11-29T07:35:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-01T03:44:08.000Z (over 6 years ago)
- Last Synced: 2024-10-19T00:15:54.050Z (over 1 year ago)
- Topics: pagerduty, ruby
- Language: Ruby
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# PdEventV2
[PagerDuty Events API v2](https://v2.developer.pagerduty.com/docs/events-api-v2) Ruby Client.
[](http://badge.fury.io/rb/pd_event_v2)
[](https://travis-ci.org/winebarrel/pd_event_v2)
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'pd_event_v2'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install pd_event_v2
## Usage
```ruby
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'
# }
```