|
API RU VDS
Below is an older version of the API that no longer receives new updates and support. Documentation with examples for the current version of API v2 is located at: https://ruvds.com/api-docs a>.
With RU VDS API you can create your own White Label business, using a full spectrum of it functions listed on your account's page.
All API queries are SSL encrypted and are sent via the most common and convenient means, namely through HTTP GET or POST-request with JSON response format.
API functions
Before you send any request, it is necessary to obtain authentication SessionToken. It can be valid indefinitely or for 24 hrs.
Develop your applications so that no customer can obtain your SessionToken. It should be known only to the server part of your application and never to the customer one.
SessionToken is valid until its expiration time provided that neither username or password is modified. Otherwise all previous SessionTokens get deactivated.
URL: https://ruvds.com/api/logon/
Query Parameters:
username – your login or email
password – your account password
endless – enter 1 to get an indefinite token or 0 to get a 24 hrs token
Request Example:
https://ruvds.com/api/logon/?key=KEY&username=LOGIN&password=PASSWORD&endless=0
Response Example:
{
"rejectReason": 0,
"sessionToken": "af85eb943daeb116eb351ec4b9b45983facfa97e37776c3a03538194245dc853",
"expire": "19032016164537"
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
sessionToken – your authentication token
expire – token expiration UTC date and time (ddMMyyyyHHmmss format). If NULL , the token is indefinite
Error Codes:
0 – request successfully completed
1 – login/email not provided
2 – password not provided
3 – incorrect login+password combination
5 – internal system error
6 – API key not provided
7 – incorrect API key
8 – you’ve exceeded the number of authentication attempts
13 – client's account prohibits authentication with third-party API keys
The function allows you to get available balance information and details about amounts added and paid on the website.
URL: https://ruvds.com/api/balance/
Query Parameters:
sessionToken – token received after authentication
details – enter 1 for information about amounts added and paid or 0 to see your current balance
Request Example:
https://ruvds.com/api/balance/?sessionToken=YOURTOKEN&details=0
Response Example:
{
"rejectReason": 0,
"amount": 50,
"currency": 1,
"details":
{
"income": 350,
"debited": 300,
"items":
[
{
"type": 2,
"dt": "12012016133846",
"amount": 300,
"currency": 1,
"description": "Pay for server RU36118 (from 07.02.2016 to 07.03.2016)",
},
{
"type": 1,
"dt": "12022016164537",
"amount": 350,
"currency": 1,
"description": "Pay by Visa/MasterCard card",
}
]
}
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
amount – available balance
currency – balance currency (1 - RUB, 2 - UAH, 3 - USD, 4 - EUR)
details – detailed information, if requested:
income – total amount added
debited – total amount paid
items – amount added/paid information:
type – 1 amount added, 2 amount paid
dt – operation date and time (UTC, ddMMyyyyHHmmss format)
amount – total
currency – operation currency
description – text description
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – authentication token not specified
100 – internal system error
This request returns a list of data centers and information about currently available services, tariffs, and tariffs combinations for each of them.
Creating servers with test period via API is not available right now.
URL: https://ruvds.com/api/datacenter/
Query Parameters:
sessionToken – token received after authentication
language – language identifier for localizing datacenter name (1 - Russian, 5 - English, 6 - German), if empty or not specified default language for uset that make request will be selected.
Request Example:
https://ruvds.com/api/datacenter/?sessionToken=YOURTOKEN&language=
Response Example:
{
"rejectReason": 0,
"datacenters": [
{
"id": 1,
"name": "Rucloud: Россия, Королёв",
"tariffs": {
"14": {
"id": 14,
"drives": {
"1": {
"usage": [1, 2],
"trial": 2
},
"3": {
"usage": [1, 2],
"trial": 2
}
},
"vram": false,
"ddos": {
"price": 400
}
},
"15": {
"id": 15,
"drives": {
"1": {
"usage": [1, 2],
"trial": 2
},
"3": {
"usage": [1, 2],
"trial": 2
}
},
"vram": false,
"ddos": {
"price": 400
}
},
"21": {
"id": 21,
"drives": {
"1": {
"usage": [1],
"trial": 2
},
"4": {
"usage": [1],
"trial": 2
}
},
"vram": false,
"ddos": {
"price": 400
}
}
},
"driveTariffCombinations": [
[1], [1, 3], [3], [4, 1]
],
"trial": {
"price": 2000,
"cpu": 4,
"ip": 2
}
}
]
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
datacenters – List of datacenters
id – datacenter ID
name – datacenter name
tariffs – tariffs available for creation in current data center
drives – drive tariffs available for creation with current tariff
usage – payment type (1 - payment for selected period, 2 - payment for resources) that available for current tariff and drive tariff combination
trial – Files.API.FldDatacentersTrial
vram – Files.API.FldDatacentersVRAM
ddos – field contains an object with DDoS parameters for this tariff, if protection is available, which contains a price (RUB) field - price in rubles at 0.5 Gbit/s, if DDoS protection is not available, the field is null
driveTariffCombinations – a list of drive tariff combinations that can be used to create a server (for example, [[1], [1, 3]] - you can create a server with several drives of type 1 or with several drives of type 1 or 3, but you cannot create a server with type 3 drives only)
trial – an object containing test period parameters
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – authentication token not specified
100 – internal system error
The function returns the parameters of the tariff plans for the configuration of virtual servers and virtual disks.
By default, the function returns a list of current price plans only, but should you require an outdated price plan, you can also request it by ID.
URL: https://ruvds.com/api/tariff/
Query Parameters:
sessionToken – token received after authentication
tariffIds – required price plans IDs, separated by commas
driveTariffIds – required price plans IDs, separated by commas
Request Example:
https://ruvds.com/api/tariff/?sessionToken=YOURTOKEN&tariffIds=&driveTariffIds=
Response Example:
{
"rejectReason": 0,
"tariffs": {
"Defaults": {
"PerMonth": {
"Config": "Regular",
"Drive": "HDD"
}
},
"PerMonth": {
"Config": {
"Regular": {
"Name": "Regular",
"CPU": 79,
"RAM": 177,
"VRAM": 1.953125,
"IP": 100,
"Id": 14,
"IsActive": true
},
"Premium": {
"Name": "Premium",
"CPU": 198,
"RAM": 177,
"VRAM": 1.953125,
"IP": 100,
"Id": 15,
"IsActive": true
},
"HugeServer": {
"Name": "HugeServer",
"CPU": 79,
"RAM": 177,
"VRAM": 1.953125,
"IP": 100,
"Id": 21,
"IsActive": true
}
},
"Drive": {
"HDD": {
"Id": 1,
"Name": "HDD",
"Type": 1,
"Price": 5.5,
"IsActive": true
},
"SSD": {
"Id": 3,
"Name": "SSD",
"Type": 3,
"Price": 15,
"IsActive": true
},
"Huge HDD": {
"Id": 4,
"Name": "Huge HDD",
"Type": 1,
"Price": 0.48828125,
"IsActive": true
}
},
"ById": {
"Config": null,
"Drive": null
}
}
}
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
tariffs – the object that contains information about currently actual tariff plans and tariff plans specified in the request
Defaults – the object containing names of the default tariff plans
PerMonth – the object contains information about tariff plans, which are used when payment for the selected period variant is choosed
Config – the object contains information about tariff plans (for virtual server parameters) currently active represented as "tariff plan name" -> "tariff plan parameters"
Id – identifier of tariff plan for virtual server parameters
Name – name of tariff plan for virtual server parameters
CPU – price of one CPU core (RUB)
RAM – 1 GB RAM price (RUB)
VRAM – 1 MB VRAM price (RUB)
IP – price 1 of extra IP address (RUB). 1 IP per server is free
IsActive – price plan active, yes/no
Drive – the object contains information about tariff plans (for virtual drive parameters) currently active represented as "tariff plan name" -> "tariff plan parameters"
Id – identifier of tariff plan for virtual drive parameters
Name – name of tariff plan for virtual drive parameters
Type – virtual disk type (1 - HDD, 3 - SSD)
Price – cost of 1 GB of virtual disk (RUB)
IsActive – price plan active, yes/no
ById – The object contains information about tariff plans that are used when choosing a payment service provider for a selected period, the identifiers of which the user specified in the tariffIds and driveTariffIds request parameters
Config – the object contains information about tariff plans (for virtual server parameters) the identifiers of which the user specified in the tariffIds request parameter represented as "identifier of tariff plan" -> "tariff plan parameters"
Drive – the object contains information about tariff plans (for virtual drive parameters) the identifiers of which the user specified in the driveTariffIds request parameter represented as "identifier of tariff plan" -> "tariff plan parameters"
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – authentication token not specified
100 – internal system error
The function returns the list of an operating systems available for installation to virtual server.
URL: https://ruvds.com/api/os/
Query Parameters:
sessionToken – token received after authentication
Request Example:
https://ruvds.com/api/os/?sessionToken=YOURTOKEN
Response Example:
{
"rejectReason": 0,
"os": [
{
"Id": 15,
"Name": "Windows Server 2019 (RUS)"
},
{
"Id": 16,
"Name": "Windows Server 2019 (ENG)"
},
{
"Id": 13,
"Name": "Windows Server 2016 (RUS)"
},
{
"Id": 14,
"Name": "Windows Server 2016 (ENG)"
},
{
"Id": 1,
"Name": "Windows Server 2012 R2 (RUS)"
},
{
"Id": 2,
"Name": "Windows Server 2012 R2 (ENG)"
},
{
"Id": 5,
"Name": "Windows Server 2003 R2 SP2 (RUS)"
},
{
"Id": 6,
"Name": "Windows Server 2003 R2 SP2 (ENG)"
},
{
"Id": 17,
"Name": "Debian 9.6 (ENG)"
},
{
"Id": 8,
"Name": "Debian 8.5 (ENG)"
},
{
"Id": 19,
"Name": "CentOS 7.6.1810 (ENG)"
},
{
"Id": 10,
"Name": "CentOS 7.2.1511 (ENG)"
},
{
"Id": 18,
"Name": "Ubuntu 18.04 LTS (ENG)"
},
{
"Id": 12,
"Name": "Ubuntu 16.04 LTS (ENG)"
}
]
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
os – List of objects containing options available for installation of operating systems
Id – Operating system id
Name – Name of the operating system
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – authentication token not specified
100 – internal system error
Functions for users management are no longer available Access to customer accounts via API is turned off by default. It is available only for legal entities provided they signed a partner Contract. For more detailed information, please contact the support team.
API functions
URL: https://ruvds.com/api/user/get/
Query Parameters:
sessionToken – token received after authentication
id – required users IDs, separated by commas, or me value
Request Example:
https://ruvds.com/api/user/get/?sessionToken=YOURTOKEN&id=me
Response Example:
{
"rejectReason": 0,
"result":
[
{
"id": 00000000-1111-2222-3333-444444444444,
"firstName": "Ivan",
"lastName": "Ivanov",
"patronymic": "Ivanovich",
"engName": "Ivan Ivanovich",
"gender": 1,
"birthDate": "29061975",
"country": {"name":"Russia","phoneCode":7 },
"city":
{
"name": "Moscow",
"country": {"name":"Russia","phoneCode":7 },
"lat": 55.751667,
"lng": 37.617778,
},
"postcode": null,
"address": "Street, building and apartment/office",
"phone": "9031112233",
"phoneVerified": true,
"email": "user@mail.com",
"emailVerified": true,
"balance": 0,
"currency": 1,
"org": null,
}
]
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
result – user list array
id – Files.API.FldUsrInfId
firstName – first name
lastName – last name
patronymic – patronymic
engName – full name (in English)
gender – sex: 1 - male; 2 - female
birthDate – date of birth, ddMMyyyy format
country – country
city – city/country
postcode – postal code
address – address/location
phone – phone number (no 8 prefix or country code)
phoneVerified – phone number verified, yes/no
email – email
emailVerified – email verified, yes/no
balance – user balance
currency – user balance currency: 1 - RUB; 2 - UAH; 3 - USD; 4 - EUR
org – user legal entity info
Error Codes:
0 – request successfully completed
3 – invalid authentication token or no access to user administration
6 – invalid query
1000 – internal system error
URL: https://ruvds.com/api/user/create/ and https://ruvds.com/api/user/update/, respectively
Query Parameters:
sessionToken – token received after authentication
id – RuVDS system user ID
email – email (unique and used as login)
password – user password (only if new is created)
phone – phone number (no 8 prefix or country code)
firstName – first name
lastName – last name
patronymic – patronymic
gender – sex: 1 - male; 2 - female
birthDate – date of birth, dd.MM.yyyy format
country – country (Russia by default, if field is left empty)
city – city/country
postcode – postal code
address – address/location
Request Example:
https://ruvds.com/api/user/create/?sessionToken=YOURTOKEN&id= &email=test@mail.com&password=P@ssword&phone=9031112233&firstName=Ivan &lastName=Ivanov&patronymic=Ivanovich&gender=1&birthDate=29.06.1975 &country=Russia&city=Moscow&postcode=123456 &address=Street, building and apartment/office
Response Example:
{
"rejectReason": 0,
"result":null
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
result – user object (not NULL if successful)
Error Codes:
0 – request successfully completed
3 – invalid authentication token or no access to user administration
4 – password field empty (when creating)
5 – password too easy or too short
6 – invalid query
7 – user not found or you do not have editing rights
21 – email field empty
22 – incorrect email format
23 – email already registered for another account
32 – Incorrect phone number format/phone number incomplete
1000 – internal system error
URL: https://ruvds.com/api/user/change_password/
Query Parameters:
sessionToken – token received after authentication
id – RuVDS system user ID
password – new user password
Request Example:
https://ruvds.com/api/user/change_password/?sessionToken=YOURTOKEN &id=00000000-1111-2222-3333-444444444444&password=NewP@assword
Response Example:
{
"rejectReason": 0,
"result":null
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
result – user object (not NULL if successful)
Error Codes:
0 – request successfully completed
3 – invalid authentication token or no access to user administration
4 – password field empty
5 – password too easy or too short
6 – invalid query
7 – user not found or you do not have editing rights
1000 – internal system error
URL: https://ruvds.com/api/user/remove/
Query Parameters:
sessionToken – token received after authentication
id – RuVDS system user ID
Request Example:
https://ruvds.com/api/user/remove/?sessionToken=YOURTOKEN &id=00000000-1111-2222-3333-444444444444
Response Example:
{
"rejectReason": 0,
"result":null
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
result – user object (not NULL if successful)
Error Codes:
0 – request successfully completed
3 – invalid authentication token or no access to user administration
6 – invalid query
7 – user not found or you do not have editing rights
40 – user has servers on his/her account
1000 – internal system error
API functions
By default, the function returns information about all of your servers. If you want to get information only about certain servers, you can add their IDs (strongly recommended).
URL: https://ruvds.com/api/servers/
Query Parameters:
sessionToken – token received after authentication
userId – user ID required to get servers (if available)
fields – A list of property names, separated by commas (,) or semicolons (;), of the item object, the value of which is need to be obtained; if the parameter is not specified or the list is empty, all available fileds are displayed
id – requested servers IDs, separated by commas
Request Example:
https://ruvds.com/api/servers/?sessionToken=YOURTOKEN&id=
Response Example:
{
"rejectReason": 0,
"items":
[
{
"id": 38420,
"cpu": 2,
"ram": 2,
"vram": 64,
"drive": [ {"type":1,"capacity":60 } ],
"ip":
{
"count": 1,
"assigned": [ "192.168.111.222" ],
},
"premium": false,
"tariff":
{
"premium": false,
"id": 4,
"cpu": 60,
"ram": 140,
"vram": 1.953125,
"drive": {"hdd":5,"ssd":20 },
"ip": 100,
"active": true
},
"priceRub": 693,
"additionalServices":
[
{
"count": 1,
"name": "DDoS protection",
"price": 400,
"applyDiscount": true,
"monthIsMin": true
}
],
"paymentPeriod": 3,
"discount":
{
"paymentPeriod": 0.05,
"promocode": 0.1
},
"state": 100,
"addDT": "07022016092512",
"createDT": "07022016092850",
"createProgress": 100,
"createState": 100,
"defaultAdminPassword": "eCvpQmXh",
"configurationUpdating": false,
"limitedTrafficMbps": null,
"running": true,
"paid": true,
"paidTill": "07042016092850",
"stat":
{
"traffic": {"value":21,"limit":153600,"state":1 },
"trafficOutbound": {"value":5,"limit":null,"state":1 },
"trafficInbound": {"value":16,"limit":null,"state":1 },
"driveRead": 938,
"driveWritten": 263,
"avgIOPS": 5,
"avgCPU": 0
},
"notifications":
[
{
"id": 3829,
"type": 3,
"blocked": true,
"message": "<div style="margin-bottom:6px;">High incoming junk traffic detected: <b>83 Gb</b></div><div style="margin-bottom:6px;">It can lead to…",
"dt": "19022016175602"
}
],
"configurationChangeable": true,
"canRecreate": true
}
]
}
Response Example:
rejectReason – numeric value (error code)
errMessage – error description, if occured
items – server array
id – server RuVDS system ID (assigns name RUXXXX to server)
cpu – CPU cores number
ram – total RAM, GB
vram – graphics memory, MB
drive – hard drives installed,their type (1 - HDD, 3 - SSD) and capacity, GB
ip – server IP addresses info
count – number of IP addresses requested
assigned – assigned IP addresses structure
premium – premium server, yes/no
tariff – price plan info
premium – premium price plan, yes/no
id – RuVDS system price plan ID
cpu – price of one CPU core (RUB)
ram – 1 GB RAM price (RUB)
vram – 1 MB VRAM price (RUB)
drive – 1 GB of disk space price (RUB) and options available (HDD, SSD)
ip – price 1 of extra IP address (RUB). 1 IP per server is free
active – price plan active, yes/no
priceRub – the full cost of the server, including additional services, for the payment period, including promo code and payment period discounts
additionalServices – additional services activated for this server
count – amount activated
name – service name
price – service price per month, without discounts
applyDiscount – service discounts available, yes/no
monthIsMin – if TRUE, min billing period is one month and no refund is available with early termination
paymentPeriod – 1 - trial period; 2 - 1 month; 3 - 3 months; 4 - 6 months; 5 - 1 year
discount – server discounts, NULL if none are available
paymentPeriod – discount for selected payment period, %
promocode – promo code discount, %
state – 1 - new; 2 - configured; 3 - contact details not confirmed; 4 - no resources available; 5 - not paid; 6 - blocked for violation; 100 - ready
addDT – date and time added (UTC, ddMMyyyyHHmmss format)
createDT – creation completion date and time (UTC, ddMMyyyyHHmmss format), NULL if not created
createProgress – server creation status (from 0 to 100)
createState – 1 – waiting; 2 - started; 3 - copying files; 4 - system launch; 5 - configuration; 6 - reboot; 100 - completed
defaultAdminPassword – default password for Administrator
configurationUpdating – server reconfiguration ongoing, yes/no
limitedTrafficMbps – traffic limit set (Mbps)
running – server running, yes/no
paid – server paid, yes/no
paidTill – server paid until (UTC, ddMMyyyyHHmmss format)
stat – basic info on resource usage; state: 1 – optimal load; 2 - load close to limit; 3 - load limit exceeded
traffic – total traffic, 24 hrs, MB
trafficOutbound – outgoing traffic, 24 hrs, MB
trafficInbound – incoming traffic, 24 hrs, MB
driveRead – disk data read, 24 hrs, MB
driveWritten – disk data written, 24 hrs, MB
avgIOPS – average disk load, 24 hrs, IOPS
avgCPU – average CPU load, 24 hrs, (from 0 to 100)
notifications – server notifications
id – notification system ID
type – 1 - info; 2 - warning; 3 - violation
blocked – notification led to blocking, yes/no
message – notification HTML text
dt – notification date and time (UTC, ddMMyyyyHHmmss format)
configurationChangeable – reconfiguration possible, yes/no
canRecreate – server recreation from scratch available, yes/no
userComment – user comment
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – authentication token not specified
100 – internal system error
The function allows you to retrieve data for load charts, similar to those displayed on your account page.
Request is only possible for one server at a time.
URL: https://ruvds.com/api/server/stat/
Query Parameters:
sessionToken – token received after authentication
id – ID of server you want to get stats for
Request Example:
https://ruvds.com/api/server/stat/?sessionToken=YOURTOKEN&id=38420
Response Example:
{
"rejectReason": 0,
"id": 38420,
"cpu":
[
{
"date": "19022016",
"avgLoad": 0
},
{
"date": "20022016",
"avgLoad": 1
}
],
"drive":
[
{
"date": "19022016",
"read": 52,
"write": 5,
"avgIOPS": 1
},
{
"date": "20022016",
"read": 52,
"write": 6,
"avgIOPS": 1
}
],
"traffic":
[
{
"date": "19022016",
"inbound": 0,
"outbound": 0
},
{
"date": "20022016",
"inbound": 8,
"outbound": 1
}
]
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
id – ID of server you requested stats for
cpu – daily CPU load info
date – day (UTC, ddMMyyyy format)
avgLoad – average total CPU load (from 0 to 100)
drive – daily disk load info
date – day (UTC, ddMMyyyy format)
read – total data read, MB
write – total data written, MB
avgIOPS – average disk load, IOPS
traffic – daily traffic info
date – day (UTC, ddMMyyyy format)
inbound – incoming traffic, MB
outbound – outgoing traffic, MB
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – authentication token not specified
4 – virtual server not found by ID
100 – internal system error
The function allows you to receive up-to-date server screenshots. Available width: from 64 to 640, height: from 48 to 480.
As the results are cached, you should not request the image more than once per 10 seconds.
URL: https://ruvds.com/api/server/image/
Query Parameters:
sessionToken – token received after authentication
id – ID of server you want to screenshot
width – image width
height – image height
Request Example:
https://ruvds.com/api/server/image/?sessionToken=YOURTOKEN&id=38420 &width=340&height=240
Response Example:
{
"rejectReason": 0,
"id": 38420,
"state": 100,
"running": true,
"imageBase64": "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAg..."
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
id – ID of server you requested screenshot for
state – 1 - new; 2 - configured; 3 - contact details not confirmed; 4 - no resources available; 5 - not paid; 6 - blocked for violation; 100 - ready
running – server running, yes/no
imageBase64 – image byte array in Base64 format
If state field value is not equal to 100 or running field value is not equal to true, then field imageBase64 will see the return of NULL.
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – authentication token not specified
4 – virtual server not found by ID
100 – internal system error
As system copying and configuring creates a major workload for drive system, please create SSD-based servers when debugging. But even with SSD, please keep the number of requests to a minimum.
If you create and then delete more than 10 servers in 24 hrs, you may be temporarily barred from creating new servers.
URL: https://ruvds.com/api/server/create/
Query Parameters:
sessionToken – token received after authentication
userId – ID of user you want to create server for (if available)
datacenter – datacenter identifier (see Getting Started > Dataсenters)
tariff – tariff plan identifier (see Getting Started> Tariff Plans)
os – operating system identifier (see Getting Started > Operating Systems) [optional filed]
cpu – CPU cores number
ram – total RAM, GB
vram – graphics memory, MB (available values: 0, 64, 128, 256, 512, 1024)
drivesCount – number of virtual server drives
driveXTariff – tariff plan identifier (see Getting Started> Tariff Plans), where X - [0..drivesCount-1]
driveXСapacity – disk capacity in GB, where X - [0..drivesCount-1]
driveXSystem – a flag that indicates that an operating system will be installed on this disk (if several are specified, the latter will be selected as the system one), where X - [0..drivesCount-1]
ip – number of IP addresses required
ddosProtection – if server DDoS protection is required, then specify bandwidth for legitimate incoming traffic, divisible by 0.5 Mbps
template – operating system installation template ID (if available)
paymentPeriod – 2 - 1 month; 3 - 3 months; 4 - 6 months; 5 - 1 year
promocode – promo code for fixed discount
promo – promo configuration identifier; not recommended to use, can be changed without notice; send a request to the technical support service to clarify current promo list; promotional configuration can prohibit any promotional codes using, including PROMO-API
computerName – computer name for virtual server created. If not specified, default name WIN-XXXXXXX is assigned
userComment – user comment
Request Example:
https://ruvds.com/api/server/create/?sessionToken=YOURTOKEN&datacenter=1&tariff=14&os=15&cpu=2 &ram=4&vram=0&drivesCount=1&drive0Tariff=1&drive0Capacity=40&drive0System=true&ip=1 &ddosProtection=0&paymentPeriod=2&promocode=PROMO-API&computerName=CustomVDS
Response Example:
{
"rejectReason": 0,
"id": 38420,
"cost": 279
}
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
id – new server ID
cost – server price for selected period with all discounts applied (RUB)
After receiving a successful response from the system, creation of a virtual server is started. It can be monitored by requesting server info as described above in My Servers.
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – incorrect number of CPU cores
3 – incorrect RAM data
4 – incorrect hard disk capacity
5 – incorrect number of IP addresses
6 – user or promo code not found
7 – cannot detect current price plan (internal system error)
8 – an error occured while saving data (internal system error)
10 – server creation is not available for your account
13 – cannot create new server
17 – no resources available for the desired configuration
19 – insufficient funds
31 – authentication token not specified
33 – invalid characters in the computer name
39 – incorrect graphics memory
100 – internal system error
Reconfiguration is asynchronous. After a successful response from the system, the configuration can still remain unchanged and would not be changed if errors occur.
On receiving a successful response, you can track server status and its configuration through configurationUpdating field, as described above in My Servers. If configurationUpdating field value becomes false and configuration is still unchanged, then an error has occurred.
URL: https://ruvds.com/api/server/update/configuration/
Query Parameters:
sessionToken – token received after authentication
id – ID of server you want to make changes to
cpu – CPU cores number
ram – total RAM, GB
vram – graphics memory, MB (available values: 0, 64, 128, 256, 512, 1024)
drive – disk capacity, GB
ip – number of IP addresses required
ddosProtection – if server DDoS protection is required, then specify bandwidth for legitimate incoming traffic, divisible by 0.5 Mbps
Request Example:
https://ruvds.com/api/server/update/configuration/?sessionToken=YOURTOKEN&id=38420 &cpu=2&ram=2&vram=128&drive=40&ip=2&ddosProtection=0.5
Response Example:
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – incorrect number of CPU cores
3 – incorrect RAM data
4 – incorrect hard disk capacity
5 – incorrect number of IP addresses
6 – virtual server not found by ID
10 – Server reconfiguration prohibited on this account
13 – server inactive
14 – reconfiguration ongoing
15 – current billing period will expire in less than 30 minutes, reconfiguration is not possible
16 – current billing period has expired
17 – no resources available for the desired configuration
19 – insufficient funds
20 – you’ve reached the daily limit of reconfigurations for this server
21 – you’ve reached the monthly limit of reconfigurations for this server
26 – reconfiguration is not available for this server
31 – authentication token not specified
39 – incorrect graphics memory
100 – internal system error
As with changing billing period through user account, execution of this function does not entail withdrawal of funds. The server will be prolonged for the new period only when current billing period ends.
URL: https://ruvds.com/api/server/update/payment_period/
Query Parameters:
sessionToken – token received after authentication
id – ID of server you want to make changes to
paymentPeriod – 2 - 1 month; 3 - 3 months; 4 - 6 months; 5 - 1 year
Request Example:
https://ruvds.com/api/server/update/payment_period/?sessionToken=YOURTOKEN&id=38420 &paymentPeriod=2
Response Example:
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – authentication token not specified
4 – virtual server not found by ID
8 – reconfiguration ongoing
100 – internal system error
This function includes a variety of simple tasks, including switching on/off, reboot, shutdown, generating new administrator password, server recreation (system reset), removal.
All functions except virtual server recreation run in real time and are guaranteed to have completed successfully provided you receive an error-free message.
URL: https://ruvds.com/api/server/command/
Query Parameters:
sessionToken – token received after authentication
id – ID of server you want to make changes to
type – type of command:
start – start server
stop – server shutdown (emergency)
shutdown – shutdown
reset – reboot (emergency)
new_password – set new password for Administrator
recreate – recreate virtual server
remove – delete server
Request Example:
https://ruvds.com/api/server/command/?sessionToken=YOURTOKEN&id=38420&&type=start
Response Example:
Response Fields:
rejectReason – numeric value (error code)
errMessage – error description, if occured
Error Codes:
0 – request successfully completed
1 – invalid authentication token
2 – authentication token not specified
4 – virtual server not found by ID or incorrect command
6 – server has not been created yet or is blocked
7 – launch the server to execute the command
8 – reconfiguration ongoing
10 – current billing period will expire in less than 30 minutes, reconfiguration is not possible
11 – current billing period has expired
12 – reconfiguration is not available for this server
13 – you’ve reached the daily limit of reconfigurations for this server
14 – you’ve reached the monthly limit of reconfigurations for this server
100 – internal system error
| |