Preface

API allows for easy access to your cloud resources, giving you the option to create tools to optimize the performance of your cloud resources and bussiness, like:
  • auto scale your cloud resources
  • generating new servers on demand
  • massively turn on servers for load balancing

Key generation

To get access to the API, you must first generate an API key pair with the following keys:
  • Client ID - used to identify client
  • API Secret - used to authenticate client
To generate these keys goto key generation page, click on the "Create New Key" button at the bottom. You’ll have to specify a description for your client and specify which permission are allowed.
After saving, the system will auto generate client id and API secret key for you.
IMPORTANT
Please keep the API secret key secret and use it only when necessary to minimize risks.

Communicating with the API

HTTP Methods

The API uses a REST like scheme to provide it’s services, using the following http methods as basic specification for what each method should do.
GET
is used to read or list resources.
PUT
is used to update existing resources.
POST
is used to create new resources.
DELETE
is used to remove resources.

HTTP Response

The API uses the general http status code for it’s status reporting:
  • 200 HTTP OK - means that an operation was completed successfully
  • OTHER STATUS CODE - means that some error has occured, and the request body contains more detailed error message

Secure Connection

All connections to the API must use Transport Layer Security (TLS)
IMPORTANT
Make sure ALL of your endpoint urls are https

Specifying methods and parameters

Request url is used for resource identification, for examle:
  • Server ID
  • Command ID
Other params are sent using the request’s body as application/x-www-form-urlencoded (same as in regular post data)
IMPORTANT
post parameters and request url paramters must be properly encoded before submitting a request

Authentication

API allows for two methods of authentication:
  • sending your clientId and secret with every request.
  • generating authentication token and sending it with every request.
NOTE
Choose one of the following methods, in the example, we’ll use the clientId and secret method, for authentication token method, replace the headers values.

Using your api credentials

To authenticate yourself with your api credentials, pass the clientId and secret in every request made to the API:
User-Agent: curl/7.35.0
Host: console.dreamvps.com
Accept: */*
AuthClientId: <your_api_client_id>
AuthSecret: <your_api_secret>

Using Authentication token

To create an authentication token you’ll send an authentication request to the API with your previously generated client id and API secret. If the specified credentials are valid, you’ll get in return an authentication token which allows you to execute various commands. Tokens are only good for 30 minutes of use, and than are expired and a new token should be requested. This allows for:
  • Minimizing the exposure of the api secret key.
  • Allow API operation in a reasonable time frame before token is expired.
  • Minize risks of token theft.
IMPORTANT
Authentication tokens will expire after 30 minutes, regardless of their usage.
After generating the Authentication token, pass it in all of the following requests as an http header with the key name:Authkey, for example:
User-Agent: curl/7.35.0 
Host: console.dreamvps.com 
Accept: */* 
Authkey: <your_api_auth_token>

Authorization

On the key generation page there is a list of privileges for every generated API client. We currently support the following:
  • Servers
  • Networks
  • Hard Disks
For each entry, a combination of read, update, create and delete options are available and corresponds to the target operation of the selected resource.

API Requests

Authentication

DESCRIPTION
Authenticates a given client with the API, and generates an authentication token for further API requests.
NOTE
using authentication token is optional, you may use your client id and secret instead. if you choose to use authentication token instead of clientId and secret authentication, replaceAuthClientId and AuthSecret headers with Authkey and set the value to the one returned from this method.
URL
https://console.dreamvps.com/service/authenticate
REQUEST METHOD
POST
URL PARAMETERS
none
POST FIELDS
KeyTypeDescription

clientId

string

api client id, generated in key generation page

secret

string

secret key, generated in key generation page
RESPONSE
KeyTypeDescription

authorization

string

newly generated authentication token

expires

timestamp (int)

token expiration timestamp
NOTE
no auth headers are sent in this method.

List Servers

DESCRIPTION
Lists all servers on cloud platform.
URL
https://console.dreamvps.com/service/servers
REQUEST METHOD
GET
URL PARAMETERS
none
POST FIELDS
none
RESPONSE
List of objects, each object represents a server with the following information:
KeyTypeDescription

id

string

server id, this is a unique identifier for this server, when asked to specify server id, this is the value to use

datacenter

string

server datacenter code

name

string

server name

power

string

server’s power state:
  • on
  • off

Server - Information

