universe docs source
browse docs
docs /api-reference /commands

Commands API

Run console commands on the Master node over REST and read their captured output. The same command registry backs both the interactive console and this endpoint, so every console command is reachable over HTTP without terminal access.

The Master runs an interactive console backed by a command registry. The same registry is exposed over REST, so any command available at the terminal can be invoked over HTTP. Output written by the command is captured and returned in the response, making this the primary way to drive Universe from automation that has no shell on the host.

!
warning

The commands endpoint requires a token with ALL permission.

Execute a command

POST /api/commands/execute

Executes a single console command on the Master and returns the command string alongside the text it printed.

Body fieldTypeDescription
commandstringConsole command to run on the Master, such as instance list. Required.
curl -X POST http://<master>:7000/api/commands/execute \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"command": "instance list"}'
Response fieldTypeDescription
commandstringEcho of the command that was run.
outputstringText the command printed to the console, captured as a single string.

Common commands

Commands are grouped by area. The groups below are reachable through this endpoint exactly as they are at the console.

GroupExamples
instanceinstance list, instance create <config>, instance stop <id>
configconfig list, config reload
templatetemplate list, template sync <pattern>
clustercluster status, cluster nodes
keykey create <label> <ALL|PUBLIC>
extensionextension list
helphelp

Discover available commands

Run help to list every registered command on the node:

curl -X POST http://<master>:7000/api/commands/execute \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"command": "help"}'

Create an API key

Because key management is itself a console command, you can mint new tokens over REST with an existing admin key:

curl -X POST http://<master>:7000/api/commands/execute \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"command": "key create dashboard PUBLIC"}'
tip

The response captures whatever the command prints. A command that produces no output returns an empty output string, which is normal for fire-and-forget actions.

i
note

POST /api/commands/execute targets the node serving the request. To run a command on a different cluster member, use the remote dispatch endpoint on the Cluster API.