Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

docs: stop labelling free Patrol routes as Pro

rcourtman66d4239307a9
diff --git a/docs/API.md b/docs/API.md
index 21edce3d25..7e450a4153 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -1613,25 +1613,42 @@ Runs a focused investigation for an alert payload (used by the UI).
`?include=tool_calls`. Returns `400` when the ID is empty, `404`
(`not_found`) when no retained run has that ID, and `503`
(`service_unavailable`) when the Patrol service is unavailable.
-- `GET /api/ai/patrol/stream` (Pro)
-- `POST /api/ai/patrol/run` (admin, Pro)
-- `POST /api/ai/patrol/acknowledge` (Pro)
+- `GET /api/ai/patrol/stream` (`ai:execute`)
+ - Server-sent events for live Patrol progress. Send `Last-Event-ID` (or the
+ `last_event_id` query parameter) to resume after the last event `id`;
+ replay is best-effort.
+- `POST /api/ai/patrol/run` (admin, `ai:execute`)
+ - Community installs are limited to one successful full run per hour and
+ get `429 patrol_rate_limited` until it has passed. Pro and Cloud have no
+ cap.
+- `POST /api/ai/patrol/acknowledge` (`ai:execute`)
- `POST /api/ai/patrol/dismiss`
- `POST /api/ai/patrol/findings/note`
- `POST /api/ai/patrol/resolve`
-- `POST /api/ai/patrol/snooze` (Pro)
-- `POST /api/ai/patrol/suppress` (Pro)
-- `GET /api/ai/patrol/suppressions` (Pro)
-- `POST /api/ai/patrol/suppressions` (Pro)
-- `DELETE /api/ai/patrol/suppressions/{id}` (Pro)
-- `GET /api/ai/patrol/dismissed` (Pro)
+- `POST /api/ai/patrol/snooze` (`ai:execute`)
+- `POST /api/ai/patrol/suppress` (`ai:execute`)
+- `GET /api/ai/patrol/suppressions` (`ai:execute`)
+- `POST /api/ai/patrol/suppressions` (`ai:execute`)
+- `DELETE /api/ai/patrol/suppressions/{id}` (`ai:execute`)
+- `GET /api/ai/patrol/dismissed` (`ai:execute`)
+
+Patrol itself and managing its findings (acknowledge, snooze, suppress,
+dismiss) are available on Community. Only the paid-labelled routes below
+return `402`. Tokens issued for Pulse Mobile (`relay:mobile:access`) are also
+accepted on the acknowledge, dismiss and snooze routes.
### Findings & Investigations
- `GET /api/ai/unified/findings`
- `GET /api/ai/findings/{id}/investigation`
- `GET /api/ai/findings/{id}/investigation/messages`
-- `POST /api/ai/findings/{id}/reinvestigate`
-- `POST /api/ai/findings/{id}/reapprove` (Pro)
+- `POST /api/ai/findings/{id}/reinvestigate` (Pro, `ai:execute`)
+ - Needs the `ai_autofix` entitlement (`402 license_required` otherwise) and a
+ Patrol mode other than Watch only (`400 autonomy_disabled`). Returns
+ `409 investigation_running` while one is already in progress.
+- `POST /api/ai/findings/{id}/reapprove` (Pro, `ai:execute`; retired: it always
+ returns `410 Gone` with error code `command_fix_retired`; approve typed
+ actions through `POST /api/actions/{id}/decision` (`actions:approve`)
+ instead)
### Approvals & Command Execution (Pro)
- `GET /api/ai/approvals`
diff --git a/frontend-modern/public/docs/API.md b/frontend-modern/public/docs/API.md
index 21edce3d25..7e450a4153 100644
--- a/frontend-modern/public/docs/API.md
+++ b/frontend-modern/public/docs/API.md
@@ -1613,25 +1613,42 @@ Runs a focused investigation for an alert payload (used by the UI).
`?include=tool_calls`. Returns `400` when the ID is empty, `404`
(`not_found`) when no retained run has that ID, and `503`
(`service_unavailable`) when the Patrol service is unavailable.
-- `GET /api/ai/patrol/stream` (Pro)
-- `POST /api/ai/patrol/run` (admin, Pro)
-- `POST /api/ai/patrol/acknowledge` (Pro)
+- `GET /api/ai/patrol/stream` (`ai:execute`)
+ - Server-sent events for live Patrol progress. Send `Last-Event-ID` (or the
+ `last_event_id` query parameter) to resume after the last event `id`;
+ replay is best-effort.
+- `POST /api/ai/patrol/run` (admin, `ai:execute`)
+ - Community installs are limited to one successful full run per hour and
+ get `429 patrol_rate_limited` until it has passed. Pro and Cloud have no
+ cap.
+- `POST /api/ai/patrol/acknowledge` (`ai:execute`)
- `POST /api/ai/patrol/dismiss`
- `POST /api/ai/patrol/findings/note`
- `POST /api/ai/patrol/resolve`
-- `POST /api/ai/patrol/snooze` (Pro)
-- `POST /api/ai/patrol/suppress` (Pro)
-- `GET /api/ai/patrol/suppressions` (Pro)
-- `POST /api/ai/patrol/suppressions` (Pro)
-- `DELETE /api/ai/patrol/suppressions/{id}` (Pro)
-- `GET /api/ai/patrol/dismissed` (Pro)
+- `POST /api/ai/patrol/snooze` (`ai:execute`)
+- `POST /api/ai/patrol/suppress` (`ai:execute`)
+- `GET /api/ai/patrol/suppressions` (`ai:execute`)
+- `POST /api/ai/patrol/suppressions` (`ai:execute`)
+- `DELETE /api/ai/patrol/suppressions/{id}` (`ai:execute`)
+- `GET /api/ai/patrol/dismissed` (`ai:execute`)
+
+Patrol itself and managing its findings (acknowledge, snooze, suppress,
+dismiss) are available on Community. Only the paid-labelled routes below
+return `402`. Tokens issued for Pulse Mobile (`relay:mobile:access`) are also
+accepted on the acknowledge, dismiss and snooze routes.
### Findings & Investigations
- `GET /api/ai/unified/findings`
- `GET /api/ai/findings/{id}/investigation`
- `GET /api/ai/findings/{id}/investigation/messages`
-- `POST /api/ai/findings/{id}/reinvestigate`
-- `POST /api/ai/findings/{id}/reapprove` (Pro)
+- `POST /api/ai/findings/{id}/reinvestigate` (Pro, `ai:execute`)
+ - Needs the `ai_autofix` entitlement (`402 license_required` otherwise) and a
+ Patrol mode other than Watch only (`400 autonomy_disabled`). Returns
+ `409 investigation_running` while one is already in progress.
+- `POST /api/ai/findings/{id}/reapprove` (Pro, `ai:execute`; retired: it always
+ returns `410 Gone` with error code `command_fix_retired`; approve typed
+ actions through `POST /api/actions/{id}/decision` (`actions:approve`)
+ instead)
### Approvals & Command Execution (Pro)
- `GET /api/ai/approvals`
diff --git a/scripts/tests/test_api_reference_routes.py b/scripts/tests/test_api_reference_routes.py
index 690ae182f7..8093ac18f3 100644
--- a/scripts/tests/test_api_reference_routes.py
+++ b/scripts/tests/test_api_reference_routes.py
@@ -108,6 +108,26 @@ class APIReferenceRoutesTest(unittest.TestCase):
self.assertIn("410 Gone", line, route)
self.assertIn("command_remediation_retired", line, route)
+ def test_patrol_routes_documented_without_a_paid_label_have_no_licence_wrapper(self) -> None:
+ # Patrol and managing its findings are free; only governed fixes are Pro.
+ router = read("internal/api/router_routes_ai_relay.go")
+ for name in ("stream", "run", "acknowledge", "snooze", "suppress", "suppressions", "dismissed"):
+ route = f"/api/ai/patrol/{name}"
+ bullets = [line for line in self.doc.splitlines()
+ if re.match(r"- `(?:GET|POST|DELETE) %s(?:/\{id\})?`" % re.escape(route), line)]
+ self.assertTrue(bullets, route)
+ for bullet in bullets:
+ self.assertNotIn("Pro", bullet)
+ start = router.index(f'HandleFunc("{route}"')
+ following = router.find("r.mux.Handle", start + 10)
+ registration = router[start:following if following != -1 else start + 900]
+ self.assertNotIn("RequireLicenseFeature", registration, route)
+
+ def test_reapprove_is_documented_as_retired(self) -> None:
+ entry = self.doc.split("`POST /api/ai/findings/{id}/reapprove`", 1)[1].split("\n\n", 1)[0]
+ for text in ("retired", "410 Gone", "command_fix_retired"):
+ self.assertIn(text, entry)
+
def test_validate_token_is_not_filed_under_the_licensed_audit_log(self) -> None:
audit = self.doc.split("## 🧾 Audit Log (Pro)", 1)[1].split("\n## ", 1)[0]
self.assertNotIn("/api/security/validate-token", audit)