vps
Manage VPS
Boot
Input parameters
| Parameter | Type | Required | Details |
|---|---|---|---|
os_templateOS template |
Resource | no | |
mount_root_datasetRootfs mountpoint |
String | no |
Default: |
Output parameters
No parameters.
Clone
Input parameters
| Parameter | Type | Required | Details | ||||
|---|---|---|---|---|---|---|---|
environmentEnvironment |
Resource | no |
Clone to environment |
||||
locationLocation |
Resource | no |
Clone to location |
||||
nodeNode |
Resource | no |
Clone to node |
||||
userUser |
Resource | no |
The owner of the cloned VPS |
||||
address_locationAddress location |
Resource | no |
Location to select IP addresses from |
||||
platformPlatform |
String | no |
Default:
|
||||
dataset_plansDataset plans |
Boolean | no |
Default: |
||||
resourcesResources |
Boolean | no |
Clone resources such as memory and CPU Default: |
||||
featuresFeatures |
Boolean | no |
Default: |
||||
hostnameHostname |
String | no |
Default:
|
||||
stopShutdown |
Boolean | no |
Do a consistent clone - original VPS is shut down before making a snapshot Default: |
||||
keep_snapshotsKeep snapshots |
Boolean | no |
Keep snapshots created during the cloning process Default: |
Output parameters
| Parameter | Type | Description |
|---|---|---|
idVPS id |
Integer | |
userUser |
Resource | VPS owner |
hostnameHostname |
String | VPS hostname |
manage_hostnameManage hostname |
Boolean | Determines whether vpsAdmin sets VPS hostname or not |
os_templateOS template |
Resource | |
cgroup_versionCgroup_version |
String | |
map_modeMap mode |
String | |
infoInfo |
String | VPS description |
dns_resolverDNS resolver |
Resource | DNS resolver the VPS will use |
nodeNode |
Resource | Node VPS will run on |
user_namespace_mapUID/GID mapping |
Resource | |
autostart_enableAuto-start |
Boolean | Start VPS on node boot? |
autostart_priorityAuto-start priority |
Integer | 0 is the highest priority, greater numbers have lower priority |
onstartallOn start all |
Boolean | Start VPS on start all action? |
configConfig |
String | Custom configuration options |
cpu_limitCPU limit |
Integer | Limit of maximum CPU usage |
start_menu_timeoutStart menu timeout |
Integer | Number of seconds the start menu waits for the user |
allow_admin_modificationsAllow admin modifications |
Boolean | |
enable_os_template_auto_updateEnable OS template auto update |
Boolean | |
enable_networkEnable network |
Boolean | |
datasetDataset |
Resource | Dataset the VPS resides in |
poolPool |
Resource | Storage pool the VPS resides in |
created_atCreated at |
Datetime | |
implicit_oom_report_rule_hit_countImplicit_oom_report_rule_hit_count |
Integer | |
cpuCPU |
Integer | Minimally 1, maximally 1024, step size is 1 |
diskspaceDisk space |
Integer | Minimally 1024, maximally 1048576, step size is 1 |
memoryMemory |
Integer | Minimally 128, maximally 1048576, step size is 1 |
swapSwap |
Integer | Minimally 0, maximally 1048576, step size is 1 |
is_runningRunning |
Boolean | |
in_rescue_modeIn rescue mode |
Boolean | |
uptimeUptime |
Integer | |
loadavg1Loadavg1 |
Float | |
loadavg5Loadavg5 |
Float | |
loadavg15Loadavg15 |
Float | |
process_countProcess count |
Integer | |
cpu_userCpu_user |
Float | |
cpu_niceCpu_nice |
Float | |
cpu_systemCpu_system |
Float | |
cpu_idleCpu_idle |
Float | |
cpu_iowaitCpu_iowait |
Float | |
cpu_irqCpu_irq |
Float | |
cpu_softirqCpu_softirq |
Float | |
used_memoryUsed memory |
Integer | in MB |
used_swapUsed swap |
Integer | in MB |
used_diskspaceUsed disk space |
Integer | in MB |
Create
Input parameters
| Parameter | Type | Required | Details | ||||||
|---|---|---|---|---|---|---|---|---|---|
environmentEnvironment |
Resource | no |
Environment in which to create the VPS, for non-admins |
||||||
locationLocation |
Resource | no |
Location in which to create the VPS, for non-admins |
||||||
address_locationAddress location |
Resource | no |
Location to select IP addresses from |
||||||
userUser |
Resource | no |
VPS owner |
||||||
hostnameHostname |
String | yes |
VPS hostname Default:
|
||||||
os_templateOS template |
Resource | no | |||||||
cgroup_versionCgroup_version |
String | no |
Default:
|
||||||
map_modeMap mode |
String | no |
Default:
|
||||||
infoInfo |
String | no |
VPS description Default: |
||||||
dns_resolverDNS resolver |
Resource | no |
DNS resolver the VPS will use |
||||||
nodeNode |
Resource | no |
Node VPS will run on |
||||||
user_namespace_mapUID/GID mapping |
Resource | no | |||||||
autostart_enableAuto-start |
Boolean | no |
Start VPS on node boot? Default: |
||||||
autostart_priorityAuto-start priority |
Integer | no |
0 is the highest priority, greater numbers have lower priority Default:
|
||||||
onstartallOn start all |
Boolean | no |
Start VPS on start all action? Default: |
||||||
configConfig |
String | no |
Custom configuration options Default: |
||||||
cpu_limitCPU limit |
Integer | no |
Limit of maximum CPU usage Default:
|
||||||
start_menu_timeoutStart menu timeout |
Integer | no |
Number of seconds the start menu waits for the user Default:
|
||||||
allow_admin_modificationsAllow admin modifications |
Boolean | no |
Default: |
||||||
enable_os_template_auto_updateEnable OS template auto update |
Boolean | no |
Default: |
||||||
enable_networkEnable network |
Boolean | no |
Default: |
||||||
cpuCPU |
Integer | no |
Minimally 1, maximally 1024, step size is 1 Default: |
||||||
diskspaceDisk space |
Integer | no |
Minimally 1024, maximally 1048576, step size is 1 Default: |
||||||
memoryMemory |
Integer | no |
Minimally 128, maximally 1048576, step size is 1 Default: |
||||||
swapSwap |
Integer | no |
Minimally 0, maximally 1048576, step size is 1 Default: |
||||||
ipv4IPv4 |
Integer | no |
Default: |
||||||
ipv6IPv6 |
Integer | no |
Default: |
||||||
ipv4_privatePrivate IPv4 |
Integer | no |
Default: |
||||||
startStart VPS |
Boolean | no |
Start thew new VPS Default: |
||||||
vps_user_dataUser data |
Resource | no | |||||||
user_data_formatUser data format |
String | no |
Default:
|
||||||
user_data_contentUser data content |
Text | no |
Default: |
Output parameters
| Parameter | Type | Description |
|---|---|---|
idVPS id |
Integer | |
userUser |
Resource | VPS owner |
hostnameHostname |
String | VPS hostname |
manage_hostnameManage hostname |
Boolean | Determines whether vpsAdmin sets VPS hostname or not |
os_templateOS template |
Resource | |
cgroup_versionCgroup_version |
String | |
map_modeMap mode |
String | |
infoInfo |
String | VPS description |
dns_resolverDNS resolver |
Resource | DNS resolver the VPS will use |
nodeNode |
Resource | Node VPS will run on |
user_namespace_mapUID/GID mapping |
Resource | |
autostart_enableAuto-start |
Boolean | Start VPS on node boot? |
autostart_priorityAuto-start priority |
Integer | 0 is the highest priority, greater numbers have lower priority |
onstartallOn start all |
Boolean | Start VPS on start all action? |
configConfig |
String | Custom configuration options |
cpu_limitCPU limit |
Integer | Limit of maximum CPU usage |
start_menu_timeoutStart menu timeout |
Integer | Number of seconds the start menu waits for the user |
allow_admin_modificationsAllow admin modifications |
Boolean | |
enable_os_template_auto_updateEnable OS template auto update |
Boolean | |
enable_networkEnable network |
Boolean | |
datasetDataset |
Resource | Dataset the VPS resides in |
poolPool |
Resource | Storage pool the VPS resides in |
created_atCreated at |
Datetime | |
implicit_oom_report_rule_hit_countImplicit_oom_report_rule_hit_count |
Integer | |
cpuCPU |
Integer | Minimally 1, maximally 1024, step size is 1 |
diskspaceDisk space |
Integer | Minimally 1024, maximally 1048576, step size is 1 |
memoryMemory |
Integer | Minimally 128, maximally 1048576, step size is 1 |
swapSwap |
Integer | Minimally 0, maximally 1048576, step size is 1 |
is_runningRunning |
Boolean | |
in_rescue_modeIn rescue mode |
Boolean | |
uptimeUptime |
Integer | |
loadavg1Loadavg1 |
Float | |
loadavg5Loadavg5 |
Float | |
loadavg15Loadavg15 |
Float | |
process_countProcess count |
Integer | |
cpu_userCpu_user |
Float | |
cpu_niceCpu_nice |
Float | |
cpu_systemCpu_system |
Float | |
cpu_idleCpu_idle |
Float | |
cpu_iowaitCpu_iowait |
Float | |
cpu_irqCpu_irq |
Float | |
cpu_softirqCpu_softirq |
Float | |
used_memoryUsed memory |
Integer | in MB |
used_swapUsed swap |
Integer | in MB |
used_diskspaceUsed disk space |
Integer | in MB |
object_stateObject state |
String | |
expiration_dateExpiration |
Datetime | A date after which the state will progress |
remind_after_dateRemind after |
Datetime | Mail warnings are silenced until this date |
Examples
Examples use an initialized api client, authenticated when required. See initialization and authentication.
Create vps
Create VPS owned by user with ID 1, template ID 1 and DNS resolver ID 1. VPS will be created on node ID 1. Action returns ID of newly created VPS.
Ruby · Simple
reply = api.vps.create({user: 1,
hostname: "my-vps",
os_template: 1,
info: "",
dns_resolver: 1,
node: 1,
onstartall: true})
# reply is an instance of HaveAPI::Client::ResourceInstance
# reply.id = 150
Ruby · With error handling
begin
require 'haveapi/client'
api = HaveAPI::Client.new("https://api.vpsfree.cz/", version: "7.0")
api.setup
api.authenticate(:token, token: 'example-token')
reply = api.vps.create({user: 1,
hostname: "my-vps",
os_template: 1,
info: "",
dns_resolver: 1,
node: 1,
onstartall: true})
# reply is an instance of HaveAPI::Client::ResourceInstance
# reply.id = 150
rescue HaveAPI::Client::ValidationError => error
warn error.message
warn error.errors.inspect
rescue HaveAPI::Client::ActionFailed => error
warn error.message
warn error.response.errors.inspect if error.response.is_a?(HaveAPI::Client::Response)
rescue HaveAPI::Client::Authentication::AuthenticationFailed, HaveAPI::Client::ProtocolError,
RestClient::Exception, JSON::ParserError => error
warn error.message
end
JavaScript (callback) · Simple
const resource = CallbackClient.findResource(api, ["vps"]);
const action = CallbackClient.findAction(resource, "create");
action.directInvoke({
params: {["user"]: 1, ["hostname"]: "my-vps", ["os_template"]: 1, ["info"]: "", ["dns_resolver"]: 1, ["node"]: 1, ["onstartall"]: true},
onReply: (owner, reply) => {
if (!reply.isOk()) {
console.error(reply.message(), reply.envelope.errors);
return;
}
console.log(reply.response());
}
});
// This prints the initial response; use its action-state metadata to monitor completion.
JavaScript (callback) · With error handling
import { CallbackClient } from "haveapi-client";
const api = new CallbackClient("https://api.vpsfree.cz/", {version: "7.0"});
api.authenticate("token", {token: "example-token"}, (api, ready) => {
if (!ready) {
console.error("Discovery or authentication failed");
return;
}
try {
const resource = CallbackClient.findResource(api, ["vps"]);
const action = CallbackClient.findAction(resource, "create");
action.directInvoke({
params: {["user"]: 1, ["hostname"]: "my-vps", ["os_template"]: 1, ["info"]: "", ["dns_resolver"]: 1, ["node"]: 1, ["onstartall"]: true},
onReply: (owner, reply) => {
if (!reply.isOk()) {
console.error(reply.message(), reply.envelope.errors);
return;
}
console.log(reply.response());
console.log(reply.meta());
}
});
// This prints the initial response; use its action-state metadata to monitor completion.
} catch (error) {
console.error(error);
}
});
JavaScript (async) · Simple
const result = await api.resource("vps").action("create")({params: {["user"]: 1, ["hostname"]: "my-vps", ["os_template"]: 1, ["info"]: "", ["dns_resolver"]: 1, ["node"]: 1, ["onstartall"]: true}});
console.log(result.value);
// Request success alone does not establish operation completion.
const completed = await api.waitForCompletion(result, {timeoutMs: 300000});
console.log(completed.state);
JavaScript (async) · With error handling
import { AsyncClient, AsyncError } from "haveapi-client";
async function main() {
const api = new AsyncClient("https://api.vpsfree.cz/", {version: "7.0"});
try {
await api.authenticate("token", {token: "example-token"});
const result = await api.resource("vps").action("create")({params: {["user"]: 1, ["hostname"]: "my-vps", ["os_template"]: 1, ["info"]: "", ["dns_resolver"]: 1, ["node"]: 1, ["onstartall"]: true}});
console.log(result.value);
console.log(result.response.meta);
// Request success alone does not establish operation completion.
const completed = await api.waitForCompletion(result, {timeoutMs: 300000});
console.log(completed.state);
} catch (error) {
if (error instanceof AsyncError) {
console.error(error.kind, error.message, error.errors);
} else {
throw error;
}
}
}
main().catch(error => console.error(error));
TypeScript (callback) · Simple
const resource = CallbackClient.findResource(api, ["vps"]);
const action = CallbackClient.findAction(resource, "create");
action.directInvoke({
params: {["user"]: 1, ["hostname"]: "my-vps", ["os_template"]: 1, ["info"]: "", ["dns_resolver"]: 1, ["node"]: 1, ["onstartall"]: true},
onReply: (owner, reply) => {
if (!reply.isOk()) {
console.error(reply.message(), reply.envelope.errors);
return;
}
console.log(reply.response());
}
});
// This prints the initial response; use its action-state metadata to monitor completion.
TypeScript (callback) · With error handling
import { CallbackClient } from "haveapi-client";
const api = new CallbackClient("https://api.vpsfree.cz/", {version: "7.0"});
api.authenticate("token", {token: "example-token"}, (api, ready) => {
if (!ready) {
console.error("Discovery or authentication failed");
return;
}
try {
const resource = CallbackClient.findResource(api, ["vps"]);
const action = CallbackClient.findAction(resource, "create");
action.directInvoke({
params: {["user"]: 1, ["hostname"]: "my-vps", ["os_template"]: 1, ["info"]: "", ["dns_resolver"]: 1, ["node"]: 1, ["onstartall"]: true},
onReply: (owner, reply) => {
if (!reply.isOk()) {
console.error(reply.message(), reply.envelope.errors);
return;
}
console.log(reply.response());
console.log(reply.meta());
}
});
// This prints the initial response; use its action-state metadata to monitor completion.
} catch (error) {
console.error(error);
}
});
TypeScript (async) · Simple
const result = await api.resource("vps").action("create")({params: {["user"]: 1, ["hostname"]: "my-vps", ["os_template"]: 1, ["info"]: "", ["dns_resolver"]: 1, ["node"]: 1, ["onstartall"]: true}});
console.log(result.value);
// Request success alone does not establish operation completion.
const completed = await api.waitForCompletion(result, {timeoutMs: 300000});
console.log(completed.state);
TypeScript (async) · With error handling
import { AsyncClient, AsyncError } from "haveapi-client";
async function main(): Promise<void> {
const api = new AsyncClient("https://api.vpsfree.cz/", {version: "7.0"});
try {
await api.authenticate("token", {token: "example-token"});
const result = await api.resource("vps").action("create")({params: {["user"]: 1, ["hostname"]: "my-vps", ["os_template"]: 1, ["info"]: "", ["dns_resolver"]: 1, ["node"]: 1, ["onstartall"]: true}});
console.log(result.value);
console.log(result.response.meta);
// Request success alone does not establish operation completion.
const completed = await api.waitForCompletion(result, {timeoutMs: 300000});
console.log(completed.state);
} catch (error) {
if (error instanceof AsyncError) {
console.error(error.kind, error.message, error.errors);
} else {
throw error;
}
}
}
main().catch(error => console.error(error));
Python (sync) · Simple
response = api.resources["vps"].actions["create"].call(params={"user": 1, "hostname": "my-vps", "os_template": 1, "info": "", "dns_resolver": 1, "node": 1, "onstartall": True})
print(response.data)
# A request timeout does not cancel a server operation.
if response.operation is not None:
completed = response.operation.wait(timeout=300, interval=1)
print(completed)
Python (sync) · With error handling
from haveapi_client import Client, ActionError, HaveAPIError, TokenAuth
try:
with Client("https://api.vpsfree.cz/", version="7.0", auth=TokenAuth("example-token")) as api:
response = api.resources["vps"].actions["create"].call(params={"user": 1, "hostname": "my-vps", "os_template": 1, "info": "", "dns_resolver": 1, "node": 1, "onstartall": True})
print(response.data)
print(response.meta)
# A request timeout does not cancel a server operation.
if response.operation is not None:
completed = response.operation.wait(timeout=300, interval=1)
print(completed)
except ActionError as error:
print(error.message, error.errors)
except HaveAPIError as error:
print(error.message, error.status_code)
Python (async) · Simple
# Run inside an async function after initializing api.
response = await api.resources["vps"].actions["create"].call(params={"user": 1, "hostname": "my-vps", "os_template": 1, "info": "", "dns_resolver": 1, "node": 1, "onstartall": True})
print(response.data)
# A request timeout does not cancel a server operation.
if response.operation is not None:
completed = await response.operation.wait(timeout=300, interval=1)
print(completed)
Python (async) · With error handling
import asyncio
from haveapi_client import AsyncClient, ActionError, HaveAPIError, TokenAuth
async def main() -> None:
try:
async with AsyncClient("https://api.vpsfree.cz/", version="7.0", auth=TokenAuth("example-token")) as api:
response = await api.resources["vps"].actions["create"].call(params={"user": 1, "hostname": "my-vps", "os_template": 1, "info": "", "dns_resolver": 1, "node": 1, "onstartall": True})
print(response.data)
print(response.meta)
# A request timeout does not cancel a server operation.
if response.operation is not None:
completed = await response.operation.wait(timeout=300, interval=1)
print(completed)
except ActionError as error:
print(error.message, error.errors)
except HaveAPIError as error:
print(error.message, error.status_code)
asyncio.run(main())
Go API client · Simple
invocation := api.Vps.Create.Prepare()
input := invocation.NewInput().SelectParameters()
input.SetUser(1)
input.SetHostname("my-vps")
input.SetOsTemplate(1)
input.SetInfo("")
input.SetDnsResolver(1)
input.SetNode(1)
input.SetOnstartall(true)
response, err := invocation.Call()
if err != nil {
fmt.Println(err)
return
}
if !response.Status {
fmt.Println(response.Message, response.Errors)
return
}
if response.Output != nil {
fmt.Println(response.Output.Id)
}
// Request success does not establish operation completion.
Go API client · With error handling
// go get github.com/vpsfreecz/vpsadmin-go-client/client@latest
package main
import (
"fmt"
client "github.com/vpsfreecz/vpsadmin-go-client/client"
)
func main() {
api := client.New("https://api.vpsfree.cz")
invocation := api.Vps.Create.Prepare()
input := invocation.NewInput().SelectParameters()
input.SetUser(1)
input.SetHostname("my-vps")
input.SetOsTemplate(1)
input.SetInfo("")
input.SetDnsResolver(1)
input.SetNode(1)
input.SetOnstartall(true)
// To supply advertised global metadata, select only the fields you set:
// metadata := invocation.NewMetaInput().SelectParameters()
// metadata.SetIncludes(value) // value has type string
// metadata.SetNo(value) // value has type bool
response, err := invocation.Call()
if err != nil {
fmt.Println(err)
return
}
if !response.Status {
fmt.Println(response.Message, response.Errors)
return
}
if response.Output != nil {
fmt.Println(response.Output.Id)
}
if response.IsBlocking() {
state, err := response.OperationStatus()
if err != nil {
fmt.Println(err)
return
}
if !state.Status {
fmt.Println(state.Message, state.Errors)
return
}
// Inspect the operation status using its documented output fields.
}
// Request success does not establish operation completion.
}
Rust API client (async) · Simple
// Use inside an async function returning Result<(), Box<dyn std::error::Error>>.
let response = api.vps().create().user(1_i64).hostname("my-vps".to_owned()).os_template(1_i64).info("".to_owned()).dns_resolver(1_i64).node(1_i64).onstartall(true).send().await?;
println!("{:?}", &response.output.id);
// Request success or a timeout does not establish completion of a server-side operation.
Rust API client (async) · With error handling
// cargo add vpsadmin-client
// cargo add tokio --features macros,rt-multi-thread
// cargo add serde_json
use vpsadmin_client::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api = match Client::builder("https://api.vpsfree.cz/")
.basic_auth("user", "secret")
.build() {
Ok(api) => api,
Err(error) => {
eprintln!("Client configuration failed: {}", error);
eprintln!("HTTP status: {:?}; timeout: {}", error.http_status(), error.is_timeout());
return Err(error.into());
}
};
let response = match api.vps().create().user(1_i64).hostname("my-vps".to_owned()).os_template(1_i64).info("".to_owned()).dns_resolver(1_i64).node(1_i64).onstartall(true).send().await {
Ok(response) => response,
Err(error) => {
eprintln!("Request failed: {}", error);
eprintln!("HTTP status: {:?}; timeout: {}", error.http_status(), error.is_timeout());
return Err(error.into());
}
};
let _ = response.http_status;
let _ = &response.meta;
println!("{:?}", &response.output.id);
// Request success or a timeout does not establish completion of a server-side operation.
// Use only the separately documented action-state action; this API client has no automatic wait helper.
Ok(())
}
Rust API client (blocking) · Simple
// Use inside a synchronous function outside async runtime threads returning Result<(), Box<dyn std::error::Error>>.
let response = api.vps().create().user(1_i64).hostname("my-vps".to_owned()).os_template(1_i64).info("".to_owned()).dns_resolver(1_i64).node(1_i64).onstartall(true).send()?;
println!("{:?}", &response.output.id);
// Request success or a timeout does not establish completion of a server-side operation.
Rust API client (blocking) · With error handling
// cargo add vpsadmin-client --features blocking
// cargo add serde_json
// Construct, use and drop this blocking client outside async runtime threads.
use vpsadmin_client::blocking::Client;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let api = match Client::builder("https://api.vpsfree.cz/")
.basic_auth("user", "secret")
.build() {
Ok(api) => api,
Err(error) => {
eprintln!("Client configuration failed: {}", error);
eprintln!("HTTP status: {:?}; timeout: {}", error.http_status(), error.is_timeout());
return Err(error.into());
}
};
let response = match api.vps().create().user(1_i64).hostname("my-vps".to_owned()).os_template(1_i64).info("".to_owned()).dns_resolver(1_i64).node(1_i64).onstartall(true).send() {
Ok(response) => response,
Err(error) => {
eprintln!("Request failed: {}", error);
eprintln!("HTTP status: {:?}; timeout: {}", error.http_status(), error.is_timeout());
return Err(error.into());
}
};
let _ = response.http_status;
let _ = &response.meta;
println!("{:?}", &response.output.id);
// Request success or a timeout does not establish completion of a server-side operation.
// Use only the separately documented action-state action; this API client has no automatic wait helper.
Ok(())
}
TypeScript API client · Simple
// Requires an initialized api and an async context.
const result = await api.vps.create({ "params": { "user": 1, "hostname": "my-vps", "os_template": 1, "info": "", "dns_resolver": 1, "node": 1, "onstartall": true } });
console.log(result.data.id);
// Request success does not establish completion of a server-side operation.
TypeScript API client · With error handling
// Configured API client: vpsadmin-typescript-client.
import { AsyncClient, AsyncError } from "haveapi-client";
import { createClient } from "vpsadmin-typescript-client";
async function main(): Promise<void> {
try {
const runtime = new AsyncClient("https://api.vpsfree.cz/v7.0");
await runtime.authenticate("basic", { user: "user", password: "secret" });
const api = createClient({ execute: spec => runtime.request(spec) });
const result = await api.vps.create({ "params": { "user": 1, "hostname": "my-vps", "os_template": 1, "info": "", "dns_resolver": 1, "node": 1, "onstartall": true } });
void [result.data, result.meta, result.envelope, result.httpStatus];
const item = result.data;
const value0: unknown = item.id;
if (value0 !== null && value0 !== undefined) console.log(value0);
// Request success does not establish completion of a server-side operation.
} catch (error) {
if (!(error instanceof AsyncError)) throw error;
console.error(error.kind, error.httpStatus);
throw error;
}
}
main().catch(error => { throw error; });
PHP · Simple
$reply = $api->vps->create([
'user' => 1,
'hostname' => 'my-vps',
'os_template' => 1,
'info' => '',
'dns_resolver' => 1,
'node' => 1,
'onstartall' => true
]);
// $reply is an instance of \HaveAPI\Client\ResourceInstance
// $reply->id = 150
PHP · With error handling
try {
$api = new \HaveAPI\Client('https://api.vpsfree.cz/', '7.0');
$api->setup();
$api->authenticate('token', ['token' => 'example-token']);
$reply = $api->vps->create([
'user' => 1,
'hostname' => 'my-vps',
'os_template' => 1,
'info' => '',
'dns_resolver' => 1,
'node' => 1,
'onstartall' => true
]);
// $reply is an instance of \HaveAPI\Client\ResourceInstance
// $reply->id = 150
} catch (\HaveAPI\Client\Exception\ValidationError $error) {
echo $error->getMessage() . "\n";
print_r($error->getErrors());
} catch (\HaveAPI\Client\Exception\ActionFailed $error) {
echo $error->getMessage() . "\n";
print_r($error->getErrors());
} catch (\HaveAPI\Client\Exception\Base $error) {
echo $error->getMessage() . "\n";
} catch (\Exception $error) {
// Dependency failures still propagate to the application.
echo $error->getMessage() . "\n";
throw $error;
}
CLI · Simple
$ haveapi-cli -u https://api.vpsfree.cz/ --version 7.0 vps create -- \
--user 1 \
--hostname my-vps \
--os-template 1 \
--info '' \
--dns-resolver 1 \
--node 1 \
--onstartall
# VPS id: 150
# User: -
# Hostname: -
# Manage hostname: -
# OS template: -
# Cgroup_version: -
# Map mode: -
# Info: -
# DNS resolver: -
# Node: -
# UID/GID mapping: -
# Auto-start: -
# Auto-start priority: -
# On start all: -
# Config: -
# CPU limit: -
# Start menu timeout: -
# Allow admin modifications: -
# Enable OS template auto update: -
# Enable network: -
# Dataset: -
# Pool: -
# Created at: -
# Implicit_oom_report_rule_hit_count: -
# CPU: -
# Disk space: -
# Memory: -
# Swap: -
# Running: -
# In rescue mode: -
# Uptime: -
# Loadavg1: -
# Loadavg5: -
# Loadavg15: -
# Process count: -
# Cpu_user: -
# Cpu_nice: -
# Cpu_system: -
# Cpu_idle: -
# Cpu_iowait: -
# Cpu_irq: -
# Cpu_softirq: -
# Used memory: -
# Used swap: -
# Used disk space: -
# Object state: -
# Expiration: -
# Remind after: -
#
curl · Simple
$ curl --request POST \
--data-binary \{\"vps\":\{\"user\":1,\"hostname\":\"my-vps\",\"os_template\":1,\"info\":\"\",\"dns_resolver\":1,\"node\":1,\"onstartall\":true\}\} \
https://api.vpsfree.cz/v7.0/vpses
# {
# "status": true,
# "message": null,
# "response": {
# "vps": {
# "id": 150
# }
# },
# "errors": null
# }
HTTP · Simple
POST /v7.0/vpses HTTP/1.1
Host: api.vpsfree.cz
Content-Type: application/json
{
"vps": {
"user": 1,
"hostname": "my-vps",
"os_template": 1,
"info": "",
"dns_resolver": 1,
"node": 1,
"onstartall": true
}
}
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: 113
{
"status": true,
"message": null,
"response": {
"vps": {
"id": 150
}
},
"errors": null
}
Delete
Input parameters
| Parameter | Type | Required | Details | ||||
|---|---|---|---|---|---|---|---|
lazyLazy delete |
Boolean | no |
Only mark VPS as deleted Default: |
||||
object_stateObject state |
String | no |
Default:
|
||||
expiration_dateExpiration |
Datetime | no |
A date after which the state will progress Default: |
||||
remind_after_dateRemind after |
Datetime | no |
Mail warnings are silenced until this date Default: |
||||
change_reasonReason |
String | no |
Reason for the state change. May be mailed to the user. Default: |
Output parameters
No parameters.
Deploy_public_key
Input parameters
| Parameter | Type | Required | Details |
|---|---|---|---|
public_keyPublic key |
Resource | yes |
Output parameters
No parameters.
Index
Input parameters
| Parameter | Type | Required | Details | ||||
|---|---|---|---|---|---|---|---|
from_idFrom ID |
Integer | no |
List objects with IDs greater or lower than this value Default:
|
||||
limitLimit |
Integer | no |
Number of objects to retrieve Default:
|
||||
userUser |
Resource | no |
Filter by owner |
||||
nodeNode |
Resource | no |
Filter by node |
||||
locationLocation |
Resource | no |
Filter by location |
||||
environmentEnvironment |
Resource | no |
Filter by environment |
||||
user_namespace_mapUID/GID mapping |
Resource | no | |||||
os_templateOS template |
Resource | no | |||||
hostname_anyHostname_any |
String | no |
Default: |
||||
hostname_exactHostname_exact |
String | no |
Default: |
||||
object_stateObject state |
String | no |
Default:
|
Output parameters
| Parameter | Type | Description |
|---|---|---|
idVPS id |
Integer | |
userUser |
Resource | VPS owner |
hostnameHostname |
String | VPS hostname |
manage_hostnameManage hostname |
Boolean | Determines whether vpsAdmin sets VPS hostname or not |
os_templateOS template |
Resource | |
cgroup_versionCgroup_version |
String | |
map_modeMap mode |
String | |
infoInfo |
String | VPS description |
dns_resolverDNS resolver |
Resource | DNS resolver the VPS will use |
nodeNode |
Resource | Node VPS will run on |
user_namespace_mapUID/GID mapping |
Resource | |
autostart_enableAuto-start |
Boolean | Start VPS on node boot? |
autostart_priorityAuto-start priority |
Integer | 0 is the highest priority, greater numbers have lower priority |
onstartallOn start all |
Boolean | Start VPS on start all action? |
configConfig |
String | Custom configuration options |
cpu_limitCPU limit |
Integer | Limit of maximum CPU usage |
start_menu_timeoutStart menu timeout |
Integer | Number of seconds the start menu waits for the user |
allow_admin_modificationsAllow admin modifications |
Boolean | |
enable_os_template_auto_updateEnable OS template auto update |
Boolean | |
enable_networkEnable network |
Boolean | |
datasetDataset |
Resource | Dataset the VPS resides in |
poolPool |
Resource | Storage pool the VPS resides in |
created_atCreated at |
Datetime | |
implicit_oom_report_rule_hit_countImplicit_oom_report_rule_hit_count |
Integer | |
cpuCPU |
Integer | Minimally 1, maximally 1024, step size is 1 |
diskspaceDisk space |
Integer | Minimally 1024, maximally 1048576, step size is 1 |
memoryMemory |
Integer | Minimally 128, maximally 1048576, step size is 1 |
swapSwap |
Integer | Minimally 0, maximally 1048576, step size is 1 |
is_runningRunning |
Boolean | |
in_rescue_modeIn rescue mode |
Boolean | |
uptimeUptime |
Integer | |
loadavg1Loadavg1 |
Float | |
loadavg5Loadavg5 |
Float | |
loadavg15Loadavg15 |
Float | |
process_countProcess count |
Integer | |
cpu_userCpu_user |
Float | |
cpu_niceCpu_nice |
Float | |
cpu_systemCpu_system |
Float | |
cpu_idleCpu_idle |
Float | |
cpu_iowaitCpu_iowait |
Float | |
cpu_irqCpu_irq |
Float | |
cpu_softirqCpu_softirq |
Float | |
used_memoryUsed memory |
Integer | in MB |
used_swapUsed swap |
Integer | in MB |
used_diskspaceUsed disk space |
Integer | in MB |
maintenance_lockMaintenance lock |
String | |
maintenance_lock_reasonMaintenance reason |
String | |
object_stateObject state |
String | |
expiration_dateExpiration |
Datetime | A date after which the state will progress |
remind_after_dateRemind after |
Datetime | Mail warnings are silenced until this date |
Examples
Examples use an initialized api client, authenticated when required. See initialization and authentication.
Example #0
Ruby · Simple
reply = api.vps.index
# reply is an instance of HaveAPI::Client::ResourceInstanceList,
# which is a subclass of Array
Ruby · With error handling
begin
require 'haveapi/client'
api = HaveAPI::Client.new("https://api.vpsfree.cz/", version: "7.0")
api.setup
api.authenticate(:token, token: 'example-token')
reply = api.vps.index
# reply is an instance of HaveAPI::Client::ResourceInstanceList,
# which is a subclass of Array
rescue HaveAPI::Client::ValidationError => error
warn error.message
warn error.errors.inspect
rescue HaveAPI::Client::ActionFailed => error
warn error.message
warn error.response.errors.inspect if error.response.is_a?(HaveAPI::Client::Response)
rescue HaveAPI::Client::Authentication::AuthenticationFailed, HaveAPI::Client::ProtocolError,
RestClient::Exception, JSON::ParserError => error
warn error.message
end
JavaScript (callback) · Simple
const resource = CallbackClient.findResource(api, ["vps"]);
const action = CallbackClient.findAction(resource, "index");
action.directInvoke({
params: {},
onReply: (owner, reply) => {
if (!reply.isOk()) {
console.error(reply.message(), reply.envelope.errors);
return;
}
console.log(reply.response());
}
});
JavaScript (callback) · With error handling
import { CallbackClient } from "haveapi-client";
const api = new CallbackClient("https://api.vpsfree.cz/", {version: "7.0"});
api.authenticate("token", {token: "example-token"}, (api, ready) => {
if (!ready) {
console.error("Discovery or authentication failed");
return;
}
try {
const resource = CallbackClient.findResource(api, ["vps"]);
const action = CallbackClient.findAction(resource, "index");
action.directInvoke({
params: {},
onReply: (owner, reply) => {
if (!reply.isOk()) {
console.error(reply.message(), reply.envelope.errors);
return;
}
console.log(reply.response());
console.log(reply.meta());
}
});
} catch (error) {
console.error(error);
}
});
JavaScript (async) · Simple
const result = await api.resource("vps").action("index")({params: {}});
console.log(result.value);
JavaScript (async) · With error handling
import { AsyncClient, AsyncError } from "haveapi-client";
async function main() {
const api = new AsyncClient("https://api.vpsfree.cz/", {version: "7.0"});
try {
await api.authenticate("token", {token: "example-token"});
const result = await api.resource("vps").action("index")({params: {}});
console.log(result.value);
console.log(result.response.meta);
} catch (error) {
if (error instanceof AsyncError) {
console.error(error.kind, error.message, error.errors);
} else {
throw error;
}
}
}
main().catch(error => console.error(error));
TypeScript (callback) · Simple
const resource = CallbackClient.findResource(api, ["vps"]);
const action = CallbackClient.findAction(resource, "index");
action.directInvoke({
params: {},
onReply: (owner, reply) => {
if (!reply.isOk()) {
console.error(reply.message(), reply.envelope.errors);
return;
}
console.log(reply.response());
}
});
TypeScript (callback) · With error handling
import { CallbackClient } from "haveapi-client";
const api = new CallbackClient("https://api.vpsfree.cz/", {version: "7.0"});
api.authenticate("token", {token: "example-token"}, (api, ready) => {
if (!ready) {
console.error("Discovery or authentication failed");
return;
}
try {
const resource = CallbackClient.findResource(api, ["vps"]);
const action = CallbackClient.findAction(resource, "index");
action.directInvoke({
params: {},
onReply: (owner, reply) => {
if (!reply.isOk()) {
console.error(reply.message(), reply.envelope.errors);
return;
}
console.log(reply.response());
console.log(reply.meta());
}
});
} catch (error) {
console.error(error);
}
});
TypeScript (async) · Simple
const result = await api.resource("vps").action("index")({params: {}});
console.log(result.value);
TypeScript (async) · With error handling
import { AsyncClient, AsyncError } from "haveapi-client";
async function main(): Promise<void> {
const api = new AsyncClient("https://api.vpsfree.cz/", {version: "7.0"});
try {
await api.authenticate("token", {token: "example-token"});
const result = await api.resource("vps").action("index")({params: {}});
console.log(result.value);
console.log(result.response.meta);
} catch (error) {
if (error instanceof AsyncError) {
console.error(error.kind, error.message, error.errors);
} else {
throw error;
}
}
}
main().catch(error => console.error(error));
Python (sync) · Simple
response = api.resources["vps"].actions["index"].call(params={})
print(response.data)
Python (sync) · With error handling
from haveapi_client import Client, ActionError, HaveAPIError, TokenAuth
try:
with Client("https://api.vpsfree.cz/", version="7.0", auth=TokenAuth("example-token")) as api:
response = api.resources["vps"].actions["index"].call(params={})
print(response.data)
print(response.meta)
except ActionError as error:
print(error.message, error.errors)
except HaveAPIError as error:
print(error.message, error.status_code)
Python (async) · Simple
# Run inside an async function after initializing api.
response = await api.resources["vps"].actions["index"].call(params={})
print(response.data)
Python (async) · With error handling
import asyncio
from haveapi_client import AsyncClient, ActionError, HaveAPIError, TokenAuth
async def main() -> None:
try:
async with AsyncClient("https://api.vpsfree.cz/", version="7.0", auth=TokenAuth("example-token")) as api:
response = await api.resources["vps"].actions["index"].call(params={})
print(response.data)
print(response.meta)
except ActionError as error:
print(error.message, error.errors)
except HaveAPIError as error:
print(error.message, error.status_code)
asyncio.run(main())
Go API client · Simple
invocation := api.Vps.Index.Prepare()
invocation.NewInput().SelectParameters()
response, err := invocation.Call()
if err != nil {
fmt.Println(err)
return
}
if !response.Status {
fmt.Println(response.Message, response.Errors)
return
}
for _, item := range response.Output {
if item != nil {
fmt.Println(item.Id)
if item.User != nil {
fmt.Println(item.User.Id)
fmt.Println(item.User.Login)
}
fmt.Println(item.Hostname)
if item.OsTemplate != nil {
fmt.Println(item.OsTemplate.Id)
fmt.Println(item.OsTemplate.Label)
}
fmt.Println(item.Info)
if item.DnsResolver != nil {
fmt.Println(item.DnsResolver.Id)
}
if item.Node != nil {
fmt.Println(item.Node.Id)
fmt.Println(item.Node.Name)
}
fmt.Println(item.Onstartall)
}
}
Rust API client (async) · Simple
// Use inside an async function returning Result<(), Box<dyn std::error::Error>>.
let response = api.vps().index().send().await?;
for item in &response.output {
println!("{:?}", &item.id);
println!("{:?}", &item.user);
println!("{:?}", &item.hostname);
println!("{:?}", &item.os_template);
println!("{:?}", &item.info);
println!("{:?}", &item.dns_resolver);
println!("{:?}", &item.node);
println!("{:?}", &item.onstartall);
}
Rust API client (async) · With error handling
// cargo add vpsadmin-client
// cargo add tokio --features macros,rt-multi-thread
// cargo add serde_json
use vpsadmin_client::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api = match Client::builder("https://api.vpsfree.cz/")
.basic_auth("user", "secret")
.build() {
Ok(api) => api,
Err(error) => {
eprintln!("Client configuration failed: {}", error);
eprintln!("HTTP status: {:?}; timeout: {}", error.http_status(), error.is_timeout());
return Err(error.into());
}
};
let response = match api.vps().index().send().await {
Ok(response) => response,
Err(error) => {
eprintln!("Request failed: {}", error);
eprintln!("HTTP status: {:?}; timeout: {}", error.http_status(), error.is_timeout());
return Err(error.into());
}
};
let _ = response.http_status;
let _ = &response.meta;
for item in &response.output {
println!("{:?}", &item.id);
println!("{:?}", &item.user);
println!("{:?}", &item.hostname);
println!("{:?}", &item.os_template);
println!("{:?}", &item.info);
println!("{:?}", &item.dns_resolver);
println!("{:?}", &item.node);
println!("{:?}", &item.onstartall);
}
Ok(())
}
Rust API client (blocking) · Simple
// Use inside a synchronous function outside async runtime threads returning Result<(), Box<dyn std::error::Error>>.
let response = api.vps().index().send()?;
for item in &response.output {
println!("{:?}", &item.id);
println!("{:?}", &item.user);
println!("{:?}", &item.hostname);
println!("{:?}", &item.os_template);
println!("{:?}", &item.info);
println!("{:?}", &item.dns_resolver);
println!("{:?}", &item.node);
println!("{:?}", &item.onstartall);
}
Rust API client (blocking) · With error handling
// cargo add vpsadmin-client --features blocking
// cargo add serde_json
// Construct, use and drop this blocking client outside async runtime threads.
use vpsadmin_client::blocking::Client;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let api = match Client::builder("https://api.vpsfree.cz/")
.basic_auth("user", "secret")
.build() {
Ok(api) => api,
Err(error) => {
eprintln!("Client configuration failed: {}", error);
eprintln!("HTTP status: {:?}; timeout: {}", error.http_status(), error.is_timeout());
return Err(error.into());
}
};
let response = match api.vps().index().send() {
Ok(response) => response,
Err(error) => {
eprintln!("Request failed: {}", error);
eprintln!("HTTP status: {:?}; timeout: {}", error.http_status(), error.is_timeout());
return Err(error.into());
}
};
let _ = response.http_status;
let _ = &response.meta;
for item in &response.output {
println!("{:?}", &item.id);
println!("{:?}", &item.user);
println!("{:?}", &item.hostname);
println!("{:?}", &item.os_template);
println!("{:?}", &item.info);
println!("{:?}", &item.dns_resolver);
println!("{:?}", &item.node);
println!("{:?}", &item.onstartall);
}
Ok(())
}
TypeScript API client · Simple
// Requires an initialized api and an async context.
const result = await api.vps.index();
for (const item of result.data) {
console.log(item.id);
console.log(item.user);
console.log(item.hostname);
console.log(item.os_template);
console.log(item.info);
console.log(item.dns_resolver);
console.log(item.node);
console.log(item.onstartall);
}
TypeScript API client · With error handling
// Configured API client: vpsadmin-typescript-client.
import { AsyncClient, AsyncError } from "haveapi-client";
import { createClient } from "vpsadmin-typescript-client";
async function main(): Promise<void> {
try {
const runtime = new AsyncClient("https://api.vpsfree.cz/v7.0");
await runtime.authenticate("basic", { user: "user", password: "secret" });
const api = createClient({ execute: spec => runtime.request(spec) });
const result = await api.vps.index();
void [result.data, result.meta, result.envelope, result.httpStatus];
for (const item of result.data) {
const value0: unknown = item.id;
if (value0 !== null && value0 !== undefined) console.log(value0);
const value1: unknown = item.user;
if (value1 !== null && value1 !== undefined) console.log(value1);
const value2: unknown = item.hostname;
if (value2 !== null && value2 !== undefined) console.log(value2);
const value3: unknown = item.os_template;
if (value3 !== null && value3 !== undefined) console.log(value3);
const value4: unknown = item.info;
if (value4 !== null && value4 !== undefined) console.log(value4);
const value5: unknown = item.dns_resolver;
if (value5 !== null && value5 !== undefined) console.log(value5);
const value6: unknown = item.node;
if (value6 !== null && value6 !== undefined) console.log(value6);
const value7: unknown = item.onstartall;
if (value7 !== null && value7 !== undefined) console.log(value7);
}
} catch (error) {
if (!(error instanceof AsyncError)) throw error;
console.error(error.kind, error.httpStatus);
throw error;
}
}
main().catch(error => { throw error; });
PHP · Simple
$reply = $api->vps->index();
// $reply is an instance of \HaveAPI\Client\ResourceInstanceList
PHP · With error handling
try {
$api = new \HaveAPI\Client('https://api.vpsfree.cz/', '7.0');
$api->setup();
$api->authenticate('token', ['token' => 'example-token']);
$reply = $api->vps->index();
// $reply is an instance of \HaveAPI\Client\ResourceInstanceList
} catch (\HaveAPI\Client\Exception\ValidationError $error) {
echo $error->getMessage() . "\n";
print_r($error->getErrors());
} catch (\HaveAPI\Client\Exception\ActionFailed $error) {
echo $error->getMessage() . "\n";
print_r($error->getErrors());
} catch (\HaveAPI\Client\Exception\Base $error) {
echo $error->getMessage() . "\n";
} catch (\Exception $error) {
// Dependency failures still propagate to the application.
echo $error->getMessage() . "\n";
throw $error;
}
CLI · Simple
$ haveapi-cli -u https://api.vpsfree.cz/ --version 7.0 vps index
# VPS id: 150
# User: somebody (#1)
# Hostname: thehostname
# Manage hostname: -
# OS template: Scientific Linux 6 (#1)
# Cgroup_version: -
# Map mode: -
# Info: My very important VPS
# DNS resolver: (#1)
# Node: (#1)
# UID/GID mapping: -
# Auto-start: -
# Auto-start priority: -
# On start all: true
# Config: -
# CPU limit: -
# Start menu timeout: -
# Allow admin modifications: -
# Enable OS template auto update: -
# Enable network: -
# Dataset: -
# Pool: -
# Created at: -
# Implicit_oom_report_rule_hit_count: -
# CPU: -
# Disk space: -
# Memory: -
# Swap: -
# Running: -
# In rescue mode: -
# Uptime: -
# Loadavg1: -
# Loadavg5: -
# Loadavg15: -
# Process count: -
# Cpu_user: -
# Cpu_nice: -
# Cpu_system: -
# Cpu_idle: -
# Cpu_iowait: -
# Cpu_irq: -
# Cpu_softirq: -
# Used memory: -
# Used swap: -
# Used disk space: -
# Maintenance lock: -
# Maintenance reason: -
# Object state: -
# Expiration: -
# Remind after: -
#
curl · Simple
$ curl --request GET \
--data-binary \{\"vps\":\{\}\} \
https://api.vpsfree.cz/v7.0/vpses
# {
# "status": true,
# "message": null,
# "response": {
# "vpses": [
# {
# "id": 150,
# "user": {
# "id": 1,
# "login": "somebody"
# },
# "hostname": "thehostname",
# "os_template": {
# "id": 1,
# "label": "Scientific Linux 6"
# },
# "info": "My very important VPS",
# "dns_resolver": {
# "id": 1
# },
# "node": {
# "id": 1,
# "name": "node1"
# },
# "onstartall": true
# }
# ]
# },
# "errors": null
# }
HTTP · Simple
GET /v7.0/vpses HTTP/1.1
Host: api.vpsfree.cz
Content-Type: application/json
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: 539
{
"status": true,
"message": null,
"response": {
"vpses": [
{
"id": 150,
"user": {
"id": 1,
"login": "somebody"
},
"hostname": "thehostname",
"os_template": {
"id": 1,
"label": "Scientific Linux 6"
},
"info": "My very important VPS",
"dns_resolver": {
"id": 1
},
"node": {
"id": 1,
"name": "node1"
},
"onstartall": true
}
]
},
"errors": null
}
Migrate
Input parameters
| Parameter | Type | Required | Details | ||||
|---|---|---|---|---|---|---|---|
nodeNode |
Resource | yes | |||||
replace_ip_addressesReplace IP addresses |
Boolean | no |
When migrating to another location, current IP addresses are replaced by addresses from the new location Default: |
||||
transfer_ip_addressesTransfer IP addresses |
Boolean | no |
If possible, keep IP addresses and recharge them to a different environment or location Default: |
||||
swapSwap |
String | no |
Minimally 0, maximally 1048576, step size is 1 Default:
|
||||
maintenance_windowMaintenance window |
Boolean | no |
Migrate the VPS within the nearest maintenance window Default: |
||||
finish_weekdayFinish weekday |
Integer | no |
Prepare the migration and finish it on this day Default:
|
||||
finish_minutesFinish minutes |
Integer | no |
Number of minutes from midnight of start_weekday after which the migration is done Default:
|
||||
cleanup_dataCleanup data |
Boolean | no |
Remove VPS dataset from the source node Default: |
||||
no_startNo start |
Boolean | no |
Do not start the VPS on the target node Default: |
||||
skip_startSkip start |
Boolean | no |
Continue even if the VPS fails to start on the target node Default: |
||||
send_mailSend e-mails |
Boolean | no |
Inform the VPS owner about migration progress Default: |
||||
reasonReason |
String | no |
Default: |
Output parameters
No parameters.
Passwd
Input parameters
| Parameter | Type | Required | Details | ||||
|---|---|---|---|---|---|---|---|
typeType |
String | no |
node, storage or mailer Default:
|
Output parameters
| Parameter | Type | Description |
|---|---|---|
passwordPassword |
String | Auto-generated password |
Reinstall
Input parameters
| Parameter | Type | Required | Details | ||||
|---|---|---|---|---|---|---|---|
os_templateOS template |
Resource | no | |||||
vps_user_dataUser data |
Resource | no | |||||
user_data_formatUser data format |
String | no |
Default:
|
||||
user_data_contentUser data content |
Text | no |
Default: |
Output parameters
No parameters.
Replace
Input parameters
| Parameter | Type | Required | Details |
|---|---|---|---|
nodeNode |
Resource | no |
Clone to node |
expiration_dateExpiration_date |
Datetime | no |
How long should the original VPS be kept Default: |
startStart |
Boolean | no |
Start thew new VPS Default: |
preserve_backupsPreserve backups |
Boolean | no |
Move existing backup datasets to the replacement VPS Default: |
preserve_backup_historyPreserve backup history |
Boolean | no |
Back up a replacement snapshot so future backups can continue incrementally Default: |
reasonReason |
Text | no |
Default: |
Output parameters
| Parameter | Type | Description |
|---|---|---|
idVPS id |
Integer | |
userUser |
Resource | VPS owner |
hostnameHostname |
String | VPS hostname |
manage_hostnameManage hostname |
Boolean | Determines whether vpsAdmin sets VPS hostname or not |
os_templateOS template |
Resource | |
cgroup_versionCgroup_version |
String | |
map_modeMap mode |
String | |
infoInfo |
String | VPS description |
dns_resolverDNS resolver |
Resource | DNS resolver the VPS will use |
nodeNode |
Resource | Node VPS will run on |
user_namespace_mapUID/GID mapping |
Resource | |
autostart_enableAuto-start |
Boolean | Start VPS on node boot? |
autostart_priorityAuto-start priority |
Integer | 0 is the highest priority, greater numbers have lower priority |
onstartallOn start all |
Boolean | Start VPS on start all action? |
configConfig |
String | Custom configuration options |
cpu_limitCPU limit |
Integer | Limit of maximum CPU usage |
start_menu_timeoutStart menu timeout |
Integer | Number of seconds the start menu waits for the user |
allow_admin_modificationsAllow admin modifications |
Boolean | |
enable_os_template_auto_updateEnable OS template auto update |
Boolean | |
enable_networkEnable network |
Boolean | |
datasetDataset |
Resource | Dataset the VPS resides in |
poolPool |
Resource | Storage pool the VPS resides in |
created_atCreated at |
Datetime | |
implicit_oom_report_rule_hit_countImplicit_oom_report_rule_hit_count |
Integer | |
cpuCPU |
Integer | Minimally 1, maximally 1024, step size is 1 |
diskspaceDisk space |
Integer | Minimally 1024, maximally 1048576, step size is 1 |
memoryMemory |
Integer | Minimally 128, maximally 1048576, step size is 1 |
swapSwap |
Integer | Minimally 0, maximally 1048576, step size is 1 |
is_runningRunning |
Boolean | |
in_rescue_modeIn rescue mode |
Boolean | |
uptimeUptime |
Integer | |
loadavg1Loadavg1 |
Float | |
loadavg5Loadavg5 |
Float | |
loadavg15Loadavg15 |
Float | |
process_countProcess count |
Integer | |
cpu_userCpu_user |
Float | |
cpu_niceCpu_nice |
Float | |
cpu_systemCpu_system |
Float | |
cpu_idleCpu_idle |
Float | |
cpu_iowaitCpu_iowait |
Float | |
cpu_irqCpu_irq |
Float | |
cpu_softirqCpu_softirq |
Float | |
used_memoryUsed memory |
Integer | in MB |
used_swapUsed swap |
Integer | in MB |
used_diskspaceUsed disk space |
Integer | in MB |
Restart
Set_maintenance
Input parameters
| Parameter | Type | Required | Details | ||||
|---|---|---|---|---|---|---|---|
lockLock |
Boolean | yes |
Default:
|
||||
reasonReason |
String | no |
Default: |
Output parameters
No parameters.
Show
Input parameters
No parameters.
Output parameters
| Parameter | Type | Description |
|---|---|---|
idVPS id |
Integer | |
userUser |
Resource | VPS owner |
hostnameHostname |
String | VPS hostname |
manage_hostnameManage hostname |
Boolean | Determines whether vpsAdmin sets VPS hostname or not |
os_templateOS template |
Resource | |
cgroup_versionCgroup_version |
String | |
map_modeMap mode |
String | |
infoInfo |
String | VPS description |
dns_resolverDNS resolver |
Resource | DNS resolver the VPS will use |
nodeNode |
Resource | Node VPS will run on |
user_namespace_mapUID/GID mapping |
Resource | |
autostart_enableAuto-start |
Boolean | Start VPS on node boot? |
autostart_priorityAuto-start priority |
Integer | 0 is the highest priority, greater numbers have lower priority |
onstartallOn start all |
Boolean | Start VPS on start all action? |
configConfig |
String | Custom configuration options |
cpu_limitCPU limit |
Integer | Limit of maximum CPU usage |
start_menu_timeoutStart menu timeout |
Integer | Number of seconds the start menu waits for the user |
allow_admin_modificationsAllow admin modifications |
Boolean | |
enable_os_template_auto_updateEnable OS template auto update |
Boolean | |
enable_networkEnable network |
Boolean | |
datasetDataset |
Resource | Dataset the VPS resides in |
poolPool |
Resource | Storage pool the VPS resides in |
created_atCreated at |
Datetime | |
implicit_oom_report_rule_hit_countImplicit_oom_report_rule_hit_count |
Integer | |
cpuCPU |
Integer | Minimally 1, maximally 1024, step size is 1 |
diskspaceDisk space |
Integer | Minimally 1024, maximally 1048576, step size is 1 |
memoryMemory |
Integer | Minimally 128, maximally 1048576, step size is 1 |
swapSwap |
Integer | Minimally 0, maximally 1048576, step size is 1 |
is_runningRunning |
Boolean | |
in_rescue_modeIn rescue mode |
Boolean | |
uptimeUptime |
Integer | |
loadavg1Loadavg1 |
Float | |
loadavg5Loadavg5 |
Float | |
loadavg15Loadavg15 |
Float | |
process_countProcess count |
Integer | |
cpu_userCpu_user |
Float | |
cpu_niceCpu_nice |
Float | |
cpu_systemCpu_system |
Float | |
cpu_idleCpu_idle |
Float | |
cpu_iowaitCpu_iowait |
Float | |
cpu_irqCpu_irq |
Float | |
cpu_softirqCpu_softirq |
Float | |
used_memoryUsed memory |
Integer | in MB |
used_swapUsed swap |
Integer | in MB |
used_diskspaceUsed disk space |
Integer | in MB |
maintenance_lockMaintenance lock |
String | |
maintenance_lock_reasonMaintenance reason |
String | |
object_stateObject state |
String | |
expiration_dateExpiration |
Datetime | A date after which the state will progress |
remind_after_dateRemind after |
Datetime | Mail warnings are silenced until this date |
Start
Stop
Swap_with
Input parameters
| Parameter | Type | Required | Details |
|---|---|---|---|
vpsVPS |
Resource | yes |
Swap with this VPS |
resourcesResources |
Boolean | no |
Swap resources (CPU, memory and swap, not disk space) Default: |
hostnameHostname |
Boolean | no |
Swap hostname Default: |
expirationsExpirations |
Boolean | no |
Swap expirations Default: |
Output parameters
No parameters.
Update
Input parameters
| Parameter | Type | Required | Details | ||||
|---|---|---|---|---|---|---|---|
userUser |
Resource | no |
VPS owner |
||||
hostnameHostname |
String | no |
VPS hostname Default:
|
||||
manage_hostnameManage hostname |
Boolean | no |
Determines whether vpsAdmin sets VPS hostname or not Default: |
||||
os_templateOS template |
Resource | no | |||||
cgroup_versionCgroup_version |
String | no |
Default:
|
||||
map_modeMap mode |
String | no |
Default:
|
||||
infoInfo |
String | no |
VPS description Default: |
||||
dns_resolverDNS resolver |
Resource | no |
DNS resolver the VPS will use |
||||
nodeNode |
Resource | no |
Node VPS will run on |
||||
user_namespace_mapUID/GID mapping |
Resource | no | |||||
autostart_enableAuto-start |
Boolean | no |
Start VPS on node boot? Default: |
||||
autostart_priorityAuto-start priority |
Integer | no |
0 is the highest priority, greater numbers have lower priority Default:
|
||||
onstartallOn start all |
Boolean | no |
Start VPS on start all action? Default: |
||||
configConfig |
String | no |
Custom configuration options Default: |
||||
cpu_limitCPU limit |
Integer | no |
Limit of maximum CPU usage Default:
|
||||
start_menu_timeoutStart menu timeout |
Integer | no |
Number of seconds the start menu waits for the user Default:
|
||||
allow_admin_modificationsAllow admin modifications |
Boolean | no |
Default: |
||||
enable_os_template_auto_updateEnable OS template auto update |
Boolean | no |
Default: |
||||
enable_networkEnable network |
Boolean | no |
Default: |
||||
cpuCPU |
Integer | no |
Minimally 1, maximally 1024, step size is 1 Default: |
||||
memoryMemory |
Integer | no |
Minimally 128, maximally 1048576, step size is 1 Default: |
||||
swapSwap |
Integer | no |
Minimally 0, maximally 1048576, step size is 1 Default: |
||||
change_reasonChange reason |
Text | no |
If filled, it is send to VPS owner in an email Default: |
||||
admin_overrideAdmin override |
Boolean | no |
Make it possible to assign more resource than the user actually has Default: |
||||
admin_lock_typeAdmin lock type |
String | no |
How is the admin lock enforced Default:
|
||||
object_stateObject state |
String | no |
Default:
|
||||
expiration_dateExpiration |
Datetime | no |
A date after which the state will progress Default: |
||||
remind_after_dateRemind after |
Datetime | no |
Mail warnings are silenced until this date Default: |
Output parameters
No parameters.