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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0bbe1b3093561c22831a65a54fe793e3940c44a06b74477890606ed68de080e1
4
- data.tar.gz: 9f58677f13e0ff368293bae5a040fb18f43f576f40ecff320424592ebabb5232
3
+ metadata.gz: 9af0dcb3158ef210d30f76f4535fa1af2febdd195c1e89c3356492839326d008
4
+ data.tar.gz: fc12ab07a54877f0d098ac7ac76612c31d37188ed3b9f9283819b078e6f2caed
5
5
  SHA512:
6
- metadata.gz: 9e78697d7e326e57e419aebbbb5c5a38071443cfe2c61c5dd204613a7b92253d0801fb7dc18c91507ae2f8c687f0465821968f74edff781ba1a93bbdd303f1f6
7
- data.tar.gz: 6ad9649aabcc6d2bc8374d39ea6fecd4e38f03cf44005f644ce6d2767d98b27a99f1b4392ffb755c3ed4df094eee13aa725b015fc7ebbbcb0d4c4142ecab58e6
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`,
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Watchfor
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
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.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-03 00:00:00.000000000 Z
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.