watchfor 0.4.0 → 0.5.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 +7 -0
- data/lib/watchfor/client.rb +9 -0
- 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: 9af0dcb3158ef210d30f76f4535fa1af2febdd195c1e89c3356492839326d008
|
|
4
|
+
data.tar.gz: fc12ab07a54877f0d098ac7ac76612c31d37188ed3b9f9283819b078e6f2caed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de5374a23086013159a4526dc02f0c262525902a2a00ebdcf515797459c8ef26b52d351ff603705187674e5710c3b3097f3fffa98390dfdb745aa794475c20b3
|
|
7
|
+
data.tar.gz: 0ccb9565903bca08b71d857ab9604357e6f337655bddb2d200d7f7015d501403ebf867eb9aee7074b95f496f46ce35198f145de9d41afd2ea95ac951433638f7
|
data/README.md
CHANGED
|
@@ -32,6 +32,13 @@ mon = wf.monitors.create(
|
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
wf.incidents.list(status: "firing")["data"].each { |i| puts i["message"] }
|
|
35
|
+
|
|
36
|
+
# False positive? Keep the resolved incident on record but drop it from
|
|
37
|
+
# uptime, SLA, reports and the status page (include undoes it)
|
|
38
|
+
wf.incidents.exclude(19351, reason: "Probe-side DNS hiccup")
|
|
39
|
+
|
|
40
|
+
# Irreversible: wipe a monitor's checks and incidents; uptime restarts "since reset"
|
|
41
|
+
wf.monitors.reset(mon["id"])
|
|
35
42
|
```
|
|
36
43
|
|
|
37
44
|
Namespaces: `wf.monitors`, `wf.alert_rules`, `wf.incidents`,
|
data/lib/watchfor/client.rb
CHANGED
|
@@ -120,6 +120,10 @@ module Watchfor
|
|
|
120
120
|
def pause(id) = @c.request("POST", "/monitors/#{id}/pause")
|
|
121
121
|
def resume(id) = @c.request("POST", "/monitors/#{id}/resume")
|
|
122
122
|
def check_now(id) = @c.request("POST", "/monitors/#{id}/check-now")
|
|
123
|
+
# IRREVERSIBLE: deletes every check, incident, note and post-mortem of the
|
|
124
|
+
# monitor and starts uptime over ("since reset"); the monitor and its
|
|
125
|
+
# configuration, alert rules, tags and locations stay.
|
|
126
|
+
def reset(id) = @c.request("POST", "/monitors/#{id}/reset")
|
|
123
127
|
def uptime(id, period = nil) = @c.request("GET", "/monitors/#{id}/uptime", query: { period: period })
|
|
124
128
|
def checks(id, **query) = @c.request("GET", "/monitors/#{id}/checks", query: query)
|
|
125
129
|
end
|
|
@@ -137,6 +141,11 @@ module Watchfor
|
|
|
137
141
|
def get(id) = @c.request("GET", "/incidents/#{id}")
|
|
138
142
|
def acknowledge(id) = @c.request("POST", "/incidents/#{id}/acknowledge")
|
|
139
143
|
def resolve(id) = @c.request("POST", "/incidents/#{id}/resolve")
|
|
144
|
+
# Mark a RESOLVED incident as a false positive: kept on record, left out of
|
|
145
|
+
# uptime, SLA, reports and the public status page (409 while still open).
|
|
146
|
+
def exclude(id, reason: nil) = @c.request("POST", "/incidents/#{id}/exclude", body: reason.nil? ? {} : { reason: reason })
|
|
147
|
+
# Undo #exclude - the incident counts as downtime again.
|
|
148
|
+
def include(id) = @c.request("POST", "/incidents/#{id}/include")
|
|
140
149
|
end
|
|
141
150
|
|
|
142
151
|
class MaintenanceWindows < Namespace
|
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.5.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-04 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.
|