Document Version: v1.9.4
VPS.NET RESTful API Documentation
VPS Cloud Sites—Next Generation Web Hosting
This guide outlines the basic principles of using the VPS.NET RESTful API to manage your account and cloud servers. If you have any questions about using this system, please don't hesitate to contact the VPS.NET support team.
This documentation is program language-independent and our examples will use command-line CURL to send the requests to VPS.NET
- Authentication
- Requesting Data
- API Functions:
API Functions: SSD VPS
GET SSD VPS's #
Gets the list of all SSD VPS's on your account.
- URL: https://api.vps.net/ssd_virtual_machines.api10json
- Method: GET
- Returns: JSON array containing attributes for each SSD VPS on your account
[{
"virtual_machine":
{
"running": true,
"updated_at": "2015-01-15T05:15:02-04:00",
"power_action_pending": false,
"system_template_id": 41,
"id": 1432,
"cloud_id": 3,
"domain_name": "demodomain.com",
"hostname": "web01",
"consumer_id": 0,
"backups_enabled": false,
"password": "a8hjsjnbs91",
"ssd_vps_label": "SSD Server 01",
"ssd_plan": "VPS 1GB",
"created_at": "2015-01-14T03:10:39-04:00",
"bandwidth_used":8255683
}
},
{
"virtual_machine":
{
"running": true,
"updated_at": "2015-01-19T06:55:02-04:00",
"power_action_pending": false,
"system_template_id": 221,
"id": 1632,
"cloud_id": 13,
"domain_name": "demodomain.com",
"hostname": "mysql01",
"consumer_id": 0,
"backups_enabled": false,
"password": "dsi8h38hd2s",
"ssd_vps_label": "SSD Server 02",
"ssd_plan": "VPS 2GB",
"created_at": "2015-01-10T08:17:39-04:00",
"bandwidth_used":2345678
}
}]
Where:
running
- Shows if the machine is booted
power_action_pending
- Shows if the machine is currently locked pending a task. Usually implies a reboot/shutdown/startup/resize is in progress.
built
- Shows if the machine is built
system_template_id
- The ID of the template this machine is based on
cloud_id
- The ID of the cloud this machine is located within
backups_enabled
- Shows if the backups are enabled
password
- The default root password for this machine. The password will be set to this whenever the machine is built.
bandwidth_used
- Monthly bandwidth used (in Kilobytes)
ssd_plan
- Shows the SSD VPS package name currently on.
Other fields are self-explanatory.
GET properties for a SSD VPS #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}.api10json
- Method: GET
- Returns: single JSON object as outlined above
See above for example output and field definitions
CREATE SSD VPS #
- URL: https://api.vps.net/ssd_virtual_machines.api10json
- Method: POST
- Accepts: JSON array containing parameters required to build a new SSD server - see below
- Returns: JSON array containing attributes for the newly created SSD server
{
"virtual_machine":
{
"ssd_vps_plan": "1",
"fqdn": "ssd.mydomain.net",
"system_template_id": 29,
"cloud_id":10,
"backups_enabled": false,
"rsync_backups_enabled": false,
"licenses":
{
"12":1,
"15":0
}
}
}
Where:
ssd_vps_plan
- Required. Select a package/plan for the new SSD server. ( VPS 0.5GB - 0, VPS 1GB - 1, VPS 2GB - 2, VPS 4GB - 3, VPS 8GB - 4, VPS 16GB - 5)
fqdn
- Required. The fully qualified domain name for the new host
system_template_id
- Required. The ID of the template you will base your machine on
cloud_id
- Required. The ID of the cloud you will base your machine on
backups_enabled
- Required. Specify if the backups are enabled for this machine
rsync_backups_enabled
- Required. Specify if the Rsync Backup are enabled for this machine
licenses
- Optional. To purchase control panel or add-on licensing, use the array with license_id:value (1 - purchase license, 0 - cancelling license)
Use Get SSD Clouds to list available SSD clouds
EDIT a SSD VPS #
You can edit SSD server properties.
- URL: https://api.vps.net/ssd_virtual_machines/{ID}.api10json
- Method: PUT
- Returns: if successful, you will receive a 200 OK status with no content. If there is a validation error, you will receive a 422 Unprocessable Entity header with an array of errors.
{
"virtual_machine":
{
"ssd_vps_plan": "4"
"backups_enabled": false
}
}
SHUTDOWN a SSD VPS gracefully #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/shutdown.api10json
- Method: POST
- Returns: SSD server properties
Run this command on machines which are powered on.
START UP a SSD VPS #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/power_on.api10json
- Method: POST
- Parameters: {'mode' : 'recovery'} (Optional - To start a SSD server in recovery mode.)
- Returns: SSD server properties
Run this command on machines which are powered off.
REBOOT a SSD VPS gracefully #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/reboot.api10json
- Method: POST
- Parameters: {'mode' : 'recovery'} (Optional - To reboot a SSD server on recovery mode.)
- Returns: SSD server properties
Run this command on machines which are powered on.
POWER OFF a SSD VPS forcefully #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/power_off.api10json
- Method: POST
- Returns: SSD server properties
Run this command on machines which are powered on.
Rebuild a SSD VPS #
To rebuild a pending SSD server.
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/rebuild.api10json
- Method: POST
- Returns: SSD server properties
Rebuild SSD VPS Network #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/rebuild_network.api10json
- Method: POST
- Returns: SSD server properties
Note: Your SSD server will be rebooted and the network interfaces configuration file on this SSD server will be regenerated.
GET rsync backup info of a SSD VPS #
Gets the rsync backup info for a specific SSD server.
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/backups/rsync_backup.api10json
- Method: GET
- Returns: JSON representation of your SSD servers rsync backup info on success
{ "username":1000, "quota":"0.00 GB out of 10 GB", "password":"GGD3sH" }
CONVERT SSD VPS backup to a template #
Converts an existing backup to a template.
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/backups/{BACKUP_ID}/convert.api10json
- Method: POST
- Returns: if successful, you will receive a 200 OK status. If there is a validation error, you will receive a 422 Unprocessable Entity header with an array of errors.
RESTORE SSD VPS backup #
Restores an existing backup.
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/backups/{BACKUP_ID}/restore.api10json
- Method: POST
- Returns: if successful, you will receive a 200 OK status. If there is a validation error, you will receive a 422 Unprocessable Entity header.
GET bandwidth utilisation for SSD VPS #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/network_graph.api10json?period={hourly|daily|weekly|monthly|yearly}
- Method: GET
- Returns: Raw bandwidth utilisation data.
You may pass 'from' and 'to' with timestamps as params to get usage data during a specific timespan.
GET CPU utilisation for SSD VPS #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/cpu_graph.api10json?period={hourly|daily|weekly|monthly|yearly}
- Method: GET
- Returns: Raw CPU usage data for SSD servers.
You may pass 'from' and 'to' with timestamps as params to get usage data during a specific timespan.
Re-install a SSD VPS #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/reinstall.api10json
- Method: PUT
- Accepts: JSON array containing ID of system template (as outlined below) with which the SSD server will be reinstalled.
- Returns: a JSON formatted representation of the SSD server's properties.
{"virtual_machine": {"system_template_id": 132} }
Reset root password for SSD VPS #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/reset_password.api10json
- Method: POST
- Returns: JSON array containing attributes (including the new password) for a SSD Server or 422 Unprocessable Entity when fails
SSD server will be rebooted in order to reset the password.
Deploy all storage for SSD VPS #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/deploy_all_storage.api10json
- Method: POST
- Returns: JSON object containing attributes for a SSD Server or 422 Unprocessable Entity when fails
Note: Upgrading your storage will cause downtime on your SSD Server.
DELETE a SSD VPS #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}.api10json
- Method: DELETE
- Returns: a 200 OK HTTP status
This will put the SSD server on a recoverable state for 12 hours since the time SSD server was deleted.
Options
"{'reassign_ip':'1234', 'alternate_vps':'1221'}"
- reassign_ip: Transfer primary IP address of the SSD server to another SSD server on the same cloud. Specify ID of SSD server to transfer to. Please note that the IP address will be added as an additional IP address and is chargeable.
- alternate_vps: Transfer the Pro-Active Managed Service on this SSD server to another.
Pro-Active Managed Service cannot be transfered to a Windows server.
Clone a SSD VPS #
- URL: https://api.vps.net/ssd_virtual_machines/{ID}/backups.api10json
- Method: POST
- Accepts: JSON array containing parameters required to create a clone - see below
- Returns: if successful, you will receive a 200 OK status. If there is a validation error, you will receive a 422 Unprocessable Entity header with an array of errors.
{
"cloud_id": 12,
"one_click": true,
"one_clone": true
}
Where:
cloud_id
- Required. The ID of the cloud you will base your clone machine on
one_click
- Required.
one_clone
- Required.
Note: Your SSD server will be cloned in the same cloud unless you pass cloud_id.