beeper 0.0.2 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/beeper/client.rb CHANGED
@@ -5,7 +5,11 @@ module Beeper
5
5
  class Client
6
6
  COLLECTIONS = [:incidents, :services, :maintenance_windows].freeze
7
7
 
8
- attr_accessor :api_key, :subdomain, :requester_id
8
+ attr_accessor :api_key, :subdomain, :requester_id, :use_ssl
9
+
10
+ def initialize
11
+ @use_ssl = true
12
+ end
9
13
 
10
14
  def configured?
11
15
  !@api_key.nil? && !@subdomain.nil?
@@ -54,8 +58,12 @@ module Beeper
54
58
  }
55
59
  end
56
60
 
61
+ def protocol
62
+ use_ssl ? "https" : "http"
63
+ end
64
+
57
65
  def connection
58
- @connection ||= Faraday.new("https://#@subdomain.pagerduty.com/api/v1") do |conn|
66
+ @connection ||= Faraday.new("#{protocol}://#@subdomain.pagerduty.com/api/v1") do |conn|
59
67
  conn.request :json
60
68
  conn.token_auth @api_key
61
69
 
@@ -1,3 +1,3 @@
1
1
  module Beeper
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.6"
3
3
  end
data/spec/beeper_spec.rb CHANGED
@@ -3,10 +3,29 @@ require File.join(File.dirname(__FILE__), 'spec_helper')
3
3
  describe Beeper do
4
4
  it "should be able to configure itself" do
5
5
  client = Beeper.configure do |c|
6
- c.api_key = "00000000000"
6
+ c.api_key = "00000000000"
7
7
  c.subdomain = "testdomain"
8
8
  end
9
9
 
10
10
  client.configured?.should == true
11
11
  end
12
+
13
+ it "should use https by default" do
14
+ client = Beeper.configure do |c|
15
+ c.api_key = "00000000000"
16
+ c.subdomain = "testdomain"
17
+ end
18
+
19
+ client.use_ssl.should == true
20
+ end
21
+
22
+ it "should be able to use http" do
23
+ client = Beeper.configure do |c|
24
+ c.api_key = "00000000000"
25
+ c.subdomain = "testdomain"
26
+ c.use_ssl = false
27
+ end
28
+
29
+ client.use_ssl.should == false
30
+ end
12
31
  end
@@ -1,290 +1,494 @@
1
- ---
2
- http_interactions:
3
- - request:
1
+ ---
2
+ recorded_with: VCR 2.3.0
3
+ http_interactions:
4
+ - request:
4
5
  method: get
5
6
  uri: https://outright.pagerduty.com/api/v1/incidents
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Authorization:
7
+ body:
8
+ string: ""
9
+ headers:
10
+ Authorization:
11
11
  - Token token="API_KEY"
12
- response:
13
- status:
12
+ response:
13
+ status:
14
14
  code: 200
15
15
  message:
16
- headers:
17
- server:
16
+ headers:
17
+ server:
18
18
  - nginx/1.0.14
19
- date:
20
- - Tue, 18 Dec 2012 18:33:32 GMT
21
- content-type:
22
- - application/json; charset=utf-8
23
- transfer-encoding:
24
- - chunked
25
- connection:
19
+ connection:
26
20
  - keep-alive
27
- status:
28
- - 200 OK
29
- x-ua-compatible:
30
- - IE=Edge,chrome=1
31
- etag:
32
- - ! '"d1b5dee8546d999c78d82cd08b9e7855"'
33
- cache-control:
21
+ cache-control:
34
22
  - must-revalidate, private, max-age=0
35
- set-cookie:
36
- - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWFhYTIzMjliZWIwMTQ3ZmQyZDA3OTkwMzQ1OGFmNTViBjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--c70789a0af4bf7cf09ee7665e32c1c4dba02dd9a;
37
- path=/; HttpOnly, uid=CvgRmlDQtvzB3Si+TZMJAg==; expires=Thu, 31-Dec-37 23:55:55
38
- GMT; domain=pagerduty.com; path=/
39
- x-request-id:
40
- - d0e97db26c0e27f1ae025a3776f758cc
41
- x-runtime:
42
- - '0.537506'
43
- x-rack-cache:
23
+ x-ua-compatible:
24
+ - IE=Edge,chrome=1
25
+ x-rack-cache:
44
26
  - miss
45
- body:
46
- encoding: US-ASCII
47
- string: ! '{"incidents":[{"id":"PPACGEI","incident_number":336,"created_on":"2012-11-22T05:05:18Z","status":"resolved","html_url":"http://outright.pagerduty.com/incidents/PPACGEI","incident_key":"__TRIGGERED_VIA_EMAIL__","service":{"id":"PGV50ZJ","name":"Pingdom","html_url":"http://outright.pagerduty.com/services/PGV50ZJ"},"assigned_to_user":null,"trigger_summary_data":{"subject":"DOWN
48
- alert: Thrift (secure.outright.com) is DOWN"},"trigger_details_html_url":"http://outright.pagerduty.com/incidents/PPACGEI/log_entries/PTYKKQ6","last_status_change_on":"2012-11-22T05:15:52Z","last_status_change_by":{"id":"REQUESTER_ID","name":"Trae
49
- Robrock","email":"trae@outright.com","html_url":"http://outright.pagerduty.com/users/REQUESTER_ID"},"number_of_escalations":1},{"id":"P0M3DH0","incident_number":337,"created_on":"2012-11-24T12:03:45Z","status":"resolved","html_url":"http://outright.pagerduty.com/incidents/P0M3DH0","incident_key":"__TRIGGERED_VIA_EMAIL__","service":{"id":"PGV50ZJ","name":"Pingdom","html_url":"http://outright.pagerduty.com/services/PGV50ZJ"},"assigned_to_user":null,"trigger_summary_data":{"subject":"DOWN
50
- alert: Thrift (secure.outright.com) is DOWN"},"trigger_details_html_url":"http://outright.pagerduty.com/incidents/P0M3DH0/log_entries/PIHR7C3","last_status_change_on":"2012-11-24T12:25:04Z","last_status_change_by":{"id":"P3859OT","name":"Julio
51
- Santos","email":"julio@outright.com","html_url":"http://outright.pagerduty.com/users/P3859OT"},"number_of_escalations":0}],"limit":100,"offset":0,"total":2}'
27
+ transfer-encoding:
28
+ - chunked
29
+ etag:
30
+ - "\"d1b5dee8546d999c78d82cd08b9e7855\""
31
+ x-runtime:
32
+ - "0.537506"
33
+ content-type:
34
+ - application/json; charset=utf-8
35
+ x-request-id:
36
+ - d0e97db26c0e27f1ae025a3776f758cc
37
+ status:
38
+ - 200 OK
39
+ set-cookie:
40
+ - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWFhYTIzMjliZWIwMTQ3ZmQyZDA3OTkwMzQ1OGFmNTViBjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--c70789a0af4bf7cf09ee7665e32c1c4dba02dd9a; path=/; HttpOnly, uid=CvgRmlDQtvzB3Si+TZMJAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
41
+ date:
42
+ - Tue, 18 Dec 2012 18:33:32 GMT
43
+ body:
44
+ string: "{\"incidents\":[{\"id\":\"PPACGEI\",\"incident_number\":336,\"created_on\":\"2012-11-22T05:05:18Z\",\"status\":\"resolved\",\"html_url\":\"http://outright.pagerduty.com/incidents/PPACGEI\",\"incident_key\":\"__TRIGGERED_VIA_EMAIL__\",\"service\":{\"id\":\"PGV50ZJ\",\"name\":\"Pingdom\",\"html_url\":\"http://outright.pagerduty.com/services/PGV50ZJ\"},\"assigned_to_user\":null,\"trigger_summary_data\":{\"subject\":\"DOWN alert: Thrift (secure.outright.com) is DOWN\"},\"trigger_details_html_url\":\"http://outright.pagerduty.com/incidents/PPACGEI/log_entries/PTYKKQ6\",\"last_status_change_on\":\"2012-11-22T05:15:52Z\",\"last_status_change_by\":{\"id\":\"REQUESTER_ID\",\"name\":\"Trae Robrock\",\"email\":\"trae@outright.com\",\"html_url\":\"http://outright.pagerduty.com/users/REQUESTER_ID\"},\"number_of_escalations\":1},{\"id\":\"P0M3DH0\",\"incident_number\":337,\"created_on\":\"2012-11-24T12:03:45Z\",\"status\":\"resolved\",\"html_url\":\"http://outright.pagerduty.com/incidents/P0M3DH0\",\"incident_key\":\"__TRIGGERED_VIA_EMAIL__\",\"service\":{\"id\":\"PGV50ZJ\",\"name\":\"Pingdom\",\"html_url\":\"http://outright.pagerduty.com/services/PGV50ZJ\"},\"assigned_to_user\":null,\"trigger_summary_data\":{\"subject\":\"DOWN alert: Thrift (secure.outright.com) is DOWN\"},\"trigger_details_html_url\":\"http://outright.pagerduty.com/incidents/P0M3DH0/log_entries/PIHR7C3\",\"last_status_change_on\":\"2012-11-24T12:25:04Z\",\"last_status_change_by\":{\"id\":\"P3859OT\",\"name\":\"Julio Santos\",\"email\":\"julio@outright.com\",\"html_url\":\"http://outright.pagerduty.com/users/P3859OT\"},\"number_of_escalations\":0}],\"limit\":100,\"offset\":0,\"total\":2}"
52
45
  http_version:
53
46
  recorded_at: Tue, 18 Dec 2012 18:33:32 GMT
54
- - request:
47
+ - request:
55
48
  method: get
56
49
  uri: https://outright.pagerduty.com/api/v1/services
57
- body:
58
- encoding: US-ASCII
59
- string: ''
60
- headers:
61
- Authorization:
50
+ body:
51
+ string: ""
52
+ headers:
53
+ Authorization:
62
54
  - Token token="API_KEY"
63
- response:
64
- status:
55
+ response:
56
+ status:
65
57
  code: 200
66
58
  message:
67
- headers:
68
- server:
59
+ headers:
60
+ server:
69
61
  - nginx/1.0.14
70
- date:
71
- - Tue, 18 Dec 2012 18:52:53 GMT
72
- content-type:
73
- - application/json; charset=utf-8
74
- transfer-encoding:
75
- - chunked
76
- connection:
62
+ connection:
77
63
  - keep-alive
