Documentation
¶
Overview ¶
Package sensor hosts the cobra commands under `meho sensor ...` for Task #2503 of Initiative #2416 (parent goal #221, the deterministic check layer). Three operator-facing verbs wrap the Sensor admin REST surface (`backend/src/meho_backplane/api/v1/sensors.py`):
- `meho sensor list [--status <s>] [--cadence-kind <k>] [--tenant <id>] [--limit N] [--offset N] [--json]` — list sensors via GET /api/v1/sensors. Role: operator. The list carries each sensor's latest-result projection, so it is also the status view.
- `meho sensor create --name <n> --connector-id <id> --op-id <op> --assertion <json> --cadence-kind <interval|cron> (--interval-seconds N | --cron-expr <expr>) [--timezone <tz>] [--severity <degraded|critical>] [--for-seconds N] [--target <json>] [--params <json>] [--identity-sub <sub>] [--tenant <id>] [--json]` — create one sensor via POST /api/v1/sensors. Role: tenant_admin. The op must resolve to a safety_level='safe' descriptor.
- `meho sensor delete <sensor_id> [--tenant <id>] [--json]` — hard-delete one sensor via DELETE /api/v1/sensors/{id}. Role: tenant_admin.
- `meho sensor edit <sensor_id> [--name ...] [--connector-id ...] ...` — change some fields in place via PATCH /api/v1/sensors/{id}; the id, the result history and the dashboard memberships stay. Role: tenant_admin.
- `meho sensor pause|resume <sensor_id> [--tenant <id>] [--json]` — stop or restart the runner's checks of one sensor via PATCH /api/v1/sensors/{id} with status. Role: tenant_admin.
- `meho sensor run <sensor_id> [--tenant <id>] [--json]` — make one sensor due now via POST /api/v1/sensors/{id}/run; the runner runs it at its next tick. Role: tenant_admin.
- `meho sensor results <sensor_id> [--from T] [--to T] [--state S] [--limit N] [--cursor C] [--json]` — the per-tick evidence trend query (#2756) via GET /api/v1/sensors/{id}/results: raw rows in evaluated_at ASC order, binary filters only, keyset-cursor paging. Role: operator, own-tenant only.
Every verb drives the generated `api.ClientWithResponses` surface directly (the G0.12-T13 typed-client discipline): consumer-side struct drift can't recur because we consume `api.SensorRead`, `api.SensorListResponse`, and `api.SensorCreate` directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRootCmd ¶
NewRootCmd returns the `meho sensor` parent command, grafted onto the top-level meho tree by cmd/root.go alongside `meho scheduler`, etc.
Types ¶
This section is empty.