Skip to content
SYS.DOCS // DOCS

API commands

edka api has a command for each endpoint of the Edka API that the CLI can call, beyond what the other commands cover: object storage, GitHub Actions, notifications, inventory, cluster backups, and more. Each has its own help, path parameters, JSON body and query flags. edka api get and the other method commands call a path directly.

  • The Edka CLI, signed in with edka login.
Terminal window
edka api operations --search backup
edka api operations --search database --json

operations lists each command with its method, path and summary. The CONFIRM column marks the commands that ask for confirmation.

The commands follow the API path. A cluster’s database operations live under edka api clusters databases, for example. An endpoint that performs an action is named after it, such as edka api deployments restart. Other endpoints end in list or get for reads, and in create, update or delete for writes.

Terminal window
edka api clusters list
edka api clusters nodepools list --cluster production
edka api inventory resources list
edka api organization current-usage get
edka api clusters create --help

A path parameter is a flag, such as --cluster or --id. --cluster takes a cluster’s name or ID. Typing an endpoint command without api, such as edka inventory resources list, prints the edka api command to run.

Terminal window
edka api clusters create --data @cluster.json
edka api clusters create --field name=staging --field master_ha:=true --dry-run
edka api deployments scale --id "$DEPLOYMENT_ID" --field replicas:=3
  • --data takes a JSON body, @file.json for a file, or @- for stdin.
  • --field key=value sets a string, and --field key:=JSON a number, a boolean, an array or an object. A dotted key such as config.port builds a nested object. --field values replace those of the --data body.
  • --query key=value adds a query parameter, and repeats.
  • --dry-run prints the request and sends nothing. Resolving a cluster’s name may still read the list of clusters.

A few endpoints describe their body. Their help lists --schema, which prints the JSON Schema of the body with an example, and sends nothing:

Terminal window
edka api deployments settings update --schema
Terminal window
edka api get /api/inventory/resources --query kind=deployment --json
edka api post /api/clusters --data @- < cluster.json

get, post, put, patch and delete call a path that starts with /api/. They take --data, --field and --query like the endpoint commands.

To save a binary or text response, write it to a file that only you can read:

Terminal window
edka api clusters ssh-private-key download get --cluster production --output-file id_production

An endpoint that deletes, replaces or revokes something asks for confirmation, or takes --yes. Its help says so. A path called with edka api delete or another method asks when the endpoint it names does. A path that matches no known endpoint asks when it is a DELETE or contains a word such as rollback, revoke or purge.

Requests carry the permissions of your role, and of the access you granted at sign-in. An endpoint protected by identity step-up needs the console while step-up is on, and its help says so. Changes to your sign-in identity, billing changes and deleting the organization stay in the console.