watchfor 0.8.0 → 0.10.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 +4 -1
- data/lib/watchfor/client.rb +30 -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: 4922ce5a8ab3f8757d67110dd6705ec23cd07190e2ce12fb8e3a76b0bef72cd7
|
|
4
|
+
data.tar.gz: 53ae8a93fb27b7e96ca47cd7383fbbbc1207c1cadc597316429b6b4f43232521
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6fcfeb516a7621f6aa6b8dc18eb0492b928052158aee32cd51319344d06e210006527303927f5453f1b0106fcfe4dafeb10f18ea3b1584670b6532b8049f714
|
|
7
|
+
data.tar.gz: 37a2e3ad2df077d130609042d0c61cb2aabb8bacb1d9f56c2fff503f819f09d5847f5d6e33334c3267342d91f504f5e3811888c336e447a91341d6cf8386510d
|
data/README.md
CHANGED
|
@@ -40,6 +40,9 @@ wf.incidents.exclude(19351, reason: "Probe-side DNS hiccup")
|
|
|
40
40
|
# Irreversible: wipe a monitor's checks and incidents; uptime restarts "since reset"
|
|
41
41
|
wf.monitors.reset(mon["id"])
|
|
42
42
|
|
|
43
|
+
# Page integrity: after a deploy, accept what the newest check saw as the new baseline
|
|
44
|
+
wf.monitors.accept_baseline(integrity_monitor_id)
|
|
45
|
+
|
|
43
46
|
# Older checks: pass next_cursor back as cursor (keep the same hours/success)
|
|
44
47
|
page = wf.monitors.checks(mon["id"], hours: 24, limit: 100)
|
|
45
48
|
wf.monitors.checks(mon["id"], hours: 24, limit: 100, cursor: page["next_cursor"]) if page["next_cursor"]
|
|
@@ -76,7 +79,7 @@ and spend the same per-plan hourly allowance as the dashboard Toolbox.
|
|
|
76
79
|
Details: <https://watchfor.io/docs/api/diagnostics>
|
|
77
80
|
|
|
78
81
|
Namespaces: `wf.monitors`, `wf.alert_rules`, `wf.incidents`,
|
|
79
|
-
`wf.hosts`, `wf.maintenance_windows`, `wf.contacts`, `wf.contact_groups`,
|
|
82
|
+
`wf.hosts`, `wf.status_pages`, `wf.on_call`, `wf.notification_channels`, `wf.maintenance_windows`, `wf.contacts`, `wf.contact_groups`,
|
|
80
83
|
`wf.diagnostics`. Top-level:
|
|
81
84
|
`wf.summary`, `wf.plan`, `wf.me`, `wf.locations`, `wf.monitor_types`,
|
|
82
85
|
`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, :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)
|
|
@@ -136,6 +139,17 @@ module Watchfor
|
|
|
136
139
|
@c.request("GET", "/monitors/#{id}/checks",
|
|
137
140
|
query: { hours: hours, limit: limit, success: success, cursor: cursor, **query })
|
|
138
141
|
end
|
|
142
|
+
# One check in full detail (redacted).
|
|
143
|
+
def check_detail(id, run_id) = @c.request("GET", "/monitors/#{id}/checks/#{run_id}")
|
|
144
|
+
# Page integrity monitors: the accepted baseline of every watched page.
|
|
145
|
+
def baseline(id) = @c.request("GET", "/monitors/#{id}/baseline")
|
|
146
|
+
# Page integrity monitors: accept what the newest check saw as the new
|
|
147
|
+
# baseline — all pages, or only `pages:`. Call it from a deploy pipeline
|
|
148
|
+
# a minute after the release; unfetched pages come back in "skipped".
|
|
149
|
+
def accept_baseline(id, pages: nil, idempotency_key: nil)
|
|
150
|
+
@c.request("POST", "/monitors/#{id}/baseline",
|
|
151
|
+
body: pages ? { pages: pages } : {}, idempotency_key: idempotency_key)
|
|
152
|
+
end
|
|
139
153
|
end
|
|
140
154
|
|
|
141
155
|
class AlertRules < Namespace
|
|
@@ -159,6 +173,21 @@ module Watchfor
|
|
|
159
173
|
def include(id) = @c.request("POST", "/incidents/#{id}/include")
|
|
160
174
|
end
|
|
161
175
|
|
|
176
|
+
class StatusPages < Namespace
|
|
177
|
+
def list(**query) = @c.request("GET", "/status-pages", query: query)
|
|
178
|
+
def get(id) = @c.request("GET", "/status-pages/#{id}")
|
|
179
|
+
def announcements(id, **query) = @c.request("GET", "/status-pages/#{id}/announcements", query: query)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
class OnCall < Namespace
|
|
183
|
+
def get = @c.request("GET", "/on-call")
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
class NotificationChannels < Namespace
|
|
187
|
+
def list(**query) = @c.request("GET", "/notification-channels", query: query)
|
|
188
|
+
def get(id) = @c.request("GET", "/notification-channels/#{id}")
|
|
189
|
+
end
|
|
190
|
+
|
|
162
191
|
class Hosts < Namespace
|
|
163
192
|
def list(**query) = @c.request("GET", "/hosts", query: query)
|
|
164
193
|
def get(id) = @c.request("GET", "/hosts/#{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.10.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-25 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.
|