# Grafana Alerting and monitoring data on Grafana — query any datasource (Prometheus, Loki, SQL, ...) through one endpoint, discover datasources, and manage alerting end-to-end: alert rules and rule groups, contact points, the notification policy tree, mute timings, and notification templates. Run these through `omni-cli` once a human has connected the platform (`omni-cli grafana login`). Full parameter and output schemas come from `omni-cli discovery grafana`. ## alert rules | Command | What it does | Kind | |---|---|---| | `omni-cli grafana alert-rule create` | Create a new alert rule in a folder's rule group. | write | | `omni-cli grafana alert-rule delete` | Delete an alert rule by UID. | write | | `omni-cli grafana alert-rule get` | Get one alert rule by UID, including its full query/expression pipeline (data). | read | | `omni-cli grafana alert-rule list` | List all provisioned alert rules (discovers rule uids, folder uids, and rule-group names; per-rule query data is omitted — use alert-rule.get). | read | | `omni-cli grafana alert-rule update` | Replace an existing alert rule by UID — a FULL replace, not a patch; send every field (alert-rule.get first, edit, put back). | write | | `omni-cli grafana rule-group delete` | Delete a rule group AND every alert rule inside it. | write | | `omni-cli grafana rule-group get` | Get a rule group (its evaluation interval and the full rules it contains). | read | | `omni-cli grafana rule-group update` | Set a rule group's evaluation interval (and optionally replace its rules wholesale) — the way to change how often rules evaluate. | write | ## contact points | Command | What it does | Kind | |---|---|---| | `omni-cli grafana contact-point create` | Create a contact point (an alert-notification destination). | write | | `omni-cli grafana contact-point delete` | Delete a contact point by UID (fails while any notification policy or rule still references its name). | write | | `omni-cli grafana contact-point list` | List contact points (discovers the uid contact-point.update/delete need and the name notification policies and alert-rule notification-settings reference). | read | | `omni-cli grafana contact-point update` | Replace an existing contact point by UID — a FULL replace; send name, type, and the complete settings (with real secrets, not the REDACTED placeholders contact-point.list returns). | write | ## discovery | Command | What it does | Kind | |---|---|---| | `omni-cli grafana datasource get` | Get a single datasource by UID (connection settings and plugin config; credentials are never returned). | read | | `omni-cli grafana datasource health` | Run the plugin's health check against a datasource (verifies the datasource can reach its backend — troubleshooting). | read | | `omni-cli grafana datasource list` | List datasources (discovers the datasource uid every query and alert rule chains on). | read | | `omni-cli grafana folder list` | List folders (discovers the folder-uid alert rules and rule groups live in). | read | | `omni-cli grafana org get` | Get the current organization (discovers the org-id alert-rule.create and alert-rule.update require). | read | ## query | Command | What it does | Kind | |---|---|---| | `omni-cli grafana datasource query` | Query one or more datasources (Prometheus, Loki, SQL, ...) over a time window — the query language in each query object is the target datasource's own. | read | ## mute timings | Command | What it does | Kind | |---|---|---| | `omni-cli grafana mute-timing create` | Create a mute timing — reference it from notification-policy routes to silence them during the window. | write | | `omni-cli grafana mute-timing delete` | Delete a mute timing by name (fails while a notification policy still references it). | write | | `omni-cli grafana mute-timing get` | Get one mute timing by name. | read | | `omni-cli grafana mute-timing list` | List mute timings (named time windows during which matching routes send no notifications). | read | | `omni-cli grafana mute-timing update` | Replace a mute timing's intervals by name (full replace of the interval list). | write | ## notification policy | Command | What it does | Kind | |---|---|---| | `omni-cli grafana notification-policy get` | Get the notification policy tree — the routing rules that decide which contact point each alert reaches. | read | | `omni-cli grafana notification-policy reset` | Reset the notification policy tree to the Grafana default (grafana-default-email) — DISCARDS every custom route. | write | | `omni-cli grafana notification-policy update` | Replace the ENTIRE notification policy tree — notification-policy.get first, edit, put back; anything omitted is gone. | write | ## templates | Command | What it does | Kind | |---|---|---| | `omni-cli grafana template delete` | Delete a notification template group by name. | write | | `omni-cli grafana template get` | Get one notification template group by name. | read | | `omni-cli grafana template list` | List notification template groups (Go templates that format alert notifications). | read | | `omni-cli grafana template update` | Create or replace a notification template group by name (an upsert — there is no separate create). | write |