Common arguments

verbose

Make the operation more talkative. Can be set also via environment variable ROOTBOX_CLI_VERBOSE.

Examples

Displays the URL of the request to the API
rbx image list --verbose

no-wait

In case of queued event do not wait for completion

It allows to perform operations asynchronously, which can be used to optimize the execution time of scripts.

Examples

Create virtual machine without waiting for the process to be completed
rbx vm create --name test-vm --os-disk ssd,10 --type a1.nano --image debian --ssh my-ssh --no-wait

dry-run

Dry run for the request

Try to perform operations without making any real changes:

rbx disk create --name xxxx.com --type ssd --size 25 --dry-run

output

Specify output format of command. Can be set also via environment variable ROOTBOX_CLI_OUTPUT.

Available formats

  • table - Simple results as tabular (default).
  • list - Subsequent properties line by line.
  • tsv - Mostly works like tabular format, but without the header row. Efficiently usable in awk and shell.
  • json - Raw response of API
  • yaml - Full response displayed as YAML
  • id - Just resource ID line by line
Examples
View all disks in tsv format
rbx disk list -o tsv
View all networks in list format
rbx network list -o list
View all virtual machines in table format
rbx vm list -o table

query

JMESPath query string

JMESPath is quite a powerful tool that allows to efficiently obtain specific information about resources.

See the documentation and examples published on jmespath.org for details about syntax.

Examples

Calculates the total size of disks
rbx disk list -o json --query 'sum([].size)'
Summarize image size
rbx image list --query '[].{name:name,diskCount:length(disks),fileSize:fileSize}'
Attach all detached disk to VM
rbx disk list --query "[?state=='Detached'].{id:_id}" -o tsv | xargs -r -n 1 rbx vm disk attach --vm test-vm --disk
Stop all running virtual machines
rbx vm list --query "[?state=='Running'].{id:_id}" -o tsv | xargs -r -n 1 rbx vm stop --vm
Create new disk and attach to virtual machine
$ DISK_ID=$(rbx disk create --name my-ambigious-name --type ssd --size 10 -o tsv --query '[].[_id]')
$ rbx vm disk attach --vm test-vm --disk $DISK_ID

Note (1): In most cases, you can avoid using ID by naming resources uniquely.

yes

Perform action without additional confirmation

Examples

Remove disk without additional confirmation
rbx disk delete --disk test-disk --yes

Note (1): Pretty useful when writing automatic scripts.

project-select

Override current project on the request. Can be set also via environment variable ROOTBOX_PROJECT.

A parameter intended for selecting an ad-hoc project for a single command.

Examples

List virtual machine on selected project
rbx vm list --output tsv --project-select MyProject
Czy uważasz ten artykuł za przydatny? Tak Nie