watchfor 0.7.2 → 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 +4 -4
- data/README.md +2 -2
- data/lib/watchfor/client.rb +27 -1
- data/lib/watchfor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52bdfe4d4d6aa5580e89ea85b1966b865d33b3c945ed165b570f2284bc04b5f7
|
|
4
|
+
data.tar.gz: e6ca07b3a474a8601d85e652418c6c0d3dc06cf8439d91a1e326dae3525b0145
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d68188b431c8e304b7a7b807207d37cb7f5e16e5b3f896ab330994d1bc1cdd200338745fc0ca1a8a0bcffd082ae6bb48da2d7d8e279cc1254829c6bfdc11b5d
|
|
7
|
+
data.tar.gz: 6bfd789a1c7933cb7bd856a3784d93fced814961df91102aac1bcfd4b48a39126102aa69eeba3f81753b2dd6828f3daec07c329d13435acb4fecfdef846dc17a
|
data/README.md
CHANGED
|
@@ -50,7 +50,7 @@ wf.contact_groups.delete("<group-id>", force: true)
|
|
|
50
50
|
|
|
51
51
|
### Live diagnostics
|
|
52
52
|
|
|
53
|
-
Run any of
|
|
53
|
+
Run any of 22 checks from WatchFor's probe fleet against **any public
|
|
54
54
|
target**, monitored or not — this measures right now, rather than reading
|
|
55
55
|
what WatchFor recorded:
|
|
56
56
|
|
|
@@ -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.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
|
data/lib/watchfor/client.rb
CHANGED
|
@@ -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,
|
|
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
|
|
|
@@ -38,6 +38,10 @@ module Watchfor
|
|
|
38
38
|
@monitors = Monitors.new(self)
|
|
39
39
|
@alert_rules = AlertRules.new(self)
|
|
40
40
|
@incidents = Incidents.new(self)
|
|
41
|
+
@hosts = Hosts.new(self)
|
|
42
|
+
@status_pages = StatusPages.new(self)
|
|
43
|
+
@on_call = OnCall.new(self)
|
|
44
|
+
@notification_channels = NotificationChannels.new(self)
|
|
41
45
|
@maintenance_windows = MaintenanceWindows.new(self)
|
|
42
46
|
@contacts = Contacts.new(self)
|
|
43
47
|
@contact_groups = ContactGroups.new(self)
|
|
@@ -132,6 +136,7 @@ module Watchfor
|
|
|
132
136
|
# Recent probe results, newest first. Page with the response's next_cursor -> cursor:
|
|
133
137
|
# (keep the same hours/success); "locations" is the per-location breakdown for the whole window.
|
|
134
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}")
|
|
135
140
|
@c.request("GET", "/monitors/#{id}/checks",
|
|
136
141
|
query: { hours: hours, limit: limit, success: success, cursor: cursor, **query })
|
|
137
142
|
end
|
|
@@ -158,6 +163,27 @@ module Watchfor
|
|
|
158
163
|
def include(id) = @c.request("POST", "/incidents/#{id}/include")
|
|
159
164
|
end
|
|
160
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
|
+
|
|
181
|
+
class Hosts < Namespace
|
|
182
|
+
def list(**query) = @c.request("GET", "/hosts", query: query)
|
|
183
|
+
def get(id) = @c.request("GET", "/hosts/#{id}")
|
|
184
|
+
def metrics(id, metrics, range: "24h") = @c.request("GET", "/hosts/#{id}/metrics", query: { metrics: Array(metrics).join(","), range: range })
|
|
185
|
+
end
|
|
186
|
+
|
|
161
187
|
class MaintenanceWindows < Namespace
|
|
162
188
|
def list(**query) = @c.request("GET", "/maintenance-windows", query: query)
|
|
163
189
|
def get(id) = @c.request("GET", "/maintenance-windows/#{id}")
|
data/lib/watchfor/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: watchfor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- WatchFor
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Zero-dependency Ruby client for the WatchFor REST API (monitors, alert
|
|
14
14
|
rules, incidents, maintenance windows) plus a `watchfor` CLI.
|