pagerduty-sdk 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb62479652d262b0920666828da1fcf7742dde8a
4
- data.tar.gz: 4d3ce2efa6fcb9ac163af176f9d406fb1aa431b5
3
+ metadata.gz: 8fd8e2d77075c877e57f0f9f31c00cbe2be4d093
4
+ data.tar.gz: c670ba7104f17fbcdbb3b3922fab5ab939766ada
5
5
  SHA512:
6
- metadata.gz: fc7611edc60bb045e1cc14599fc519565b45a05331ae6a0008b5bfdd20ecf197608e53283adc8cc2fae2a0ce7b6e2afc248496d2da2d6a6af46da26c70df2809
7
- data.tar.gz: c44e5ff4d83db5e29cd8aedcb3462b05b90e122bd0b3fad820ca76715bf7c32d25f56c9b305a326d86f19e0f009a51c0225baeeae21b938f7c106f2d75b35d44
6
+ metadata.gz: 8a924e251cb1d4fcc3982dc0bdce9170b0e7dc649d160d6fd8868d9a9d0e443577a281ea3f06c588aaa62f00a532d90614ca60b0fb59e18eaa35d124739b9285
7
+ data.tar.gz: 66a3965d498497c8647c735e1fb36c943fac8725b559cb65667dfbc22613ca67bc6f4c4597db674a212616d13df0ed08372e2cb73d8b9b922aad77d250ac091a
data/README.md CHANGED
@@ -26,4 +26,4 @@ pagerduty = Pagerduty.new(token: "#{token}", subdomain: "#{subdomain}")
26
26
  #<Pagerduty:0x007f9a340fc410>
