Skip to main content

create

create alerts

🚨 Create an alert.

This command supports reading input from a file. Files can be supplied via the --file flag or piped into the command.

Example of file structure
{
"active": true,
"alert_type": "cpu",
"environment_id": "00000000-0000-0000-0000-000000000000",
"evaluation_period": 5,
"project_id": "00000000-0000-0000-0000-000000000000",
"severity_level": "high",
"threshold": 90
}

Usage​

csph alerts create [flags]

Aliases​

alerts create, alerts new, alert create, alert new

Options​

Command Specific​

--account <string>
account ID

--active (default true)

active [true|false]
--alert-type <string>
alert type: [cpu|memory|disk] (required)
--environment <string>
environment ID (required)

--evaluation-period <int> (default 0)

evaluation period (required)
--file <string>
specify a payload file [json|yaml], has precedence over other flags
--project <string>
project ID (required)
--severity <string>
severity: [low|medium|high] (required)

--threshold <int> (default 0)

threshold (required)

Inherited​

--config <string>
config file (default is $HOME/.config/computesphere/configuration.yaml)
--debug
enable debug logging

-h, --help

show this help message

-i, --interactive

run interactively (prompts, pickers, table browser)
--log-level <string>
log level: [trace|debug|info|warn|error|fatal|panic|disabled||api]
--no-color
disable color output
--no-input
disable interactive mode

Examples​

# start an interactive prompt to create an alert
> csph alert create


# create an alert for a specific project
> csph alert create \
--project <project-id> \
--environment <environment-id> \
--alert-type cpu \
--severity high \
--threshold 80 \
--evaluation-period 50

# create an alert from a file
> csph alert create --file /path/to/alert.yaml

# create an alert via stdin
> cat /path/to/alert.json | csph alert create

See also​