statusio 0.2.5 → 0.3.0

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
- SHA1:
3
- metadata.gz: 20f98eab4d744044c7cd98bf147b18200815e798
4
- data.tar.gz: db1d27c8b34afbd260321557748f87cba6f2c25f
2
+ SHA256:
3
+ metadata.gz: c0d2d7fc197b696855cc36d6aeab847f3b9166b4f4bb22c403d8782880748e0d
4
+ data.tar.gz: cd6bdee45fa6289f06c2035c2508bc26bb6d00019829ded80f3c7c61145d72d8
5
5
  SHA512:
6
- metadata.gz: 765e9b5707282ed3b1e475d43f9cb0d09a8d4b7cf2acccddcd8e7444bf7717927d5577f6769e217a4bf5ec1a87bc5d79086257712579d87226a7fa141570666e
7
- data.tar.gz: 6663584894fa49ac6be57983c548883802cb2ae69fc127c138d1f39ebbdafd34f0657cc589f90d791dc3ef56bc052361d49cb8a2f0b38b7bead86b701d0c446c
6
+ metadata.gz: f5e598031a868cd774b1cb69b50b16780fc6a533d8bcdfe4ea6ebdf2689bfcc95f84615544a1bb9470e9b72c2e7b56e7034dd711fb23cee5d2c0834b86a53afa
7
+ data.tar.gz: 2c7e0a2ae553f90841b51d4f96ba1ca47ff1c3bddd661b0ec029ed516607115db769fc9edd50cf52fef629b1f69854af8a9cc6e2cf6ed0605613204656b8d18c
data/CHANGELOG.md ADDED
@@ -0,0 +1,36 @@
1
+ ## Change Log
2
+
3
+ ### v0.3.0 (2021/5/17)
4
+ - Added Microsoft Teams
5
+
6
+ ### v0.2.9 (2020/2/17)
7
+ - Fixed the ordering of the message_subject argument for the incident/maintenance methods which was breaking backwards compatibility
8
+
9
+ ### v0.2.8 (2020/2/14)
10
+ - Fix silent parameter type
11
+
12
+ ### v0.2.7 (2020/2/10)
13
+ - Adding message_subject to all incident and maintenance methods
14
+
15
+ ### v0.2.6 (2019/3/26)
16
+ - Force rest-client gem to be version 1.8.0
17
+
18
+ ### v0.2.5 (2018/11/28)
19
+ - Changed variables to proper type (int->str)
20
+
21
+ ### v0.2.4 (2018/2/9)
22
+ - Support retrieving single incident/maintenance events. New incident/maintenance methods to fetch list of IDs
23
+ - Change /component/status/update to use a single component
24
+
25
+ ### v0.2.3 (2017/12/20)
26
+ - Updated incident/create to handle infrastructure_affected combo
27
+
28
+ ### v0.2.2 (2017/12/14)
29
+ - Updated maintenance/schedule to handle infrastructure_affected combos
30
+
31
+ ### v0.2.1 (2016/2/11)
32
+ - Refactor API calls into a #request method (@seanhandley)
33
+ - Depend on rest-client gem in runtime (@Nowaker)
34
+
35
+ ### v0.1.0 (2016/1/19)
36
+ - Initial release
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ require 'rbconfig'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
- gem 'rest-client'
5
+ gem 'rest-client', '=1.8.0'
6
6
 
7
7
  group :test do
8
8
  gem 'rspec'
data/lib/statusio.rb CHANGED
@@ -25,6 +25,7 @@ class StatusioClient
25
25
  NOTIFY_IRC = 16
26
26
  NOTIFY_HIPCHAT = 32
27
27
  NOTIFY_SLACK = 64
28
+ NOTIFY_MSTEAMS = 128
28
29
 
29
30
  def initialize(api_key, api_id)
30
31
  @api_key = api_key
@@ -50,7 +51,8 @@ class StatusioClient
50
51
  'social' => '0',
51
52
  'irc' => '0',
52
53
  'hipchat' => '0',
53
- 'slack' => '0'
54
+ 'slack' => '0',
55
+ 'msteams' => '0'
54
56
  }
55
57
 
56
58
  if notifications & NOTIFY_EMAIL == NOTIFY_EMAIL
@@ -81,6 +83,10 @@ class StatusioClient
81
83
  notify['slack'] = '1'
82
84
  end
83
85
 
86
+ if notifications & NOTIFY_MSTEAMS == NOTIFY_MSTEAMS
87
+ notify['msteams'] = '1'
88
+ end
89
+
84
90
  return notify
85
91
  end
86
92
 
@@ -191,9 +197,10 @@ class StatusioClient
191
197
  # @param current_state(int) The state of this incident (StatusioClient::STATE_#).
192
198
  # @param notifications(int) Bitmasked notifications (StatusioClient::NOTIFY_#). To use multiple just add them up (ie StatusioClient::NOTIFY_SMS + StatusioClient::NOTIFY_SLACK).
193
199
  # @param all_infrastructure_affected(string) Affect all components and containers (default = 0)
200
+ # @param message_subject(string) Message subject for email notifications (default = Status Notification)
194
201
  # @return object
195
202
 
196
- def incident_create(statuspage_id, incident_name, incident_details, infrastructure_affected, current_status, current_state, notifications = 0, all_infrastructure_affected = "0")
203
+ def incident_create(statuspage_id, incident_name, incident_details, infrastructure_affected, current_status, current_state, notifications = 0, all_infrastructure_affected = "0", message_subject = "Status Notification")
197
204
  data = get_notify(notifications)
198
205
  data['statuspage_id'] = statuspage_id
199
206
  data['incident_name'] = incident_name
@@ -202,6 +209,7 @@ class StatusioClient
202
209
  data['current_status'] = current_status
203
210
  data['current_state'] = current_state
204
211
  data['all_infrastructure_affected'] = all_infrastructure_affected
212
+ data['message_subject'] = message_subject
205
213
 
206
214
  request :method => :post,
207
215
  :url => @url + 'incident/create',
@@ -217,15 +225,17 @@ class StatusioClient
217
225
  # @param current_status(int) The status of the components and containers affected by this incident (StatusioClient::STATUS_#).
218
226
  # @param current_state(int) The state of this incident (StatusioClient::STATE_#).
219
227
  # @param notifications(int) Bitmasked notifications (StatusioClient::NOTIFY_#). To use multiple just add them up (ie StatusioClient::NOTIFY_SMS + StatusioClient::NOTIFY_SLACK).
228
+ # @param message_subject(string) Message subject for email notifications (default = Status Notification)
220
229
  # @return object
221
230
 
222
- def incident_update(statuspage_id, incident_id, incident_details, current_status, current_state, notifications = 0)
231
+ def incident_update(statuspage_id, incident_id, incident_details, current_status, current_state, notifications = 0, message_subject = "Status Notification")
223
232
  data = get_notify(notifications)
224
233
  data['statuspage_id'] = statuspage_id
225
234
  data['incident_id'] = incident_id
226
235
  data['incident_details'] = incident_details
227
236
  data['current_status'] = current_status
228
237
  data['current_state'] = current_state
238
+ data['message_subject'] = message_subject
229
239
 
230
240
  request :method => :post,
231
241
  :url => @url + 'incident/update',
@@ -241,15 +251,17 @@ class StatusioClient
241
251
  # @param current_status(int) The status of the components and containers affected by this incident (StatusioClient::STATUS_#).
242
252
  # @param current_state(int) The state of this incident (StatusioClient::STATE_#).
243
253
  # @param notifications(int) Bitmasked notifications (StatusioClient::NOTIFY_#). To use multiple just add them up (ie StatusioClient::NOTIFY_SMS + StatusioClient::NOTIFY_SLACK).
254
+ # @param message_subject(string) Message subject for email notifications (default = Status Notification)
244
255
  # @return object
245
256
 
246
- def incident_resolve(statuspage_id, incident_id, incident_details, current_status, current_state, notifications = 0)
257
+ def incident_resolve(statuspage_id, incident_id, incident_details, current_status, current_state, notifications = 0, message_subject = "Status Notification")
247
258
  data = get_notify(notifications)
248
259
  data['statuspage_id'] = statuspage_id
249
260
  data['incident_id'] = incident_id
250
261
  data['incident_details'] = incident_details
251
262
  data['current_status'] = current_status
252
263
  data['current_state'] =current_state
264
+ data['message_subject'] = message_subject
253
265
 
254
266
  request :method => :post,
255
267
  :url => @url + 'incident/resolve',
@@ -340,13 +352,14 @@ class StatusioClient
340
352
  # @param maintenance_notify_1_hr(string) Notify subscribers 1 hour before scheduled maintenance start time (1 = Send notification)
341
353
  # @param maintenance_notify_24_hr(string) Notify subscribers 24 hours before scheduled maintenance start time (1 = Send notification)
342
354
  # @param maintenance_notify_72_hr(string) Notify subscribers 72 hours before scheduled maintenance start time (1 = Send notification)
355
+ # @param message_subject(string) Message subject for email notifications (default = Maintenance Notification)
343
356
  # @return object
344
357
 
345
358
  def maintenance_schedule(statuspage_id, maintenance_name, maintenance_details, infrastructure_affected,
346
359
  date_planned_start, time_planned_start, date_planned_end, time_planned_end,
347
360
  automation = "0", all_infrastructure_affected = "0",
348
361
  maintenance_notify_now = "0", maintenance_notify_1_hr = "0",
349
- maintenance_notify_24_hr = "0", maintenance_notify_72_hr = "0")
362
+ maintenance_notify_24_hr = "0", maintenance_notify_72_hr = "0", message_subject = "Maintenance Notification")
350
363
  data = {}
351
364
  data['statuspage_id'] = statuspage_id
352
365
  data['maintenance_name'] = maintenance_name
@@ -362,6 +375,7 @@ class StatusioClient
362
375
  data['maintenance_notify_1_hr'] = maintenance_notify_1_hr
363
376
  data['maintenance_notify_24_hr'] = maintenance_notify_24_hr
364
377
  data['maintenance_notify_72_hr'] = maintenance_notify_72_hr
378
+ data['message_subject'] = message_subject
365
379
 
366
380
  request :method => :post,
367
381
  :url => @url + 'maintenance/schedule',
@@ -375,13 +389,15 @@ class StatusioClient
375
389
  # @param maintenance_id(string) Maintenance ID
376
390
  # @param maintenance_details(string) Message describing this maintenance update
377
391
  # @param notifications(int) Bitmasked notifications (StatusioClient::NOTIFY_#). To use multiple just add them up (ie StatusioClient::NOTIFY_SMS + StatusioClient::NOTIFY_SLACK).
392
+ # @param message_subject(string) Message subject for email notifications (default = Maintenance Notification)
378
393
  # @return object
379
394
 
380
- def maintenance_start(statuspage_id, maintenance_id, maintenance_details, notifications = 0)
395
+ def maintenance_start(statuspage_id, maintenance_id, maintenance_details, notifications = 0, message_subject = "Maintenance Notification")
381
396
  data = get_notify(notifications)
382
397
  data['statuspage_id'] = statuspage_id
383
398
  data['maintenance_id'] = maintenance_id
384
399
  data['maintenance_details'] = maintenance_details
400
+ data['message_subject'] = message_subject
385
401
 
386
402
  request :method => :post,
387
403
  :url => @url + 'maintenance/start',
@@ -395,13 +411,15 @@ class StatusioClient
395
411
  # @param maintenance_id(string) Maintenance ID
396
412
  # @param maintenance_details(string) Message describing this maintenance
397
413
  # @param notifications(int) Bitmasked notifications (StatusioClient::NOTIFY_#). To use multiple just add them up (ie StatusioClient::NOTIFY_SMS + StatusioClient::NOTIFY_SLACK).
414
+ # @param message_subject(string) Message subject for email notifications (default = Maintenance Notification)
398
415
  # @return object
399
416
 
400
- def maintenance_update(statuspage_id, maintenance_id, maintenance_details, notifications = 0)
417
+ def maintenance_update(statuspage_id, maintenance_id, maintenance_details, notifications = 0, message_subject = "Maintenance Notification")
401
418
  data = get_notify(notifications)
402
419
  data['statuspage_id'] = statuspage_id
403
420
  data['maintenance_id'] = maintenance_id
404
421
  data['maintenance_details'] = maintenance_details
422
+ data['message_subject'] = message_subject
405
423
 
406
424
  request :method => :post,
407
425
  :url => @url + 'maintenance/update',
@@ -415,13 +433,15 @@ class StatusioClient
415
433
  # @param maintenance_id(string) Maintenance ID
416
434
  # @param maintenance_details(string) Message describing this maintenance
417
435
  # @param notifications(int) Bitmasked notifications (StatusioClient::NOTIFY_#). To use multiple just add them up (ie StatusioClient::NOTIFY_SMS + StatusioClient::NOTIFY_SLACK).
436
+ # @param message_subject(string) Message subject for email notifications (default = Maintenance Notification)
418
437
  # @return object
419
438
 
420
- def maintenance_finish(statuspage_id, maintenance_id, maintenance_details, notifications = 0)
439
+ def maintenance_finish(statuspage_id, maintenance_id, maintenance_details, notifications = 0, message_subject = "Maintenance Notification")
421
440
  data = get_notify(notifications)
422
441
  data['statuspage_id'] = statuspage_id
423
442
  data['maintenance_id'] = maintenance_id
424
443
  data['maintenance_details'] = maintenance_details
444
+ data['message_subject'] = message_subject
425
445
 
426
446
  request :method => :post,
427
447
  :url => @url + 'maintenance/finish',
@@ -522,11 +542,11 @@ class StatusioClient
522
542
  # @param statuspage_id(string) Status page ID
523
543
  # @param method(string) Communication method of subscriber. Valid methods are `email`, `sms` or `webhook`
524
544
  # @param address(string) Subscriber address (SMS number must include country code ie. +1)
525
- # @param silent(int) Supress the welcome message (1 = Do not send notification)
545
+ # @param silent(string) Suppress the welcome message (1 = Do not send notification)
526
546
  # @param granular(string) List of component_container combos
527
547
  # @return object
528
548
 
529
- def subscriber_add(statuspage_id, method, address, silent = 1, granular = '')
549
+ def subscriber_add(statuspage_id, method, address, silent = '1', granular = '')
530
550
  data = {}
531
551
  data['statuspage_id'] = statuspage_id
532
552
  data['method'] = method
@@ -1,3 +1,3 @@
1
1
  class StatusioClient
2
- VERSION = '0.2.5'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statusio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Status.io
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-28 00:00:00.000000000 Z
11
+ date: 2021-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -35,6 +35,7 @@ files:
35
35
  - ".gitignore"
36
36
  - ".rspec"
37
37
  - ".travis.yml"
38
+ - CHANGELOG.md
38
39
  - Gemfile
39
40
  - README.md
40
41
  - Rakefile
@@ -62,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
63
  version: '0'
63
64
  requirements: []
64
65
  rubyforge_project:
65
- rubygems_version: 2.6.14
66
+ rubygems_version: 2.7.6
66
67
  signing_key:
67
68
  specification_version: 4
68
69
  summary: Ruby library wrapper for Status.io