DESCRIPTION
Reads a server runtime info which includes:
  • cpu settings
  • ram size (MB)
  • power state
  • disk sizes
  • network and ip addresses
  • billing type
  • traffic package
  • managed
  • backup
URL
https://console.dreamvps.com/service/server/{serverId}
REQUEST METHOD
GET
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
none
RESPONSE
KeyTypeDescription

id

string

server uuid

datacenter

string

datacenter location code

name

string

server name

cpu

string

cpu setting

ram

int

server ram size, in MB

power

string

power state:
  • on - server is powered on
  • off - server is powered off

disks

array(int)

list of disk sizes, in GB
NOTE
list order is the same as server disks configuration

networks

array(object)

an array of objects representing the network connection to this server, each object is composed of:
  • network - the network name
  • ips - array of strings, each representing an ip address in the network

billing

string

billing type

traffic

string

traffic package

managed

boolean

managed hosting services enabled or disabled:
  • 0 - disabled hosting services
  • 1 - enabled hosting servers

backup

boolean

daily backup service enabled or disabled:
  • 0 - disabled daily backup
  • 1 - enabled daily backup

Server - Create New Server

DESCRIPTION
Creates new server on cloud platform.
Server is created using an hard disk image in hard disk library.
URL
https://console.dreamvps.com/service/server
REQUEST METHOD
POST
URL PARAMETERS
none
POST FIELDS
KeyTypeDescription

datacenter

string

datacenter location selection code, select datacenter code from the available options returned by server options method

name

string

name for the new server, may contain:
  • letters (lower and uppercase)
  • numbers
  • dots
  • underscore
5 up to 40 characters long

cpu

string

server CPU count. select value from server options method

ram

int

server memory size, in MB. select value from server optionsmethod

password

string

password to set for new server, must contain lowercase, uppercase and numeric values

managed

boolean

enable or disable managed hosting services:
  • 0 - disable managed hosting services
  • 1 - enable managed hosting servers
default value is 0

backup

boolean

enable or disable daily backup service for server:
  • 0 - disable backup services
  • 1 - enable backup services
default value is 0

power

boolean

enable auto boot after completion
  • 0 - disable auto boot
  • 1 - enable auto boot
default value is 0

billing

string

sets the billing option for server, choose between the following:
  • monthly - billing is based on server configuration and network usage only, and includes a traffic package.
  • hourly - billing is based on server configuration and it’s power state. traffic is billing is usage based.
please take a look at our pricing information page for a detailed explanation.

traffic

int

traffic package id, value is required only if monthly billing is selected,for hourly billed servers, this value is ignored.
traffic package is based on selected datacenter, choose one of the packages specified in server options method

disk_size_{IDX}

int

flattened array of integers, representing the disk sizes in GB that will be created for server. each entry represents a single hard disk size, you may specify up to 8 hard disk sizes. for example:
disk_size_0 = 15 disk_size_1 = 10 disk_size_2 = 5
will result in a server with 3 hard disks, the first disk with 15GB of storage space, the seconf with 10GB and the third with 5GB
allowed disk sizes are listed in server options method
NOTE
the first disk size must be at least as the source disk image size, you may enlarge this disk by specifying larger disk size.

disk_src_0

string

specifies source disk id for the server OS hard disk. available options are listed in server options method
NOTE
you may use any of the platform public hard disk templates or you may use one of your own, from your private hard disk library.

networks

array

an array of objects containing the networking information that will be connected to the server, each network information object is composed of:
  • network_name_{IDX} (string) - the name of the network at index IDX to connect this server to, or if not exists, the name of the network to create.
    NOTE: to specify WAN address, set this value to wan, ip address will be assigned automatically.
  • network_ip_{IDX} (string, IPv4) - the ip address to assign for this network interface, if wan is selected, this value is not required
  • network_subnet_{IDX} (string, IPv4) - for new networks only the subnet address for the newly created network, select one from the list:
    • 172.16.0.0
    • 192.168.0.0
  • network_bits_{IDX} (int) - subnet mask bits, valid values are between 20 to 30
Available networks are datacenter based and are listed in server options method
Example:
network_name_0 = wan network_name_1 = my-existing-lan network_ip_1 = 192.168.0.4 network_name_2 = my-new-lan network_subnet_2 = 172.16.0.0 network_bits_2 = 24 network_ip_2 = 172.16.0.10
will result in a server with the following network interfaces:
  • the internet (wan), with auto generated ip address
  • existing private lan, named my-existing-lan with ip: 192.168.0.4
  • new private lan, named my-new-lan with subnet: 172.16.0.0/24 and ip address: 172.16.0.10
NOTE
you may select up to 4 network interfaces
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

Server - Create New Server Options

DESCRIPTION
Lists available server creation options and parameters, including:
  • cpu configuration
  • ram configuration
  • disk sizes
  • hard disk images
  • LAN networks with free ip addresses
  • traffic packages
  • billing options
URL
https://console.dreamvps.com/service/server
REQUEST METHOD
GET
URL PARAMETERS
none
POST FIELDS
none
RESPONSE
KeyTypeDescription

datacenters

object

key value pair with datacenter code and datacenter description, this also lists all the available datacenters (zones) in which a server can be created. example:
  • EU: 'EU: European datacenter'
  • US: 'US: United states datacenter'

cpu

array(string)

available CPUs count configuration for new server, value is composed of:
  • number of cpus
  • type of cpu - B for burstable cpu, D for dedicated cpu
example values: 1B2B, 1D`,2D4D

ram

array(int)

available ram size configuration for new server, values are in MB, for example: 10242048

disks

array(int)

available disk size configuration for new server, each of the new server’s disk size is selected from this list, values are in GB. example: 152030

templates

object

key based listing of available hard disk templates. listing is datacenter based. per key, a list of objects specifying the available hard disk templates is returned, each object has the following information:
  • id (string) - unique identifier for the disk image, use this value when specifying disk image as os disk source
  • sizeGB (int) - the size in GB of the image, selected disk size in new servers must be on of the available options greater or equel to this value
  • description (string) - short description for the hard disk image
NOTE
list contains only the hard disk templates from hard disk library that can be used as an OS disks.

traffic

object

listing is datacenter based. per key, a list of objects specifying the available traffic packages is returned, each object has the following information:
  • id (int) - traffic package id
  • info (string) - traffic package textual description

networks

object

listing is datacenter based. per key, a list of objects specifying the networks is returned, each object has the following information:
  • name (string) - the network name, value is used when specifying network connection for a new server
  • ips (array) - an array of ip address range information
    • index 0 - starting address in available range
    • index 1 - ending address in available range
NOTE
listing contains networks with available addresses only.
NOTE
this is an example response, actual parameters allows a wider selection of configuration options.

Server - Clone

DESCRIPTION
Clones an existing server into a new one. A newly created clone server has the same configuration as it’s source server, you may however, override most of the parameters defined for new server generation. The only parmater which cannot be overriden is the disk source id for the first hard disk (the os disk). you may add disks, clone only the first disk of a source server or clone all of the source disks of an existing server. Also, images from hard disk library cannot be used when clonning an existing server.
NOTE
when overriding parameters, all limitations still apply.
WARNING
parallel cloning operation for a single server are not supported, if you require a bulk server generation, create an hard disk image from the source server first and create new instances from it, hard disk images may be used in parrallel
URL
https://console.dreamvps.com/service/server
REQUEST METHOD
POST
URL PARAMETERS
none
POST FIELDS
NOTE: only added paramers are shown here.
KeyTypeDescription

source

string

server id to clone (uuid), value is listed in server listing method
RESPONSE
KeyTypeDescription

-

int

operation command id

Server - Terminate

DESCRIPTION
Terminates an existing server and remove it from platform.
WARNING
this operation cannot be undone!
URL
https://console.dreamvps.com/service/server/{serverId}/terminate
REQUEST METHOD
DELETE
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

confirm

int

safety parameter, if not set to 1, operation will return an error.

force

int

force terminate when server is on, if not set to 1 and server on, operation will return an error.

Server - Power Operations

DESCRIPTION
Powers a server on, off or restart a server.
WARNING
it is always recommended to power off or restart your server from within the operating system.
URL
https://console.dreamvps.com/service/server/{serverId}/power
REQUEST METHOD
PUT
URL PARAMETERS
none
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

power

string

specifies power state to set
  • on - powers server on
  • off - shutdown server
  • restart - restart serve
 RESPONSEResulting command id, used by command info method for status and information about the operation. 

Server - Configure CPU

DESCRIPTION
Sets server cpu count.
NOTE
Server must be powered off for this operation.
URL
https://console.dreamvps.com/service/server/{serverId}/cpu
REQUEST METHOD
PUT
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

cpu

string

cpu count to set for server
NOTE
must be one of the values specified by cpu listing method.
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

Server - List CPU Options

DESCRIPTION
List the available cpu options configuration options for a server.
URL
https://console.dreamvps.com/service/server/{serverId}/cpu
REQUEST METHOD
GET
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
none
RESPONSE
List of strings
KeyTypeDescription

item

string

available CPUs count configuration for new server, value is composed of:
  • number of cpus
  • type of cpu - B for burstable cpu, D for dedicated cpu
example values: 1B2B, 1D`,2D4D

Server - Configure RAM

DESCRIPTION
Sets the server ram size.
NOTE
Server must be powered off for this operation.
URL
https://console.dreamvps.com/service/server/{serverId}/ram
REQUEST METHOD
PUT
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

ram

int

ram size in MB to set for server
NOTE
must be one of the values specified by ram listing method.
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

Server - LIst RAM Options

DESCRIPTION
List the available ram size configurations options for a server.
URL
https://console.dreamvps.com/service/server/{serverId}/ram
REQUEST METHOD
GET
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
none
RESPONSE
List of integers
KeyTypeDescription

item

int

available ram size configuration option for server, values are in MB

Server - Add Hard Disk

DESCRIPTION
Adds new hard disk to an existing server.
URL
https://console.dreamvps.com/service/{serverId}/disk
REQUEST METHOD
POST
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

size

(int)

the size of the new hard disk to create, in GB. Available disk sizes are listed in server disk options method
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

Server - List Hard Disk Options

DESCRIPTION
Lists the available disk sizes configuration for server hard disk.
URL
https://console.dreamvps.com/service/server/{serverId}/disk
REQUEST METHOD
GET
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
none
RESPONSE
List of integers
KeyTypeDescription

item

int

available disk sizes configuration option for server hard disk

Server - Resize Hard Disk Size

 
DESCRIPTION
Increases server disk size, and optionally resize the file system.
URL
https://console.dreamvps.com/service/server/{serverId}/disk
REQUEST METHOD
PUT
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

size

int

specifies the new size for server hard disk, Available disk sizes are listed in server disk options method
NOTE
disks can only grow in size, specifying smaller size then existing one will result in an error.

index

int

the index of the hard disk to resize:
  • 0 - first hard disk
  • 1 - second hard disk
  • 2 - third hard disk, etc

provision

int

enables or disables disk provisioning:
  • 0 - provisioning disabled, you should not use automatic provisioning in the following case:
    • manual disk resize is required
    • target disk does not contain a partition table
    • file system is not defined on disk
    • files system is not ntfs, ext3, ext4
NOTE
you may use any partition tool from within your server to config disk partitions and sizes.
  • 1 - provision enabled, system will attempt to auto resize the file system.
snapshot will be created before attempting to resize the file system resize, so you may revery back to it on errors and resize hard disk manually.
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

Server - Delete Hard Disk

DESCRIPTION
Terminates server hard disk.
WARNING
this operation cannot be undone!
URL
https://console.dreamvps.com/service/server/{serverId}/disk/remove
REQUEST METHOD
DELETE
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

index

int

zero based index, specifies the disk number to terminate.
NOTE
first hard disk cannot be terminated.

confirm

int

safety parameter, if not set to 1, operation will return an error.
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

Server - Snapshot - List

DESCRIPTION
Lists server current snapshots.
URL
https://console.dreamvps.com/service/server/{serverId}/snapshots
REQUEST METHOD
GET
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
none
RESPONSE
an array of object, each object with the following members:
KeyTypeDescription

id

int

identifier of snapshot

name

string

name of snapshot

desc

string

the description value for snapshot, if value was specified when snapshot was created

date

string

represents the date the snapshot was created

depth

int

the distance of snapshot from root level

active

boolean

indicates if the server active state is right after this snapshot

power

string

server power state when snapshot was created:
  • on - server was powered on when snapshot was created, reverting to this state will set the server power state to on
  • off - server was powered off when snapshot was created, reverting to this state will set the server powere state to off

childs

array(object)

an array of snapshot objects, listing all of the child snapshots for the current snapshot

Server - Snapshot - Create

DESCRIPTION
Creates new server snapshot.
URL
https://console.dreamvps.com/service/server/{serverId}/snapshot
REQUEST METHOD
POST
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

name

string

name for the new snapshot
 RESPONSEResulting command id, used by command info method for status and information about the operation. 

Server - Snapshot - Revert

DESCRIPTION
Reverts (goto) snapshot, reverts server to the state it was when snapshot was created.
URL
https://console.dreamvps.com/service/server/{serverId}/snapshot
REQUEST METHOD
PUT
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

snapshotId

int

snapshot id to revert to, snapshot id is available using server snapshot listing method
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

Server - Snapshot - Delete

DESCRIPTION
Deletes an existing server snapshot.
URL
https://console.dreamvps.com/service/server/{serverId}/snapshot
REQUEST METHOD
DELETE
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

snapshotId

int

snapshot id to delete, snapshot id is available using server snapshot listing method
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

Server - Billing Mode Info

DESCRIPTION
Determines server’s billing cycle
NOTE
Billing cycles may be modified on a monthly basis only.
URL
https://console.dreamvps.com/service/server/{serverId}/billing
REQUEST METHOD
GET
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
none
RESPONSE
Object with the currently active billing mode and the future billing mode (starting at the beginning of the next month)

Server - Set Billing Mode

DESCRIPTION
Sets the billing cycle mode for a server
NOTE
Billing cycles may be modified on a monthly basis only.
URL
https://console.dreamvps.com/service/server/{serverId}/billing
REQUEST METHOD
PUT
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

type

string

new billing mode to select for the server:
  • monthly - server billed on a monthly base
  • hourly - server billed on houry base
RESPONSE
Object with the currently active billing mode and the newly set future billing mode (starting at the beginning of the next month)

Server - Rename

DESCRIPTION
Change server’s name
URL
https://console.dreamvps.com/service/server/{serverId}/rename
REQUEST METHOD
PUT
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

name

string

new name for the server
  • name is between 5 to 40 characters, may contain: letternumbers . - _
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

Server - Reset Password

DESCRIPTION

Resets server root/Administrator password
NOTE
trigger server shutdown, it is recommended to power off the server from the OS before password reset.
URL
https://console.dreamvps.com/service/server/{serverId}/password
REQUEST METHOD
PUT
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

password

string

new password to set
  • password length is 6 to 30 characters long
NOTE
for compatibility reasons, password may contain only alphanumeric characters
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

Server - Clone to Hard Disk Library options

DESCRIPTION
List all of the clonnable hard disks on a server
Clonning to Hard Disk Library creates a copy of a server’s disk that can be used as a template image or attached to another server
NOTE
clonning to hard disk library is only available when server has no snapshots.
URL
https://console.dreamvps.com/service/server/{serverId}/hdlib
REQUEST METHOD
GET
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
none
RESPONSE
Returns a list of hard disk information objects: hard disk id, hard disk size (GB)

Server - Clone to Hard Disk Library

DESCRIPTION
Clones server hard disks to hard disk library
NOTE
clonning to hard disk library is only available when server has no snapshots.
URL
https://console.dreamvps.com/service/server/{serverId}/hdlib
REQUEST METHOD
POST
URL PARAMETERS
KeyTypeDescription

serverId

string

server id
POST FIELDS
KeyTypeDescription

disk_src_{IDX}

string

source disk uuid. multiple source disk may be specified using the IDX value, example:
  • disk_src_0 = '1111-2222-3333-4444'
  • disk_src_1 = '1111-2222-3333-5555'
source disk ids are available using the Clone to Hard Disk Library Options

disk_name_{IDX}

string

allows specifying names for the cloned hard disks, this field is optional. each index value corresponds to it’s matching disk_src_{IDX}
NOTE
if disk_name_{IDX} is not specified (for any disk_src_{IDX}), name will be generated automatically
NOTE
disk names must be unique
RESPONSE
Resulting command id, used by command info method for status and information about the operation.

List Recent Commands

DESCRIPTION
Lists active and recent commands on platform.
URL
https://console.dreamvps.com/service/queue
REQUEST METHOD
GET
URL PARAMETERS
none
POST FIELDS
none
RESPONSE
List of objects, each object represents an item in the queue with the following information:
KeyTypeDescription

id

int

command id

status

string

current status of the command, status can be in one of the following states:
  • pending - command is waiting for execution
  • executing - command is being executed (initiated)
  • progress - command is in progress
  • complete - command completed successfully
  • error - command completed with error
  • cancelled - command was cancelled before it was executed

server

string

if commands relates to a server, the server name is returned

description

string

textual description of the command

added

string

date command was added on platform

executed

string

date command was executed on platform

Show Command Info

DESCRIPTION
Returns information about a command, including entire log string.
URL
https://console.dreamvps.com/service/queue/{commandId}
REQUEST METHOD
GET
URL PARAMETERS
KeyTypeDescription

commandId

string

command id to get information for
POST FIELDS
none
RESPONSE
KeyTypeDescription

id

int

command id

status

string

current status of the command, status options same as in command listing method

server

string

if commands relates to a servr, the server name is returned

description

string

textual description of the command

added

string

date command was added on platform

executed

string

date command was executed on platform

completed

string

date command was completed

log

string

entire log string for this command

Billing - Download Billing Report

DESCRIPTION
Generates and downloads system usage report file.
URL
https://console.dreamvps.com/service/billing/${year}/${month}/self
REQUEST METHOD
GET
URL PARAMETERS
none
KeyTypeDescription

year

integer

report’s year (YYYY)

month

integer

report’s month
POST FIELDS
none
RESPONSE
CSV Data, with the requested report data.
BASHPHPPOWERSHELL
#!/bin/bash 
clientId="my_client_id"
secret="my_secret"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}"
"https://console.dreamvps.com/service/servers"       
       
       
       
       
       
       
       
       
       
       
       
#!/bin/bash 
clientId="my_client_id" 
secret="my_secret" 
curl -X POST -d "clientId=${clientId}&secret=${secret}" 
"https://console.dreamvps.com/service/authenticate"



            
RESPONSE EXAMPLE { "authentication": "<apiAuthenticationKey>", "expires": 1433438571 }
#!/bin/bash 
clientId="my_client_id"
secret="my_secret"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}"
"https://console.dreamvps.com/service/servers"


            
RESPONSE EXAMPLE [ { "id": "1111-2222-3333-4444-5555", "datacenter": "EU", "name": "server_name", "power": "on" }, { "id": "1111-2222-3333-4444-6666", "datacenter": "EU", "name": "another_server_name", "power": "off" } ]
#!/bin/bash
clientId="${secret}"
secret="my_secret"

serverId="my_server_id"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" 
"https://console.dreamvps.com/service/server/${serverId}"
            
RESPONSE EXAMPLE { "id": "1111-2222-3333-4444-5555", "datacenter": "EU", "name": "server_name", "cpu": "2B", "ram": 1024, "power": "off", "diskSizes": [ 10 ], "networks": [ { "ips": [ "192.168.1.2", "192.168.1.3" ], "network": "lan-demo" } ], "billing": "monthly", "traffic": "t5000", "managed": "0", "backup": "1" }
Minimal Example


#!/bin/bash
clientId="my_client_id"
secret="my_secret"

datacenter="EU"
name="api_server_demo_basic"
password="APIdemo29"
cpu="1"
ram="1024"
disk_size_0="15"
disk_src_0="EU%3A6000C29d53faf52015f1b1e8b6bc26ed"
network_name_0="wan"
billing="hourly"

params="datacenter=${datacenter}"
params+="&name=${name}"
params+="&password=${password}"
params+="&cpu=${cpu}"
params+="&ram=${ram}"
params+="&billing=${billing}"
params+="&disk_size_0=${disk_size_0}"
params+="&disk_src_0=${disk_src_0}"
params+="&network_name_0=${network_name_0}"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X POST -d "${params}"
"https://console.dreamvps.com/service/server"




Advance Example


#!/bin/bash
clientId="my_client_id"
secret="my_secret"

datacenter="EU"
name="api_server_demo"
password="APIdemo29"
cpu="4D"
ram="1024"
billing="monthly"
managed="1"
backup="1"
power="0"
traffic="3"

disk_size_0="15"
disk_size_1="10"
disk_size_2="5"
# note: parameters requires url encoding
disk_src_0="EU%3A1111-2222-3333-4444"

network_name_0="wan"
network_name_1="my-existing-lan"

network_ip_1="192.168.0.4"
network_name_2="my-new-lan"
network_subnet_2="172.16.0.0"
network_bits_2="24"
network_ip_2="172.16.0.10"

params="datacenter=${datacenter}"
params+="&name=${name}"
params+="&password=${password}"
params+="&cpu=${cpu}"
params+="&ram=${ram}"
params+="&billing=${billing}"
params+="&managed=${managed}"
params+="&backup=${backup}"
params+="&power=${power}"
params+="&traffic=${traffic}"
params+="&disk_size_0=${disk_size_0}"
params+="&disk_size_1=${disk_size_1}"
params+="&disk_size_2=${disk_size_2}"
params+="&disk_src_0=${disk_src_0}"
params+="&network_name_0=${network_name_0}"
params+="&network_name_1=${network_name_1}"
params+="&network_ip_1=${network_ip_1}"
params+="&network_name_2=${network_name_2}"
params+="&network_subnet_2=${network_subnet_2}"
params+="&network_bits_2=${network_bits_2}"
params+="&${network_ip_2}"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X POST -d "${params}"
"https://console.dreamvps.com/service/server"



            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" "https://console.dreamvps.com/service/server"


            
RESPONSE EXAMPLE { "datacenters": { "EX": "EX: Example Location", "EU": "EU: Europe", }, "cpu": [ "1B", "2B", "4B", "1D", "2D", "4D", "6D", "8D", ], "ram": [ 256, 512, 1024, 2048, 3072, 4096, 6144, 8192, 10240, 12288, 16384 ], "disk": [ 5, 10, 15, 20, 30, ], "diskImages": { "EX": [ { "description": "CentOS 5.10 32-bit - Basic Server Configuration", "id": "EX:111122223333344444", "sizeGB": 5 }, { "description": "CentOS 6.5 64-bit - with cPanel/WHM Installed", "id": "EX:4444333322221111", "sizeGB": 10 } ], "EU": [ { "description": "CentOS 5.10 32-bit - Basic Server Configuration", "id": "EU:111122223333344444", "sizeGB": 5 }, { "description": "CentOS 6.5 64-bit - with cPanel/WHM Installed", "id": "EU:4444333322221111", "sizeGB": 10 } ] }, "traffic": { "EX": [ { "id": 11, "info": "1000GB per month" }, { "id": 12, "info": "20MBps Unmetered" } ], "EU": [ { "id": 9, "info": "1000GB per month" }, { "id": 10, "info": "20MBps Unmetered" } ] } "networks": { "EX": [ { "name": "example_network_1", "ips": [ [ "192.168.0.119", "192.168.0.122" ], [ "192.168.0.127", "192.168.0.132" ], ] }, { "name": "example_network_2", "ips": [ [ "192.168.0.10", "192.168.0.254" ] ] }, ], "EU": [ { "name": "example_network_3", "ips": [ [ "192.168.0.50", "192.168.0.68" ], [ "192.168.0.120", "192.168.0.200" ], ] } ] }, }
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

src="source_id"
name="override_server_name"
cpu="2"
billing="hourly"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}$" -X POST -d "source=${src}&name=${name}&cpu=${cpu}&billing=${billing}" "https://console.dreamvps.com/service/server"

            
RESPONSE EXAMPLE {}
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
confirm="1"
force="1"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X DELETE -d
"confirm=${confirm}" -d "force=${force}" "https://console.dreamvps.com/service/server/${serverId}/terminate"

            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
power="on"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret:${secret} " -X PUT -d 
"power=${power}" "https://console.dreamvps.com/service/server/${serverId}/power"

            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
cpu="2D"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X PUT -d "cpu=${cpu}"
"https://console.dreamvps.com/service/server/${serverId}/cpu"

            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" "https://console.dreamvps.com/service/server/${serverId}/cpu"


            
RESPONSE EXAMPLE ['1B', '2B', '4B', '1D', '2D', '4D', '6D' , '8D']
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
ram="1024"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X PUT -d "ram=${ram}" 
"https://console.dreamvps.com/service/server/${serverId}/ram"

            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" "https://console.dreamvps.com/service/server/${serverId}/ram"

            
RESPONSE EXAMPLE [256,512,1024,2048,3072,4096,6144,8192,10240,12288,16384]
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
size=15

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X "POST" -d 
"size=${size}" "https://console.dreamvps.com/service/server/${serverId}/disk"

RESPONSE EXAMPLE
999
            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}"
"https://console.dreamvps.com/service/server/${serverId}/disk"

            
RESPONSE EXAMPLE [5,10,15,20,30,40,50,60,80,100,200,300,500,1000]
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
size="20"
index="0"
provision="0"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X PUT -d 
"size=${size}&index=${index}&provision=${provision}" 
"https://console.dreamvps.com/service/server/${serverId}/disk"

            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
index="1"
confirm="1"curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X DELETE -d 
"index=${index}&confirm=${confirm}"
 "https://console.dreamvps.com/service/server/${serverId}/disk/remove"

            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}"
"https://console.dreamvps.com/service/server/${serverId}/snapshots"


            
RESPONSE EXAMPLE [ { "id": 1, "name": "snapshot_name_at_0_0", "desc": "", "date": "6\/1\/2015 14:25:21", "depth": 0, "active": false, "power": "off", "childs": [ { "id": 2, "name": "snapshot_name_at_1_0", "desc": "", "date": "6\/1\/2015 14:26:14", "depth": 1, "active": false, "power": "off", "childs": [ { "id": 5, "name": "snapshot_name_at_2_0", "desc": "", "date": "6\/1\/2015 15:51:43", "depth": 2, "active": false, "power": "off", "childs": [] }, { "id": 6, "name": "snapshot_name_at_2_1", "desc": "", "date": "6\/1\/2015 15:53:38", "depth": 3, "active": true, "power": "off", "childs": [] } ] } ] } ]
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
name="my_new_snapshot"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X POST -d
"name=${name}" "https://console.dreamvps.com/service/server/${serverId}/snapshot"

            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
snapshotId=11

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X PUT -d 
"snapshotId=${snapshotId}"
"https://console.dreamvps.com/service/server/${serverId}/snapshot"


            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
snapshotId=11
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X DELETE -d 
"snapshotId=${snapshotId}"
"https://console.dreamvps.com/service/server/${serverId}/snapshot"

            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X GET 
"https://console.dreamvps.com/service/server/${serverId}/billing"


            
RESPONSE EXAMPLE { "active": "monthly", "future": "hourly" }
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
type="hourly"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X PUT -d 
"type=${type}" "https://console.dreamvps.com/service/server/${serverId}/billing"


            
RESPONSE EXAMPLE { "active": "monthly", "future": "hourly" }
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
name="new_server_name"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X PUT -d "name=${name}" 
"https://console.dreamvps.com/service/server/${serverId}/rename"

            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
password="MyTestPassword1234"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X PUT -d
"password=${password}" "https://console.dreamvps.com/service/server/${serverId}/password"


            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}"
"https://console.dreamvps.com/service/server/${serverId}/hdlib"

            
RESPONSE EXAMPLE [ { "uuid": "1111-2222-3333-4444", "sizeGB": 20 }, { "uuid": "1111-2222-3333-5555", "sizeGB": 30 } ]
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

serverId="my_server_id"
disk_src_0="1111-2222-3333-4444"
disk_name_0="MyCloneDisk_0"
disk_src_1="1111-2222-3333-5555"
data="disk_src_0=${disk_src_0}&disk_name_0=${disk_name_0}&disk_src_1=${disk_src_1}"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" -X POST -d"${data}"
"https://console.dreamvps.com/service/server/${serverId}/hdlib"

            
RESPONSE EXAMPLE 999
#!/bin/bash
clientId="my_client_id"
secret="my_secret"
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}"
"https://console.dreamvps.com/service/queue"



            
RESPONSE EXAMPLE [ { "id": 4085, "status": "complete" "server": "example_server_name", "description": "Create snapshot", "added": "09/06/2015 12:52:50", "executed": "09/06/2015 12:52:51", } ]
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

commandId=1010

curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}" 
"https://console.dreamvps.com/service/queue/${commandId}"

            
RESPONSE EXAMPLE { "id": 1010, "status": "complete", "server": "example_server_name", "description": "Create snapshot", "added": "09\/06\/2015 12:52:50", "executed": "09\/06\/2015 12:52:51", "completed": "09\/06\/2015 12:52:58", "log": "example log string" }
#!/bin/bash
clientId="my_client_id"
secret="my_secret"

month=10
year=2016
curl -H "AuthClientId: ${clientId}" -H "AuthSecret: ${secret}"
"https://console.dreamvps.com/service/billing/${year}/${month}/self"


#!/bin/env powershell

$clientId = 'my_client_id'
$secret = 'my_secret'

$year = 2016
$month = 10
$url = "https://console.dreamvps.com/service/billing/${year}/${month}/selfquot;

$headers = @{ 
    "AuthClientId" = $clientId;
    "AuthSecret" = $secret;
} 

try { 
    $result = Invoke-RestMethod -Uri $url -Headers $headers -Method GET
    Write-Output $result 
} 
catch { 
    $errorvalue = $_.Exception.Response.StatusCode.Value__ 
    Write-Output "Got Error $errorvalue"
}