Browse docs
On this page

obi create

Create a resource from flags, from JSON with --data and --set, or from manifest files.

obi create creates a resource.

Shell
obi create TYPE NAME [flags]
obi create -f FILE

Run obi create with no type to see every type you can create.

Examples

The common types take their settings as flags:

Shell
obi create dashboard "Checkout health" --visibility shared
obi create alert payments-errors --query 'level:error service:payments' --window 5m --threshold 50
obi create silence --alert payments-errors --for 2h --reason "deploy"
obi create saved-search "Payments errors" --query 'level:error service:payments' --range 1h
obi create check checkout-up --type http --target https://shop.example.com/health --interval 1m
obi create api-key ci-deploys --scope full_access --expires-in-days 90
obi create invitation [email protected] --role member
obi create support-ticket "Search is slow" --message "Since this morning..." --priority normal
TypeFlags
dashboard[--description TEXT] [--kind classic|pro] [--visibility private|shared]
alert--query ObiQL --window 5m [--condition log_volume|error_rate|pattern_match] [--operator '>'] [--threshold N] [--interval 1m] [--description TEXT]
silence--alert NAME [--for 1h | --until TIME] [--reason TEXT]
saved-search--query ObiQL [--range 1h] [--visibility private|shared]
check--type ping|http|search (--target URL_OR_HOST | --query ObiQL) [--interval 1m] [--method GET]
api-key--scope read_only|full_access|ingest [--expires-in-days N]
invitationEMAIL [--role member|admin|viewer]
support-ticketSUBJECT --message TEXT [--priority low|normal|high|urgent]

Every other type takes its request body as JSON:

Shell
obi create role --data '{"name": "on-call", "capabilities": ["manageAlerts"]}'
obi create lookup-table --data @countries.json

A new API key's secret is printed once, with a reminder that it cannot be shown again.

Flags

FlagMeaning
-d, --data JSONThe request body. @file.json reads it from a file and @- from stdin. Combined with the type's own flags, it is merged over what they produce.
--set KEY=VALUESet one field. Repeat it for more, and use dotted keys ([email protected]) for nested fields. Values are read as JSON when they parse (50, true), otherwise as text.
-f, --filename PATHCreate every object in a manifest file or directory. Unlike obi apply, it never updates an object that already exists.
--dry-runPrint the request instead of sending it.