78
- status:
79
- - 200 OK
80
- x-ua-compatible:
81
- - IE=Edge,chrome=1
82
- etag:
83
- - ! '"421a503a66656e436169a5013973b9a3"'
84
- cache-control:
64
+ cache-control:
85
65
  - must-revalidate, private, max-age=0
86
- set-cookie:
87
- - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTcxOTE3ODJlNjMxNTFhNGE0NzFhNTc1ZTE3NmY0ZDUzBjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--f193ea42280964d4723a59595f2860a269a862b9;
88
- path=/; HttpOnly, uid=CvgRmlDQu4XB3Si+TaevAg==; expires=Thu, 31-Dec-37 23:55:55
89
- GMT; domain=pagerduty.com; path=/
90
- x-request-id:
91
- - f132f07609f9f5870ea1fed3f1b73486
92
- x-runtime:
93
- - '0.282396'
94
- x-rack-cache:
66
+ x-ua-compatible:
67
+ - IE=Edge,chrome=1
68
+ x-rack-cache:
95
69
  - miss
96
- body:
97
- encoding: US-ASCII
98
- string: ! '{"services":[{"id":"POM55DP","name":"Pingdom Aggregation","service_url":"/services/POM55DP","service_key":"aggregation@outright.pagerduty.com","auto_resolve_timeout":14400,"acknowledgement_timeout":600,"created_at":"2012-12-01T13:59:54-08:00","status":"active","last_incident_timestamp":null,"email_incident_creation":"on_new_email_subject","incident_counts":{"triggered":0,"acknowledged":0,"resolved":0,"total":0},"email_filter_mode":"all-email","type":"pingdom"},{"id":"PW7E752","name":"Pingdom
99
- Application","service_url":"/services/PW7E752","service_key":"application@outright.pagerduty.com","auto_resolve_timeout":14400,"acknowledgement_timeout":600,"created_at":"2012-12-01T13:51:47-08:00","status":"active","last_incident_timestamp":null,"email_incident_creation":"on_new_email_subject","incident_counts":{"triggered":0,"acknowledged":0,"resolved":0,"total":0},"email_filter_mode":"all-email","type":"pingdom"}],"limit":25,"offset":0,"total":2}'
70
+ transfer-encoding:
71
+ - chunked
72
+ etag:
73
+ - "\"421a503a66656e436169a5013973b9a3\""
74
+ x-runtime:
75
+ - "0.282396"
76
+ content-type:
77
+ - application/json; charset=utf-8
78
+ x-request-id:
79
+ - f132f07609f9f5870ea1fed3f1b73486
80
+ status:
81
+ - 200 OK
82
+ set-cookie:
83
+ - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTcxOTE3ODJlNjMxNTFhNGE0NzFhNTc1ZTE3NmY0ZDUzBjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--f193ea42280964d4723a59595f2860a269a862b9; path=/; HttpOnly, uid=CvgRmlDQu4XB3Si+TaevAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
84
+ date:
85
+ - Tue, 18 Dec 2012 18:52:53 GMT
86
+ body:
87
+ string: "{\"services\":[{\"id\":\"POM55DP\",\"name\":\"Pingdom Aggregation\",\"service_url\":\"/services/POM55DP\",\"service_key\":\"aggregation@outright.pagerduty.com\",\"auto_resolve_timeout\":14400,\"acknowledgement_timeout\":600,\"created_at\":\"2012-12-01T13:59:54-08:00\",\"status\":\"active\",\"last_incident_timestamp\":null,\"email_incident_creation\":\"on_new_email_subject\",\"incident_counts\":{\"triggered\":0,\"acknowledged\":0,\"resolved\":0,\"total\":0},\"email_filter_mode\":\"all-email\",\"type\":\"pingdom\"},{\"id\":\"PW7E752\",\"name\":\"Pingdom Application\",\"service_url\":\"/services/PW7E752\",\"service_key\":\"application@outright.pagerduty.com\",\"auto_resolve_timeout\":14400,\"acknowledgement_timeout\":600,\"created_at\":\"2012-12-01T13:51:47-08:00\",\"status\":\"active\",\"last_incident_timestamp\":null,\"email_incident_creation\":\"on_new_email_subject\",\"incident_counts\":{\"triggered\":0,\"acknowledged\":0,\"resolved\":0,\"total\":0},\"email_filter_mode\":\"all-email\",\"type\":\"pingdom\"}],\"limit\":25,\"offset\":0,\"total\":2}"
100
88
  http_version:
101
89
  recorded_at: Tue, 18 Dec 2012 18:52:53 GMT
102
- - request:
90
+ - request:
103
91
  method: get
104
92
  uri: https://outright.pagerduty.com/api/v1/maintenance_windows
105
- body:
106
- encoding: US-ASCII
107
- string: ''
108
- headers:
109
- Authorization:
93
+ body:
94
+ string: ""
95
+ headers:
96
+ Authorization:
110
97
  - Token token="API_KEY"
111
- response:
112
- status:
98
+ response:
99
+ status:
113
100
  code: 200
114
101
  message:
115
- headers:
116
- server:
102
+ headers:
103
+ server:
117
104
  - nginx/1.0.14
118
- date:
119
- - Tue, 18 Dec 2012 21:20:46 GMT
120
- content-type:
121
- - application/json; charset=utf-8
122
- transfer-encoding:
123
- - chunked
124
- connection:
105
+ connection:
125
106
  - keep-alive
126
- status:
127
- - 200 OK
128
- x-ua-compatible:
129
- - IE=Edge,chrome=1
130
- etag:
131
- - ! '"6919d6c47a3676a76a87c183ec2b1c12"'
132
- cache-control:
107
+ cache-control:
133
108
  - must-revalidate, private, max-age=0
134
- set-cookie:
135
- - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTQzODI0NTc4YTBmMTkwZDEwYWYwMmYyYjM5MDg0MDZkBjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--3b0365f664301282b5ab3f149e5b8d4cdec50483;
136
- path=/; HttpOnly, uid=CvQdAlDQ3i5M5GH+U/MuAg==; expires=Thu, 31-Dec-37 23:55:55
137
- GMT; domain=pagerduty.com; path=/
138
- x-request-id:
139
- - 700c013cfae5ea7e9b3e2a8bf09dcdce
140
- x-runtime:
141
- - '0.061321'
142
- x-rack-cache:
109
+ x-ua-compatible:
110
+ - IE=Edge,chrome=1
111
+ x-rack-cache:
143
112
  - miss
144
- body:
145
- encoding: US-ASCII
146
- string: ! '{"maintenance_windows":[],"counts":{"ongoing":0,"future":0,"past":0,"all":0},"limit":25,"offset":0,"total":0}'
113
+ transfer-encoding:
114
+ - chunked
115
+ etag:
116
+ - "\"6919d6c47a3676a76a87c183ec2b1c12\""
117
+ x-runtime:
118
+ - "0.061321"
119
+ content-type:
120
+ - application/json; charset=utf-8
121
+ x-request-id:
122
+ - 700c013cfae5ea7e9b3e2a8bf09dcdce
123
+ status:
124
+ - 200 OK
125
+ set-cookie:
126
+ - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTQzODI0NTc4YTBmMTkwZDEwYWYwMmYyYjM5MDg0MDZkBjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--3b0365f664301282b5ab3f149e5b8d4cdec50483; path=/; HttpOnly, uid=CvQdAlDQ3i5M5GH+U/MuAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
127
+ date:
128
+ - Tue, 18 Dec 2012 21:20:46 GMT
129
+ body:
130
+ string: "{\"maintenance_windows\":[],\"counts\":{\"ongoing\":0,\"future\":0,\"past\":0,\"all\":0},\"limit\":25,\"offset\":0,\"total\":0}"
147
131
  http_version:
148
132
  recorded_at: Tue, 18 Dec 2012 21:20:46 GMT
149
- - request:
133
+ - request:
150
134
  method: get
151
135
  uri: https://outright.pagerduty.com/api/v1/maintenance_windows?type=future
152
- body:
153
- encoding: US-ASCII
154
- string: ''
155
- headers:
156
- Authorization:
136
+ body:
137
+ string: ""
138
+ headers:
139
+ Authorization:
157
140
  - Token token="API_KEY"
158
- response:
159
- status:
141
+ response:
142
+ status:
160
143
  code: 200
161
144
  message:
162
- headers:
163
- server:
145
+ headers:
146
+ server:
164
147
  - nginx/1.0.14
165
- date:
166
- - Tue, 18 Dec 2012 22:13:46 GMT
167
- content-type:
168
- - application/json; charset=utf-8
169
- transfer-encoding:
170
- - chunked
171
- connection:
148
+ connection:
172
149
  - keep-alive
173
- status:
174
- - 200 OK
175
- x-ua-compatible:
176
- - IE=Edge,chrome=1
177
- etag:
178
- - ! '"16d4bc0e609530a306c4638faa3cea1b"'
179
- cache-control:
150
+ cache-control:
180
151
  - must-revalidate, private, max-age=0
181
- set-cookie:
182
- - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWRmYjJmMmEzN2M5ZjVjMmMyMWY1NjgxYWI0MWEwMmE3BjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--0e97d08829ed876ff7ed576ddaf1c06978474294;
183
- path=/; HttpOnly, uid=CvgRmlDQ6prBtCi9WXnOAg==; expires=Thu, 31-Dec-37 23:55:55
184
- GMT; domain=pagerduty.com; path=/
185
- x-request-id:
186
- - 08f9e553ed4685a415f337163dc2668c
187
- x-runtime:
188
- - '0.121836'
189
- x-rack-cache:
152
+ x-ua-compatible:
153
+ - IE=Edge,chrome=1
154
+ x-rack-cache:
190
155
  - miss
191
- body:
192
- encoding: US-ASCII
193
- string: ! '{"maintenance_windows":[{"id":"PW4ICCT","sequence_number":1,"start_time":"2012-12-18T16:00:00-08:00","end_time":"2012-12-18T17:00:00-08:00","description":"testing","created_by":{"id":"REQUESTER_ID","name":"Bob
194
- Smith","email":"bob@example.com","time_zone":"Pacific Time (US & Canada)","color":"green","role":"admin","avatar_url":"https://secure.gravatar.com/avatar/71c3bbda60a46a241bf9a2d68e41cbec.png?d=mm&r=PG","user_url":"/users/REQUESTER_ID","invitation_sent":false,"marketing_opt_out":false},"services":[{"id":"PZ9VM86","name":"Application","service_url":"/services/PZ9VM86","service_key":"application@outright.pagerduty.com","auto_resolve_timeout":14400,"acknowledgement_timeout":600,"created_at":"2012-03-07T15:44:09-08:00","status":"active","last_incident_timestamp":"2012-12-17T09:11:11-08:00","email_incident_creation":"on_new_email_subject","incident_counts":{"triggered":0,"acknowledged":0,"resolved":166,"total":166},"email_filter_mode":"all-email","type":"generic_email"}]}],"counts":{"ongoing":0,"future":1,"past":0,"all":1},"limit":25,"offset":0,"total":1}'
156
+ transfer-encoding:
157
+ - chunked
158
+ etag:
159
+ - "\"16d4bc0e609530a306c4638faa3cea1b\""
160
+ x-runtime:
161
+ - "0.121836"
162
+ content-type:
163
+ - application/json; charset=utf-8
164
+ x-request-id:
165
+ - 08f9e553ed4685a415f337163dc2668c
166
+ status:
167
+ - 200 OK
168
+ set-cookie:
169
+ - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWRmYjJmMmEzN2M5ZjVjMmMyMWY1NjgxYWI0MWEwMmE3BjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--0e97d08829ed876ff7ed576ddaf1c06978474294; path=/; HttpOnly, uid=CvgRmlDQ6prBtCi9WXnOAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
170
+ date:
171
+ - Tue, 18 Dec 2012 22:13:46 GMT
172
+ body:
173
+ string: "{\"maintenance_windows\":[{\"id\":\"PW4ICCT\",\"sequence_number\":1,\"start_time\":\"2012-12-18T16:00:00-08:00\",\"end_time\":\"2012-12-18T17:00:00-08:00\",\"description\":\"testing\",\"created_by\":{\"id\":\"REQUESTER_ID\",\"name\":\"Bob Smith\",\"email\":\"bob@example.com\",\"time_zone\":\"Pacific Time (US & Canada)\",\"color\":\"green\",\"role\":\"admin\",\"avatar_url\":\"https://secure.gravatar.com/avatar/71c3bbda60a46a241bf9a2d68e41cbec.png?d=mm&r=PG\",\"user_url\":\"/users/REQUESTER_ID\",\"invitation_sent\":false,\"marketing_opt_out\":false},\"services\":[{\"id\":\"PZ9VM86\",\"name\":\"Application\",\"service_url\":\"/services/PZ9VM86\",\"service_key\":\"application@outright.pagerduty.com\",\"auto_resolve_timeout\":14400,\"acknowledgement_timeout\":600,\"created_at\":\"2012-03-07T15:44:09-08:00\",\"status\":\"active\",\"last_incident_timestamp\":\"2012-12-17T09:11:11-08:00\",\"email_incident_creation\":\"on_new_email_subject\",\"incident_counts\":{\"triggered\":0,\"acknowledged\":0,\"resolved\":166,\"total\":166},\"email_filter_mode\":\"all-email\",\"type\":\"generic_email\"}]}],\"counts\":{\"ongoing\":0,\"future\":1,\"past\":0,\"all\":1},\"limit\":25,\"offset\":0,\"total\":1}"
195
174
  http_version:
196
175
  recorded_at: Tue, 18 Dec 2012 22:13:46 GMT
197
- - request:
176
+ - request:
198
177
  method: post
199
178
  uri: https://outright.pagerduty.com/api/v1/maintenance_windows
200
- body:
201
- encoding: UTF-8
202
- string: ! '{"requester_id":"REQUESTER_ID","maintenance_window":{"start_time":"2012-12-18
203
- 15:53:54 -0800","end_time":"2012-12-18 16:53:54 -0800","service_ids":["POM55DP"]}}'
204
- headers:
205
- Authorization:
206
- - Token token="API_KEY"
207
- Content-Type:
179
+ body:
180
+ string: "{\"requester_id\":\"REQUESTER_ID\",\"maintenance_window\":{\"start_time\":\"2012-12-18 15:53:54 -0800\",\"end_time\":\"2012-12-18 16:53:54 -0800\",\"service_ids\":[\"POM55DP\"]}}"
181
+ headers:
182
+ Content-Type:
208
183
  - application/json
209
- response:
210
- status:
184
+ Authorization:
185
+ - Token token="API_KEY"
186
+ response:
187
+ status:
211
188
  code: 201
212
189
  message:
213
- headers:
214
- server:
190
+ headers:
191
+ server:
215
192
  - nginx/1.0.14
216
- date:
217
- - Tue, 18 Dec 2012 23:53:55 GMT
218
- content-type:
219
- - application/json; charset=utf-8
220
- transfer-encoding:
221
- - chunked
222
- connection:
193
+ connection:
223
194
  - keep-alive
224
- status:
225
- - 201 Created
226
- x-ua-compatible:
227
- - IE=Edge,chrome=1
228
- etag:
229
- - ! '"85f0ed1364f971210f88f800c05731b5"'
230
- cache-control:
195
+ cache-control:
231
196
  - max-age=0, private, must-revalidate
232
- set-cookie:
233
- - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTgwNGMxMzA5YTg5NzRhZTFlMTNjY2ViMzQ4YmFkZDhjBjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--bfb27f246317ea47199d087d8cd2d7435fb3a2e6;
234
- path=/; HttpOnly, uid=CvgRmlDRAhPBtCi9Wd+bAg==; expires=Thu, 31-Dec-37 23:55:55
235
- GMT; domain=pagerduty.com; path=/
236
- x-request-id:
237
- - a05701e5a910ce5848a5b45a9b5943eb
238
- x-runtime:
239
- - '0.204289'
240
- x-rack-cache:
197
+ x-ua-compatible:
198
+ - IE=Edge,chrome=1
199
+ x-rack-cache:
241
200
  - invalidate, pass
242
- body:
243
- encoding: US-ASCII
244
- string: ! '{"maintenance_window":{"id":"PO7EV8B","sequence_number":2,"start_time":"2012-12-18T15:53:55-08:00","end_time":"2012-12-18T16:53:54-08:00","description":null,"created_by":{"id":"REQUESTER_ID","name":"Bob
245
- Smith","email":"bob@example.com","time_zone":"Pacific Time (US & Canada)","color":"green","role":"admin","avatar_url":"https://secure.gravatar.com/avatar/71c3bbda60a46a241bf9a2d68e41cbec.png?d=mm&r=PG","user_url":"/users/REQUESTER_ID","invitation_sent":false,"marketing_opt_out":false},"services":[{"id":"POM55DP","name":"Application",
246
- "service_url":"/services/POM55DP","service_key":"application@outright.pagerduty.com","auto_resolve_timeout":14400,"acknowledgement_timeout":600,"created_at":"2012-12-01T13:59:54-08:00","status":"maintenance","last_incident_timestamp":null,"email_incident_creation":"on_new_email_subject","incident_counts":{"triggered":0,"acknowledged":0,"resolved":0,"total":0},"email_filter_mode":"all-email","type":"pingdom"}]}}'
201
+ transfer-encoding:
202
+ - chunked
203
+ etag:
204
+ - "\"85f0ed1364f971210f88f800c05731b5\""
205
+ x-runtime:
206
+ - "0.204289"
207
+ content-type:
208
+ - application/json; charset=utf-8
209
+ x-request-id:
210
+ - a05701e5a910ce5848a5b45a9b5943eb
211
+ status:
212
+ - 201 Created
213
+ set-cookie:
214
+ - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTgwNGMxMzA5YTg5NzRhZTFlMTNjY2ViMzQ4YmFkZDhjBjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--bfb27f246317ea47199d087d8cd2d7435fb3a2e6; path=/; HttpOnly, uid=CvgRmlDRAhPBtCi9Wd+bAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
215
+ date:
216
+ - Tue, 18 Dec 2012 23:53:55 GMT
217
+ body:
218
+ string: "{\"maintenance_window\":{\"id\":\"PO7EV8B\",\"sequence_number\":2,\"start_time\":\"2012-12-18T15:53:55-08:00\",\"end_time\":\"2012-12-18T16:53:54-08:00\",\"description\":null,\"created_by\":{\"id\":\"REQUESTER_ID\",\"name\":\"Bob Smith\",\"email\":\"bob@example.com\",\"time_zone\":\"Pacific Time (US & Canada)\",\"color\":\"green\",\"role\":\"admin\",\"avatar_url\":\"https://secure.gravatar.com/avatar/71c3bbda60a46a241bf9a2d68e41cbec.png?d=mm&r=PG\",\"user_url\":\"/users/REQUESTER_ID\",\"invitation_sent\":false,\"marketing_opt_out\":false},\"services\":[{\"id\":\"POM55DP\",\"name\":\"Application\", \"service_url\":\"/services/POM55DP\",\"service_key\":\"application@outright.pagerduty.com\",\"auto_resolve_timeout\":14400,\"acknowledgement_timeout\":600,\"created_at\":\"2012-12-01T13:59:54-08:00\",\"status\":\"maintenance\",\"last_incident_timestamp\":null,\"email_incident_creation\":\"on_new_email_subject\",\"incident_counts\":{\"triggered\":0,\"acknowledged\":0,\"resolved\":0,\"total\":0},\"email_filter_mode\":\"all-email\",\"type\":\"pingdom\"}]}}"
247
219
  http_version:
248
220
  recorded_at: Tue, 18 Dec 2012 23:53:55 GMT
249
- - request:
221
+ - request:
250
222
  method: delete
251
223
  uri: https://outright.pagerduty.com/api/v1/maintenance_windows/PO7EV8B
252
- body:
253
- encoding: US-ASCII
254
- string: ''
255
- headers:
256
- Authorization:
224
+ body:
225
+ string: ""
226
+ headers:
227
+ Authorization:
257
228
  - Token token="API_KEY"
258
- response:
259
- status:
229
+ response:
230
+ status:
260
231
  code: 204
261
232
  message:
262
- headers:
263
- server:
233
+ headers:
234
+ server:
264
235
  - nginx/1.0.14
265
- date:
266
- - Tue, 18 Dec 2012 23:53:55 GMT
267
- connection:
236
+ connection:
268
237
  - keep-alive
269
- status:
238
+ cache-control:
239
+ - no-cache
240
+ x-ua-compatible:
241
+ - IE=Edge,chrome=1
242
+ x-rack-cache:
243
+ - invalidate, pass
244
+ x-runtime:
245
+ - "0.140999"
246
+ x-request-id:
247
+ - dd3377e85640482f418d70dca8b3aed4
248
+ status:
270
249
  - 204 No Content
271
- x-ua-compatible:
250
+ set-cookie:
251
+ - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTdhYjU0ZjAxODlhOWQ1NmU0NDQ3MGMwMzJlNDc5YWU5BjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--8a7a1fbad07f05003f61ec0a930004dbedda4203; path=/; HttpOnly, uid=CvgRmlDRAhPBtCi9Wd+iAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
252
+ date:
253
+ - Tue, 18 Dec 2012 23:53:55 GMT
254
+ body:
255
+ string: ""
256
+ http_version:
257
+ recorded_at: Tue, 18 Dec 2012 23:53:55 GMT
258
+ - request:
259
+ method: get
260
+ uri: http://outright.pagerduty.com/api/v1/incidents
261
+ body:
262
+ string: ""
263
+ headers:
264
+ Authorization:
265
+ - Token token="API_KEY"
266
+ User-Agent:
267
+ - Faraday v0.8.6
268
+ response:
269
+ status:
270
+ code: 401
271
+ message:
272
+ headers:
273
+ connection:
274
+ - keep-alive
275
+ server:
276
+ - nginx/1.0.14
277
+ cache-control:
278
+ - no-cache, private
279
+ x-ua-compatible:
280
+ - IE=Edge,chrome=1
281
+ x-rack-cache:
282
+ - miss
283
+ transfer-encoding:
284
+ - chunked
285
+ x-runtime:
286
+ - "0.039754"
287
+ content-type:
288
+ - text/html; charset=utf-8
289
+ www-authenticate:
290
+ - Basic realm="Web Password"
291
+ x-request-id:
292
+ - 0af69ca051a2fd91becad43534a5c788
293
+ set-cookie:
294
+ - uid=CvgRmlEue4N2sErwLBEKAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
295
+ status:
296
+ - 401 Unauthorized
297
+ date:
298
+ - Wed, 27 Feb 2013 21:32:51 GMT
299
+ body:
300
+ string: |
301
+ HTTP Basic: Access denied.
302
+
303
+ http_version:
304
+ recorded_at: Wed, 27 Feb 2013 21:32:54 GMT
305
+ - request:
306
+ method: get
307
+ uri: http://outright.pagerduty.com/api/v1/services
308
+ body:
309
+ string: ""
310
+ headers:
311
+ Authorization:
312
+ - Token token="API_KEY"
313
+ User-Agent:
314
+ - Faraday v0.8.6
315
+ response:
316
+ status:
317
+ code: 401
318
+ message:
319
+ headers:
320
+ connection:
321
+ - keep-alive
322
+ server:
323
+ - nginx/1.0.14
324
+ cache-control:
325
+ - no-cache, private
326
+ x-ua-compatible:
327
+ - IE=Edge,chrome=1
328
+ x-rack-cache:
329
+ - miss
330
+ transfer-encoding:
331
+ - chunked
332
+ x-runtime:
333
+ - "0.031188"
334
+ content-type:
335
+ - text/html; charset=utf-8
336
+ www-authenticate:
337
+ - Basic realm="Web Password"
338
+ x-request-id:
339
+ - 85ec51e213eef8a44a730bbbae3d4339
340
+ set-cookie:
341
+ - uid=CvgRmlEue4N2sErwLBENAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
342
+ status:
343
+ - 401 Unauthorized
344
+ date:
345
+ - Wed, 27 Feb 2013 21:32:51 GMT
346
+ body:
347
+ string: |
348
+ HTTP Basic: Access denied.
349
+
350
+ http_version:
351
+ recorded_at: Wed, 27 Feb 2013 21:32:54 GMT
352
+ - request:
353
+ method: get
354
+ uri: http://outright.pagerduty.com/api/v1/maintenance_windows
355
+ body:
356
+ string: ""
357
+ headers:
358
+ Authorization:
359
+ - Token token="API_KEY"
360
+ User-Agent:
361
+ - Faraday v0.8.6
362
+ response:
363
+ status:
364
+ code: 401
365
+ message:
366
+ headers:
367
+ connection:
368
+ - keep-alive
369
+ server:
370
+ - nginx/1.0.14
371
+ cache-control:
372
+ - no-cache, private
373
+ x-ua-compatible:
374
+ - IE=Edge,chrome=1
375
+ x-rack-cache:
376
+ - miss
377
+ transfer-encoding:
378
+ - chunked
379
+ x-runtime:
380
+ - "0.022043"
381
+ content-type:
382
+ - text/html; charset=utf-8
383
+ www-authenticate:
384
+ - Basic realm="Web Password"
385
+ x-request-id:
386
+ - d3926a08f0af71a151e18a6a70df1717
387
+ set-cookie:
388
+ - uid=CvgRmlEue4N2sErwLBEOAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
389
+ status:
390
+ - 401 Unauthorized
391
+ date:
392
+ - Wed, 27 Feb 2013 21:32:51 GMT
393
+ body:
394
+ string: |
395
+ HTTP Basic: Access denied.
396
+
397
+ http_version:
398
+ recorded_at: Wed, 27 Feb 2013 21:32:55 GMT
399
+ - request:
400
+ method: get
401
+ uri: http://outright.pagerduty.com/api/v1/maintenance_windows?type=future
402
+ body:
403
+ string: ""
404
+ headers:
405
+ Authorization:
406
+ - Token token="API_KEY"
407
+ User-Agent:
408
+ - Faraday v0.8.6
409
+ response:
410
+ status:
411
+ code: 401
412
+ message:
413
+ headers:
414
+ connection:
415
+ - keep-alive
416
+ server:
417
+ - nginx/1.0.14
418
+ cache-control:
419
+ - no-cache, private
420
+ x-ua-compatible:
272
421
  - IE=Edge,chrome=1
273
- cache-control:
422
+ x-rack-cache:
423
+ - miss
424
+ transfer-encoding:
425
+ - chunked
426
+ x-runtime:
427
+ - "0.025184"
428
+ content-type:
429
+ - text/html; charset=utf-8
430
+ www-authenticate:
431
+ - Basic realm="Web Password"
432
+ x-request-id:
433
+ - 1d4a95ab3320bd8809eb4667f12f824a
434
+ set-cookie:
435
+ - uid=CvgRmlEue4R2sErwLBERAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
436
+ status:
437
+ - 401 Unauthorized
438
+ date:
439
+ - Wed, 27 Feb 2013 21:32:52 GMT
440
+ body:
441
+ string: |
442
+ HTTP Basic: Access denied.
443
+
444
+ http_version:
445
+ recorded_at: Wed, 27 Feb 2013 21:32:55 GMT
446
+ - request:
447
+ method: post
448
+ uri: http://outright.pagerduty.com/api/v1/maintenance_windows
449
+ body:
450
+ string: "{\"requester_id\":\"REQUESTER_ID\",\"maintenance_window\":{\"end_time\":\"Wed Feb 27 14:32:55 -0800 2013\",\"service_ids\":[\"POM55DP\"],\"start_time\":\"Wed Feb 27 13:32:55 -0800 2013\"}}"
451
+ headers:
452
+ Content-Type:
453
+ - application/json
454
+ Authorization:
455
+ - Token token="API_KEY"
456
+ User-Agent:
457
+ - Faraday v0.8.6
458
+ response:
459
+ status:
460
+ code: 401
461
+ message:
462
+ headers:
463
+ connection:
464
+ - keep-alive
465
+ server:
466
+ - nginx/1.0.14
467
+ cache-control:
274
468
  - no-cache
275
- set-cookie:
276
- - _pagerduty_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTdhYjU0ZjAxODlhOWQ1NmU0NDQ3MGMwMzJlNDc5YWU5BjsAVEkiHHdhcmRlbi51c2VyLmFwaV9rZXkua2V5BjsAVFsISSILQXBpS2V5BjsARlsGaQKUATA%3D--8a7a1fbad07f05003f61ec0a930004dbedda4203;
277
- path=/; HttpOnly, uid=CvgRmlDRAhPBtCi9Wd+iAg==; expires=Thu, 31-Dec-37 23:55:55
278
- GMT; domain=pagerduty.com; path=/
279
- x-request-id:
280
- - dd3377e85640482f418d70dca8b3aed4
281
- x-runtime:
282
- - '0.140999'
283
- x-rack-cache:
469
+ x-ua-compatible:
470
+ - IE=Edge,chrome=1
471
+ x-rack-cache:
284
472
  - invalidate, pass
285
- body:
286
- encoding: US-ASCII
287
- string: ''
473
+ transfer-encoding:
474
+ - chunked
475
+ x-runtime:
476
+ - "0.043793"
477
+ content-type:
478
+ - text/html; charset=utf-8
479
+ www-authenticate:
480
+ - Basic realm="Web Password"
481
+ x-request-id:
482
+ - 7cde0c813cd52ad43dbeab2f1f9e1279
483
+ set-cookie:
484
+ - uid=CvQdAlEue4RpBWSRLVcTAg==; expires=Thu, 31-Dec-37 23:55:55 GMT; domain=pagerduty.com; path=/
485
+ status:
486
+ - 401 Unauthorized
487
+ date:
488
+ - Wed, 27 Feb 2013 21:32:52 GMT
489
+ body:
490
+ string: |
491
+ HTTP Basic: Access denied.
492
+
288
493
  http_version:
289
- recorded_at: Tue, 18 Dec 2012 23:53:55 GMT
290
- recorded_with: VCR 2.3.0
494
+ recorded_at: Wed, 27 Feb 2013 21:32:55 GMT
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-19 00:00:00.000000000 Z
12
+ date: 2013-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -191,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  segments:
193
193
  - 0
194
- hash: -2152703981749921555
194
+ hash: -2495651337878828569
195
195
  required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  none: false
197
197
  requirements:
@@ -200,10 +200,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  version: '0'
201
201
  segments:
202
202
  - 0
203
- hash: -2152703981749921555
203
+ hash: -2495651337878828569
204
204
  requirements: []
205
205
  rubyforge_project:
206
- rubygems_version: 1.8.24
206
+ rubygems_version: 1.8.23
207
207
  signing_key:
208
208
  specification_version: 3
209
209
  summary: Simple api wrapper for PagerDuty