Page tree
Skip to end of metadata
Go to start of metadata

API Guide:

Introduction

The Flex Cloud API is a powerful utility for Superb Flex Cloud users, with the API you can manage every aspect of your virtual machines and integrate that control with your existing frameworks or internal tools. This guide is a complete reference for all API calls, includes detailed API call information, code, and output examples.

 

  • The API is RESTful
  • All function calls respond to XML and JSON exchange formats (JSON is the default)
  • All function calls need authorization and authentication (Basic Auth using the API key as the password and account ID as username)

API URL: https://mycp.superb.net/flexapi

<api_url> is used as a placeholder for this url

 

The API accepts HTTP Basic Authentication with your Account ID as the user and your generated  API key as the password. Curl example:

curl –u <account_id>:<api_key>

Flex Cloud VM control

A simple Virtual Server management tool.

Check it out here:Flex Cloud VM Control

HTTP Methods

The API uses the following HTTP methods:

GET - used for retrieving information from a particular URI

POST - used for creating new object and adding new transactions into the queue

PUT - used for altering object properties,  updated_at value is changed in PUT requests even if the request fails.

DELETE - used for object deletion

HTTP response codes

The API returns appropriate HTTP status codes for every request: 

200 OK

The request completed successfully

204 No content

The request completed successfully. The 204 status is returned on DELETE and PUT requests

207 Multi-StatusMultiple requests made, multiple statuses returned

201 Scheduled

The request has been accepted and scheduled for processing

403 Forbidden

The request is correct, but could not be processed.

404 Not Found

The requested URL is incorrect or the resource does not exist. For example, if you request to delete a disk with ID {5}, but there is no such disk in the cloud, you will get a 404 error. 

422 Unprocessable Entity

The sent parameters are erroneous.

500 Internal Server Error

  An error occurred. Please contact support.


Formatting and naming conventions

The table below represents all the existing formatting and naming conventions used in this guide:

Convention

Explanation

Example

user:userpass

stands for username:password (<account_id>:<api_key>)

723412:efd0d4b5995ac61adf11a2e193275bb5db1febd1

<api_url>placeholder for the api address
curl -i -X GET --url <api_url>/virtual_machines

:id

stands for the resource ID. 
Sometimes also: :resource_id

23

italics

all the parameters are italicised

currency_code

* (asterisk)

marks the required parameters

label *

preformatted

indicates request examples in XML or JSON

GET /roles.xml
info
An info message emphasizes or explains the information within the chapter.
Clicking the OFF button performs graceful shutdown and then powers off the VS.
note
A note message contains information essential for the task completion.
The maximum length of a Mount Point is 256 characters.
warning
A warning message informs you of something you should not do or be cautious.
You won't be able to restore a VS after deleting it

Templates

This is a reference for the available templates, template_label may be used in place of the required template_id when creating new virtual servers. 

<template_label> 
Minimum memory 128
Minimum disk size 10

e.g.

{
"virtual_machine": {
	"template_label": "CentOS 7.1 x64", ...
	}
}

Labels must be exact and are case sensitive!

 

Available systems

CentOS 6.7

LabelCentOS 6.7 x64
Minimum memory384 MB
Minimum disk size5 GB
Virtualization typeXEN, KVM

CentOS 7.7

LabelCentOS 7.1 x64
Minimum memory384 MB
Minimum disk size5 GB
Virtualization typeXEN, KVM

Debian 8.0

LabelDebian 8.0 x64
Minimum memory512 MB
Minimum disk size6 GB
Virtualization typeXEN, KVM

FreeBSD 10.1

LabelFreeBSD 10.1 x64
Minimum memory256 MB
Minimum disk size5 GB
Virtualization typeXEN, KVM

Red Hat 6.7

LabelRed Hat Enterprise Linux 6.7 x64
Minimum memory512MB
Minimum disk size6 GB
Virtualization typeXEN, KVM

Red Hat 7.1

LabelRed Hat Enterprise Linux 7.1 x64
Minimum memory512MB
Minimum disk size6 GB
Virtualization typeXEN, KVM

Ubuntu 12.04

LabelUbuntu 12.04 x64
Minimum memory128 MB
Minimum disk size5 GB
Virtualization typeXEN, KVM

Ubuntu 14.04

LabelUbuntu 14.04 x64
Minimum memory256 MB
Minimum disk size5 GB
Virtualization typeXEN, KVM

 

Windows 2008 DC (datacenter)

LabelWindows 2008 x64 DC R2
Minimum memory1024 MB
Minimum disk size20 GB
Virtualization typeKVM
LicenseKMS

Windows 2008 STD (standard)

LabelWindows 2008 x64 STD R2
Minimum memory256 MB
Minimum disk size5 GB
Virtualization typeKVM
LicenseKMS

Windows 2012 DC (datacenter)

LabelWindows 2012 x64 DC R2
Minimum memory1024 MB
Minimum disk size20 GB
Virtualization typeKVM
LicenseKMS

Windows 2012 STD (standard)

LabelWindows 2012 x64 STD R2
Minimum memory1024 MB
Minimum disk size20 GB
Virtualization typeKVM
LicenseKMS
  • No labels