Summary
Currently cx alerts only supports create, get, list, enable, disable, and events. There is no way to update an existing alert definition in-place.
Problem
Without an update command, modifying any property of an alert (thresholds, notification channels, re-notify intervals, labels, filters) requires:
- Fetch the existing alert with
cx alerts get <id>
- Manually edit the JSON
- Disable the old alert with
cx alerts disable <id>
- Create a new alert with
cx alerts create
- Manually clean up the disabled alert from the UI (no
cx alerts delete either)
This is error-prone and leaves stale disabled alerts accumulating in the account.
Proposed Solution
Add cx alerts update <id> that accepts the same JSON file format as cx alerts create:
cx alerts update <id> --from-file alert.json --yes
Behaviour:
- Accepts the same
alertDefProperties JSON schema as create
- Performs an in-place update (preserves the alert ID)
- Returns the updated alert definition on success
- Requires
--yes to match create behaviour for destructive safety
Bonus: also add cx alerts delete <id> so the full CRUD lifecycle is covered from the CLI.
Workaround
Currently using disable + create, leaving orphaned disabled alerts behind.
Environment
cx version: 0.1.4
- Platform: Linux (Azure VM)
Summary
Currently
cx alertsonly supportscreate,get,list,enable,disable, andevents. There is no way to update an existing alert definition in-place.Problem
Without an update command, modifying any property of an alert (thresholds, notification channels, re-notify intervals, labels, filters) requires:
cx alerts get <id>cx alerts disable <id>cx alerts createcx alerts deleteeither)This is error-prone and leaves stale disabled alerts accumulating in the account.
Proposed Solution
Add
cx alerts update <id>that accepts the same JSON file format ascx alerts create:Behaviour:
alertDefPropertiesJSON schema ascreate--yesto matchcreatebehaviour for destructive safetyBonus: also add
cx alerts delete <id>so the full CRUD lifecycle is covered from the CLI.Workaround
Currently using disable + create, leaving orphaned disabled alerts behind.
Environment
cxversion:0.1.4