API

Instance Sizes

Instances are sized by combinations of CPU virtual cores, memory and disk space. Custom sizes can also be created by customers, as our quotas and therefore pricing are based on a combined allocation of CPU, RAM and disk.


Listing available sizes

Listing the available sizes is possible by making a GET request to the https://api.civo.com/v2/sizes resource.

Request

This request doesn't take any parameters.

Response

The response from the server will be a JSON array of sizes, each with a name and the appropriate attributes.

[
  {
    "id": "d6b170f2-d2b3-4205-84c4-61898622393d",
    "name": "micro",
    "nice_name": "Micro",
    "cpu_cores": 1,
    "ram_mb": 1024,
    "disk_gb": 25,
    "description": "Micro - 1GB RAM, 1 CPU Core, 25GB SSD Disk",
    "selectable": true
  },
  // ...
]

Example of listing available sizes

curl -H "Authorization: bearer 12345" https://api.civo.com/v2/sizes
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.get(
  'https://api.civo.com/v2/sizes',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = get('v2/sizes', headers)