watchfor 0.1.0 → 0.4.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 +1 -0
- data/exe/watchfor +2 -1
- data/lib/watchfor/client.rb +15 -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: 0bbe1b3093561c22831a65a54fe793e3940c44a06b74477890606ed68de080e1
|
|
4
|
+
data.tar.gz: 9f58677f13e0ff368293bae5a040fb18f43f576f40ecff320424592ebabb5232
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e78697d7e326e57e419aebbbb5c5a38071443cfe2c61c5dd204613a7b92253d0801fb7dc18c91507ae2f8c687f0465821968f74edff781ba1a93bbdd303f1f6
|
|
7
|
+
data.tar.gz: 6ad9649aabcc6d2bc8374d39ea6fecd4e38f03cf44005f644ce6d2767d98b27a99f1b4392ffb755c3ed4df094eee13aa725b015fc7ebbbcb0d4c4142ecab58e6
|
data/README.md
CHANGED
data/exe/watchfor
CHANGED
|
@@ -32,8 +32,9 @@ begin
|
|
|
32
32
|
when "monitor-types" then wf.monitor_types
|
|
33
33
|
when "incidents" then wf.incidents.list
|
|
34
34
|
when "checks" then wf.monitors.checks(args.shift)
|
|
35
|
+
when "report" then wf.report(period: args.include?("--period") ? args[args.index("--period") + 1] : nil)
|
|
35
36
|
else
|
|
36
|
-
warn "Usage: watchfor [summary|plan|monitors|locations|monitor-types|incidents|checks <monitor_id
|
|
37
|
+
warn "Usage: watchfor [summary|plan|monitors|locations|monitor-types|incidents|checks <monitor_id>|report [--period 7d|30d]]"
|
|
37
38
|
exit 2
|
|
38
39
|
end
|
|
39
40
|
puts JSON.pretty_generate(result)
|
data/lib/watchfor/client.rb
CHANGED
|
@@ -86,6 +86,21 @@ module Watchfor
|
|
|
86
86
|
def summary = request("GET", "/summary")
|
|
87
87
|
def plan = request("GET", "/plan")
|
|
88
88
|
def incident_stats(period = nil) = request("GET", "/incidents/stats", query: { period: period })
|
|
89
|
+
|
|
90
|
+
# Org report vs the previous period (period: "7d"/"30d", or from/to ISO 8601
|
|
91
|
+
# on advanced-reports plans): uptime, incidents, MTTR/MTBF, response-time
|
|
92
|
+
# trend, per-monitor rows, type-aware sections and plain-language insights.
|
|
93
|
+
def report(period: nil, from: nil, to: nil)
|
|
94
|
+
if from || to
|
|
95
|
+
request("GET", "/reports", query: { from: from, to: to })
|
|
96
|
+
else
|
|
97
|
+
request("GET", "/reports", query: { period: period })
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
# The org's two report-email cadences (weekly + monthly); set toggles
|
|
101
|
+
# a cadence and/or replaces its recipients (max 5).
|
|
102
|
+
def report_schedules = request("GET", "/reports/schedules")
|
|
103
|
+
def set_report_schedule(frequency, body) = request("PATCH", "/reports/schedules/#{frequency}", body: body)
|
|
89
104
|
def locations = request("GET", "/locations")
|
|
90
105
|
def monitor_types = request("GET", "/meta/monitor-types")
|
|
91
106
|
def notifications(**query) = request("GET", "/notifications", query: query)
|
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.4.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-
|
|
11
|
+
date: 2026-09-03 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.
|