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.
Prerequisites
Section titled “Prerequisites”- The Edka CLI, signed in with
edka login.
Find a command
Section titled “Find a command”edka api operations --search backupedka api operations --search database --jsonoperations 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.
edka api clusters listedka api clusters nodepools list --cluster productionedka api inventory resources listedka api organization current-usage getedka api clusters create --helpA 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.
Send a body
Section titled “Send a body”edka api clusters create --data @cluster.jsonedka api clusters create --field name=staging --field master_ha:=true --dry-runedka api deployments scale --id "$DEPLOYMENT_ID" --field replicas:=3--datatakes a JSON body,@file.jsonfor a file, or@-for stdin.--field key=valuesets a string, and--field key:=JSONa number, a boolean, an array or an object. A dotted key such asconfig.portbuilds a nested object.--fieldvalues replace those of the--databody.--query key=valueadds a query parameter, and repeats.--dry-runprints 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:
edka api deployments settings update --schemaCall a path
Section titled “Call a path”edka api get /api/inventory/resources --query kind=deployment --jsonedka api post /api/clusters --data @- < cluster.jsonget, 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:
edka api clusters ssh-private-key download get --cluster production --output-file id_productionConfirmation and permissions
Section titled “Confirmation and permissions”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.