Advanced Cloud Hosting/Cloud API

From XMission Wiki
Jump to: navigation, search


The RESTful API is one of the most useful and more interesting features of our Cloud Infrastructure service. With the ability to expose nearly all the features of your control panel the API will definitely help you get some 'REST'.

The Cloud Infrastructure RESTful API is well documented and available to all Cloud Infrastructure and Cloud Server subscribers. You can read the full documentation here:

Accessing a Resource

A PACI resource is accessed by sending an HTTPS request to a PACI server. When the server receives a request, it processes it accordingly (performs actions or retrieves data) and sends back a response that can contain the data that you requested, an operation status code, or an error messate. All PACI resources are accessed at the following URL (referred to as baseURL)

https://{ip_address | hostname}:port/paci/version


  1. ip_address | hostname is the PACI server IP address or hostname.
  2. port is the port number on which the server is listening for REST requests
  3. paci must be typed exactly as shown
  4. version is the API version number

For our resource the baseURL will use the following:

Server Management

Using this API can come in handy for various types of resource information for example you can use the API to list your current server, configure your server, even stop and start lets take a look at a few basic commands.

List your current servers

Use this request to obtain the list of servers owned by the current user


A sample out put would list your current servers.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ve-info description="XMission minecraft server" state="STARTED" name="minecraft" subscription-id="1003209"/>

More specific server info

If you want to be more specific and obtain information about a specific server you can add the server name like this:


A sample out put will look like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <description>Testing Server</description>
    <cpu number="4" power="1500"/>
    <ve-disk created="true" id="0" local="true" size="25"/>
        <template-info name="ubuntu-12.04-x86_64"/>
        <os-info type="ubuntu-12.04-x64" technology="CT"/>
    <network private-ip="">
        <public-ip chunk-ref="1" id="269" address="" gateway=""/>
    <admin login="root" password="[hidden]"/>

Here you can see it shows you all relative information about the server including the number of CPUs, CPU Power, Ram, IP address and much more.

Many more useful command can be used as well - more common would be to start or stop your server.

Start / Stop your Server


A sample output would be:

VE START initiated

There is so much more you can do with this API including adjusting your server at peak times to compensate for your server load, and then readjusting them back during non peak times.

We have a great blog post regarding this API located on Transmission XMission's Company Journal

Use the Cloud Infrastructure API to Automatically Resize Your Server

This documentation is to be used as a guide. Your server will require different settings to optimize your traffic and this code is not perfect. We encourage you to customize it to fit your needs, or write it in a language of your choice. Remember to refer to the documentation.