DevOps engineers like to automate things. Once you’ll start programming your infrastructure with Exoscale services, you will quickly need to create scripts to test, monitor and automate actions on your virtual machines. Knowing this, the Exoscale team created a tool called CS, which allows to interact directly with their Cloudstack API through the command line or a script.

As the Cloudstack API allows for numerous possibilities, this document narrows it to a selection of commands available on Exoscale API. This list is non exhaustive but should help you to get started in most cases.

If you want to go further, the exhaustive list of the API calls you can use with your Exoscale account is documented here.

List available service offering

This list the different cpu and memory templates available for your Instances:

$ cs listServiceOfferings | jq '.serviceoffering[]'

Manage firewalling

You should always isolate your virtual machines in different security group according to their usage. To do so, you will need to create security groups in which rules are added to allow network connections on specific ports and protocol.

First, Create a security group:

$ cs createSecurityGroup name="my-security-group-1"

Then, add a rule from one security group to another for a specific port / protocol: