CLI
l4 alerts update
Change a cost alert's name, rule, source, recipients or Slack channels from a JSON file of only the fields to change.
l4 alerts update changes a cost alert. It sends only the fields its file names, and leaves every other field as it is.
l4 alerts update <id> --file <path|-> [--yes]The change file
The file takes any of name, params, source_id, recipients and slack_channel_ids, in the shapes l4 alerts create describes.
paramsreplaces the whole rule. To move one threshold, send the rule back with that figure changed.recipientsandslack_channel_idsreplace the list they name. An emptyslack_channel_idstakes every channel off.- The CLI refuses a file that names no field with
... changes nothing, before it sends anything.
Raise a monthly budget to 50,000, keeping the rest of the rule:
l4 alerts get <id> --json \
| jq '{params: (.data.params | .budget = 50000)}' \
| l4 alerts update <id> --file - --yesTo pause an alert, use l4 alerts pause.
Flags
| Flag | Description |
|---|---|
-f, --file | The change file, or - to read it from stdin. Required |
-y, --yes | Skip the confirmation prompt |
Confirmation
At a terminal, the command asks Change cost alert <id>? [y/N]. Anything other than y or yes aborts, prints Aborted., and exits 0 without calling the API. In a pipe or a script, where stdout is not a terminal, it changes the alert without asking. With --file - at a terminal, pass --yes, for the reason create gives.
Requires a read-write key
A read-only key fails with exit 1 and permission denied. See CLI authentication.
Output
A success line, then the alert as it now reads, in the layout of l4 alerts get. With --json, the alert as the API returns it.
Errors
| Exit | Symptom | Cause |
|---|---|---|
1 | ... is not a cost alert id | The id is not a UUID |
1 | ... changes nothing | The file is an empty object |
1 | 403 permission denied | The key is read-only |
1 | 404 | No alert has that id in your organization |
1 | 422 with a reason | The API refused the change for a reason create lists, or for a field set to null |