The Exoscale command-line interface
exo
is the official command-line tool to access Exoscale services.
You can manage your infrastructure from a user-friendly command line, with all the benefits of a scriptable interface.
Installation
To get started, download the archive corresponding to your operating system from the latest release on GitHub.
GNU/Linux
Debian / Ubuntu
- Download
cli_$VERSION_linux_amd64.deb
- Run
$ sudo dpkg -i cli_$VERSION_linux_amd64.deb
RedHat / CentOS
- Download
cli_$VERSION_linux_amd64.rpm
- Run
sudo rpm -i cli_$VERSION_linux_amd64.rpm
Other distributions
- Download
cli_$VERSION_linux_amd64.tar.gz
- Expand it
- Put the
exo
binary into your$PATH
, e.g./usr/local/bin/
Docker
You can run the CLI as a Docker container with the following command:
docker run -it exoscale/cli <command argument>
Note
The docker builds are for AMD64 architecture only. For ARM or ARM64, use the tar.gz release.
Apple macOS
Install with Homebrew:
brew tap exoscale/tap
brew install exoscale-cli
Or alternatively:
- Download and open
cli_$VERSION_darwin_amd64.tar.gz
- Copy the
exo
executable in a directory inside your$PATH
Microsoft Windows
The binary file works for both the traditional Command Prompt as well as the more modern PowerShell.
- Download
cli_%VERSION%_windows_amd64.zip
-
Open the command line shell (
cmd.exe
) and type the following commandsmkdir C:\exoscale setx path "%path%;C:\exoscale;"
-
Put all files from zip archive into
C:\exoscale\
Configuration
A configuration file holding your credentials is required. You can generate one via a guided prompt. The following parameters are requested:
API Key
Secret Key
If you do not already have a key and the corresponding secret, you can generate one using the Exoscale Portal. See the IAM section of this documentation.
Configuration
The CLI will guide you in the initial configuration:
$ exo config
After you save, you can review your current configuration later by running the exo config show
command.
Commands overview
You are now ready to use the CLI. To explore the possibilities of the CLI, use the raw exo --help
command to list commands and options:
$ exo --help
Create a Compute instance
The exo compute instance
command allows you to do basic CRUD operations on Compute instances.
Run exo compute instance create
to deploy an instance:
$ exo compute instance create example
✔ Creating instance "example"... 18s
┼──────────────────────┼──────────────────────────────────────┼
│ COMPUTE INSTANCE │ │
┼──────────────────────┼──────────────────────────────────────┼
│ ID │ 7b014127-e635-4d14-b8c4-090549891583 │
│ Name │ example │
│ Creation Date │ 2021-09-15 15:45:28 +0000 UTC │
│ Instance Type │ standard.medium │
│ Template │ Linux Ubuntu 20.04 LTS 64-bit │
│ Zone │ ch-gva-2 │
│ Anti-Affinity Groups │ n/a │
│ Security Groups │ default │
│ Private Networks │ n/a │
│ Elastic IPs │ n/a │
│ IP Address │ 85.217.161.93 │
│ IPv6 Address │ - │
│ SSH Key │ - │
│ Disk Size │ 50 GiB │
│ State │ running │
│ Labels │ n/a │
┼──────────────────────┼──────────────────────────────────────┼
The command automatically creates an SSH key specifically for this instance. If you need to use an SSH key of your own, you can refer to it by name with the --ssh-key <keyname>
option.
Create a firewall rule to allow SSH connection
By default, security groups without any rule specified block all incoming connections. To reach your instance via SSH, you need to explicitly allow ingress on port 22.
Use the exo compute security-group rule add
command:
$ exo compute security-group rule add default --network 0.0.0.0/0 --port 22
✔ Adding rule to Security Group "default"... 3s
┼──────────────────┼────────────────────────────────────────────────────────────────────┼
│ SECURITY GROUP │ │
┼──────────────────┼────────────────────────────────────────────────────────────────────┼
│ ID │ 9eb186db-cf1f-4f8a-8218-03d2a0150f11 │
│ Name │ default │
│ Description │ │
│ Ingress Rules │ │
│ │ dfc6d3a6-a15f-430f-b999-82a80ffc3aac TCP 0.0.0.0/0 22 │
│ │ │
│ Egress Rules │ - │
│ External Sources │ - │
┼──────────────────┼────────────────────────────────────────────────────────────────────┼
Connect to a Compute instance via SSH
The exo compute instance ssh
command lets you directly log into an instance using an SSH connection.
$ exo compute instance ssh example
Host key fingerprint is SHA256:nmAfu17qHLkJkEpOy2qXWaV5nSMq0yzKD6j0giZIghk
Welcome to Ubuntu 19.04 LTS (GNU/Linux 4.15.0-20-generic x86_64)
ubuntu@example:~$
Cleaning up
Removing an instance is as simple as creating one, but beware - there is no way to undo a deletion.
$ exo compute instance delete example
[+] Are you sure you want to delete instance "example"? [yN]: y
✔ Deleting instance "example"... 6s
Alternative output formats
By default, commands outputting information as a result of an operation will format the content in a table, so it is easier to read.
If you use the exo
CLI in scripts, output formats JSON or
templated text might be more suitable for non-interactive uses:
# JSON
$ exo compute instance show example -O json | jq -r .ip_address
85.217.161.93
# Text templating
$ exo compute instance show example -O text --output-template '{{.ID}}@{{.Zone}}'
7b014127-e635-4d14-b8c4-090549891583@ch-gva-2
You can find more information with the exo help output
command in the CLI.