Using the CLI
The Nuvolos Python API allows you to list objects and create workloads directly in the CLI.
Last updated
Was this helpful?
The Nuvolos Python API allows you to list objects and create workloads directly in the CLI.
Last updated
Was this helpful?
To display the available commands, run the nuvolos --help
command:
To list the organizations you are affiliated with, use the nuvolos orgs list
command:
To list Nuvolos spaces in the current organization within which your Nuvolos app is running the CLI, use the nuvolos spaces list
command:
To list the applications you have started and are currently running in Nuvolos, use the nuvolos apps running
command:
This command will also display the status of apps (STARTING, RUNNING, STOPPING) and the current CPU and memory usage of apps.
You can filter the list of running applications for a given org/space/instance or application by specifying additional flags to the command:
To list the Nuvolos applications in the current Nuvolos instance you are working on, run the nuvolos apps list
command:
First, get the slug of the application you wish to run with the nuvolos apps list
command, then start the application with the nuvolos apps start <app_slug>
command:
This behavior is particularly useful when running a "Start app" -> "Execute command" -> "Stop app" pipeline, as you can be sure that the application will be ready to execute commands when the nuvolos app start <app_slug> --wait
command returns.
You can start a Nuvolos application from the API in a different size, without needing to reconfigure it. First, you need to identify the node_pool slug for the credit-based resource size you want to use.
You can get the list of available credit based-sizes, also termed node pools with the nuvolos apps nodepools
command:
To start an app on a dedicated node from one of the node pools, add the --node-pool="<slug>"
flag, and optionally the --wait
flag, to the nuvolos apps start
command:
You can run a command in a running Nuvolos application as if you had a bash
terminal opened in the given application. This lets you create an automated workflow to execute a workload on Nuvolos. You do this by automatically starting a pre-configured application, running a program in the application, and then stopping the application when the command finishes.
To submit a command for execution, use the nuvolos apps execute --app <app_slug> 'YOUR COMMAND'
command, like:
Upon every command execution, a new folder is created in the selected application's instance under the /files/nuvolos_api_out
folder in a <timestamp>_<request_id>
format, where the request ID (reqid
) is returned by the CLI command. A metadata.json
file is created to store details such as the application context, submission timestamp, and the submitted command:
By default, the standard output and the standard error of your command are redirected to separate files to ensure preservation. The files are located in the folder introduced above, called output.log
and error.log
, respectively.
You can stop a running Nuvolos application with the command nuvolos apps stop --app <app_slug>
:
To list these applications, select the api_command_run:enabled
tag on the screen.