Skip to main content

Scripting

Output​

-o json or -o yaml prints what a command shows, as the API gives it, for a script to read:

hivepaas ps -o json
hivepaas deploy ls -o yaml

hivepaas logs -o json prints each line as a JSON object of its own.

Questions​

A command that deletes, restores or creates many things at once - app delete, backup restore, compose up - asks first at a terminal. In a script there is no one to ask: --yes answers, and without it the command stops with exit code 2.

Exit codes​

CodeMeaning
0done
1failed, or status --fail found something
2wrong usage, or a question with no terminal to ask
3the key is not accepted
4the key may not do this
5not found
6refused by the installation's checks, or its plan's limits (ERR_PLAN_LIMIT_REACHED)
7the installation failed
8a deployment, task or job run that failed
9timed out waiting
10the installation's API is newer: update the CLI
11app vulns --fail-on found what it fails on
130interrupted

Any API call​

hivepaas api calls any endpoint of the REST API with the CLI's key. {project}, {env} and {app} in the path are filled in from the flags or the directory's link:

hivepaas api GET /projects/{project}/{env}/apps/{app}/routing-settings
hivepaas api PUT /projects/{project}/{env}/apps/{app}/health-check-settings -d @health.json