27
27
  ```
28
28
 
29
- See [YARD documentation](http://rubydoc.info/gems/pagerduty-sdk/1.0.2/frames) for specific function usage.
29
+ See [YARD documentation](http://rubydoc.info/github/kryptek/pagerduty-sdk/master/frames) for specific function usage.
@@ -34,7 +34,9 @@ require 'pagerduty/models/notes'
34
34
  require 'pagerduty/models/incident'
35
35
  require 'pagerduty/models/incidents'
36
36
  require 'pagerduty/models/services'
37
+ require 'pagerduty/models/integration'
37
38
 
38
39
  # Requests
39
40
  require 'pagerduty/requests/incident'
41
+ require 'pagerduty/requests/integration'
40
42
  #require 'pagerduty/requests/alerts'
@@ -0,0 +1,9 @@
1
+ class Pagerduty
2
+ class Integration
3
+ include Virtus.model
4
+
5
+ attribute :status
6
+ attribute :message
7
+ attribute :incident_key
8
+ end
9
+ end
@@ -0,0 +1,74 @@
1
+ class Pagerduty
2
+
3
+ # Your monitoring tools should send PagerDuty a trigger event to report a new or ongoing problem. When PagerDuty receives a trigger event, it will either open a new incident, or add a new trigger log entry to an existing incident, depending on the provided incident_key
4
+ #
5
+ # ==== Parameters
6
+ # * options<~Hash>:
7
+ # * 'service_key'<~String> - The GUID of one of your "Generic API" services. This is the "service key" listed on a Generic API's service detail page
8
+ # * 'description'<~String> - A short description of the problem that led to this trigger. This field (or a truncated version) will be used when generating phone calls, SMS messages and alert emails. It will also appear on the incidents tables in the PagerDuty UI. The maximum length is 1024 characters
9
+ # * 'incident_key'<~String> - Identifies the incident to which this trigger event should be applied. If there's no open (i.e. unresolved) incident with this key, a new one will be created. If there's already an open incident with a matching key, this event will be appended to that incident's log. The event key provides an easy way to "de-dup" problem reports. If this field isn't provided, PagerDuty will automatically open a new incident with a unique key
10
+ # * 'details'<~Hash> - Any data you'd like included in the incident log
11
+ #
12
+ # ==== Returns
13
+ # * <~Pagerduty::Integration>
14
+ # * 'status'<~String>
15
+ # * 'incident_key'<~String>
16
+ # * 'message'<~String>
17
+ #
18
+ # {Pagerduty API Reference}[http://developer.pagerduty.com/documentation/integration/events/trigger]
19
+ def trigger(options={})
20
+ Pagerduty::Integration.new(curl({
21
+ uri: 'https://events.pagerduty.com/generic/2010-04-15/create_event.json',
22
+ data: options.merge({event_type: 'trigger'}),
23
+ method: 'POST'
24
+ }))
25
+ end
26
+
27
+ # Acknowledge events cause the referenced incident to enter the acknowledged state
28
+ #
29
+ # ==== Parameters
30
+ # * options<~Hash>:
31
+ # * 'service_key'<~String> - The GUID of one of your "Generic API" services. This is the "service key" listed on a Generic API's service detail page
32
+ # * 'description'<~String> - Text that will appear in the incident's log associated with this event.
33
+ # * 'incident_key'<~String> - Identifies the incident to acknowledge. This should be the incident_key you received back when the incident was first opened by a trigger event. Acknowledge events referencing resolved or nonexistent incidents will be discarded
34
+ # * 'details'<~Hash> - Any data you'd like included in the incident log
35
+ #
36
+ # ==== Returns
37
+ # * <~Pagerduty::Integration>
38
+ # * 'status'<~String>
39
+ # * 'incident_key'<~String>
40
+ # * 'message'<~String>
41
+ #
42
+ # {Pagerduty API Reference}[http://developer.pagerduty.com/documentation/integration/events/trigger]
43
+ def acknowledge(options={})
44
+ Pagerduty::Integration.new(curl({
45
+ uri: 'https://events.pagerduty.com/generic/2010-04-15/create_event.json',
46
+ data: options.merge({event_type: 'acknowledge'}),
47
+ method: 'POST'
48
+ }))
49
+ end
50
+
51
+ # Resolve events cause the referenced incident to enter the resolved state
52
+ #
53
+ # ==== Parameters
54
+ # * options<~Hash>:
55
+ # * 'service_key'<~String> - The GUID of one of your "Generic API" services. This is the "service key" listed on a Generic API's service detail page
56
+ # * 'description'<~String> - Text that will appear in the incident's log associated with this event.
57
+ # * 'incident_key'<~String> - Identifies the incident to acknowledge. This should be the incident_key you received back when the incident was first opened by a trigger event. Acknowledge events referencing resolved or nonexistent incidents will be discarded
58
+ # * 'details'<~Hash> - Any data you'd like included in the incident log
59
+ #
60
+ # ==== Returns
61
+ # * <~Pagerduty::Integration>
62
+ # * 'status'<~String>
63
+ # * 'incident_key'<~String>
64
+ # * 'message'<~String>
65
+ #
66
+ # {Pagerduty API Reference}[http://developer.pagerduty.com/documentation/integration/events/trigger]
67
+ def resolve(options={})
68
+ Pagerduty::Integration.new(curl({
69
+ uri: 'https://events.pagerduty.com/generic/2010-04-15/create_event.json',
70
+ data: options.merge({event_type: 'resolve'}),
71
+ method: 'POST'
72
+ }))
73
+ end
74
+ end
@@ -6,7 +6,7 @@ require 'pagerduty/pagerduty'
6
6
 
7
7
  Gem::Specification.new do |gem|
8
8
  gem.name = "pagerduty-sdk"
9
- gem.version = '1.0.3'
9
+ gem.version = '1.0.4'
10
10
  gem.authors = ["Alfred Moreno"]
11
11
  gem.email = ["kryptek@gmail.com"]
12
12
  gem.description = %q{An SDK for Pagerduty's API}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagerduty-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alfred Moreno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-02 00:00:00.000000000 Z
11
+ date: 2013-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_support
@@ -72,6 +72,7 @@ files:
72
72
  - lib/pagerduty/models/escalationpolicies.rb
73
73
  - lib/pagerduty/models/incident.rb
74
74
  - lib/pagerduty/models/incidents.rb
75
+ - lib/pagerduty/models/integration.rb
75
76
  - lib/pagerduty/models/laststatuschangeby.rb
76
77
  - lib/pagerduty/models/log_entry.rb
77
78
  - lib/pagerduty/models/maintenance_window.rb
@@ -88,6 +89,7 @@ files:
88
89
  - lib/pagerduty/pagerduty.rb
89
90
  - lib/pagerduty/requests/alerts.rb
90
91
  - lib/pagerduty/requests/incident.rb
92
+ - lib/pagerduty/requests/integration.rb
91
93
  - pagerduty-sdk.gemspec
92
94
  homepage: https://github.com/kryptek/pagerduty-sdk
93
95
  licenses: