watchfor 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f617a30b3f2891552e5aa9339787b8c90d3abd011a043b3e8fe881f2520773bb
4
- data.tar.gz: 4ced33369e896afc49839b2ceecabd3200773908e39d56e3a5478d5f6ac5d179
3
+ metadata.gz: 52bdfe4d4d6aa5580e89ea85b1966b865d33b3c945ed165b570f2284bc04b5f7
4
+ data.tar.gz: e6ca07b3a474a8601d85e652418c6c0d3dc06cf8439d91a1e326dae3525b0145
5
5
  SHA512:
6
- metadata.gz: 6d2ac815e653d49c5a64d8ffca42182943c3c57972e100be91e258707245a87201482f3cb85d35fffbb013a960ad5e7d969b4c44f21d9a3cf8d7fbc2a10a25d7
7
- data.tar.gz: ffce38e6606dfb939c3fe65388dff4871d40cebeb44564f526a65c98ffefb3c606f758c7cb0ca448ffe669f6ff23a4167ece608f8f87562e4ab18a0b19c80f34
6
+ metadata.gz: 0d68188b431c8e304b7a7b807207d37cb7f5e16e5b3f896ab330994d1bc1cdd200338745fc0ca1a8a0bcffd082ae6bb48da2d7d8e279cc1254829c6bfdc11b5d
7
+ data.tar.gz: 6bfd789a1c7933cb7bd856a3784d93fced814961df91102aac1bcfd4b48a39126102aa69eeba3f81753b2dd6828f3daec07c329d13435acb4fecfdef846dc17a
data/README.md CHANGED
@@ -76,7 +76,7 @@ and spend the same per-plan hourly allowance as the dashboard Toolbox.
76
76
  Details: <https://watchfor.io/docs/api/diagnostics>
77
77
 
78
78
  Namespaces: `wf.monitors`, `wf.alert_rules`, `wf.incidents`,
79
- `wf.hosts`, `wf.maintenance_windows`, `wf.contacts`, `wf.contact_groups`,
79
+ `wf.hosts`, `wf.status_pages`, `wf.on_call`, `wf.notification_channels`, `wf.maintenance_windows`, `wf.contacts`, `wf.contact_groups`,
80
80
  `wf.diagnostics`. Top-level:
81
81
  `wf.summary`, `wf.plan`, `wf.me`, `wf.locations`, `wf.monitor_types`,
82
82
  `wf.incident_stats(period)`, `wf.notifications`, `wf.activity`. Errors raise
@@ -25,7 +25,7 @@ module Watchfor
25
25
  # wf.summary
26
26
  # wf.monitors.list["data"].each { |m| puts "#{m['name']} #{m['status']}" }
27
27
  class Client
28
- attr_reader :monitors, :alert_rules, :incidents, :hosts,
28
+ attr_reader :monitors, :alert_rules, :incidents, :hosts, :status_pages, :on_call, :notification_channels,
29
29
  :maintenance_windows, :contacts, :contact_groups,
30
30
  :diagnostics
31
31
 
@@ -39,6 +39,9 @@ module Watchfor
39
39
  @alert_rules = AlertRules.new(self)
40
40
  @incidents = Incidents.new(self)
41
41
  @hosts = Hosts.new(self)
42
+ @status_pages = StatusPages.new(self)
43
+ @on_call = OnCall.new(self)
44
+ @notification_channels = NotificationChannels.new(self)
42
45
  @maintenance_windows = MaintenanceWindows.new(self)
43
46
  @contacts = Contacts.new(self)
44
47
  @contact_groups = ContactGroups.new(self)
@@ -133,6 +136,7 @@ module Watchfor
133
136
  # Recent probe results, newest first. Page with the response's next_cursor -> cursor:
134
137
  # (keep the same hours/success); "locations" is the per-location breakdown for the whole window.
135
138
  def checks(id, hours: nil, limit: nil, success: nil, cursor: nil, **query)
139
+ def check_detail(id, run_id) = @c.request("GET", "/monitors/#{id}/checks/#{run_id}")
136
140
  @c.request("GET", "/monitors/#{id}/checks",
137
141
  query: { hours: hours, limit: limit, success: success, cursor: cursor, **query })
138
142
  end
@@ -159,6 +163,21 @@ module Watchfor
159
163
  def include(id) = @c.request("POST", "/incidents/#{id}/include")
160
164
  end
161
165
 
166
+ class StatusPages < Namespace
167
+ def list(**query) = @c.request("GET", "/status-pages", query: query)
168
+ def get(id) = @c.request("GET", "/status-pages/#{id}")
169
+ def announcements(id, **query) = @c.request("GET", "/status-pages/#{id}/announcements", query: query)
170
+ end
171
+
172
+ class OnCall < Namespace
173
+ def get = @c.request("GET", "/on-call")
174
+ end
175
+
176
+ class NotificationChannels < Namespace
177
+ def list(**query) = @c.request("GET", "/notification-channels", query: query)
178
+ def get(id) = @c.request("GET", "/notification-channels/#{id}")
179
+ end
180
+
162
181
  class Hosts < Namespace
163
182
  def list(**query) = @c.request("GET", "/hosts", query: query)
164
183
  def get(id) = @c.request("GET", "/hosts/#{id}")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Watchfor
4
- VERSION = "0.8.0"
4
+ VERSION = "0.9.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchfor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WatchFor