Read alerts
alerts list takes --search (a case-insensitive match on the name), --limit (50 by default, up to 200), and --page (from 0). alerts get shows the full rule and its evaluation state.
Create an alert
Put the rule in a file:rule.json
filters and no_data_mode are optional. To repeat notifications, set renotify to { "mode": "EVERY", "interval_minutes": 60 }.
These fields also have flags: --name, --view, --measure, --aggregation, --window, --threshold-operator, --threshold, --filters, and --renotify. A flag overrides the same field in the file. CLI 0.6.1 refuses --no-data-mode, so set no_data_mode in the file.
Rule Reference lists every measure, aggregation, window, and filter, and the limits. Send a JSON body covers files and stdin. Creating the same rule twice makes two alerts. alerts list shows each alert’s ID.
Change an alert
--filters and --renotify take JSON, and --filters replaces the whole list.
Changing the measure, aggregation, filters, window, operator, threshold, or no-data mode starts the rule fresh. Changing the name or renotify doesn’t, though renotify restarts a parked alert. The response’s state_reset and page_cleared report what happened.
Pause or resume
Delete an alert
--reason. An open alert is discarded rather than resolved, and the response’s page_cleared says when one was.