Info
Welcome to the HosterAPI. Please contact our support staff to obtain an access token.
Authentication
Authentication happens via a Bearer token. Place the token you were assigned in a "Authorization"-Header.
Example:
Authorization: Bearer 1|qpVodrZ3edt0DV4Q81dxQekTAessUHcH0Zjqv4t6
Requests
Ideally the API receives request data formatted as JSON.
Please don't forget to set appropriate headers:
Accept: application/json
Depending on how you send the request body data (ideally as JSON):
Content-Type: application/json
Example:
{
"cpuCores": 4,
"mem": 1024,
"ipCount": 2,
"template": "Ubuntu18.04"
}
Responses
All API responses are in JSON format. Result data is capsuled inside the result
key. If an error happens, there will be a error
key.
Example:
{
"result": [
"Ubuntu18.04"
]
}
{
"result": false,
"error": "0x01: no vm with id 4010 found"
}
Dedicated
Show all dedicated servers available for purchase
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/dedicated/market" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/market"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/market',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": [
{
"id": 9,
"model": "HP ProLiant BL460c G8",
"description": "",
"configuration": {
"cpu": {
"type": "Intel Xeon E5-2609 v2",
"count": "1"
},
"ram": {
"type": "DDR3 ECC",
"size": "32"
},
"storage": {
"type": "SSD",
"count": "2",
"size": "250"
},
"price": 39,
"location": {
"id": 2,
"name": "Maincubes, Frankfurt"
}
}
},
{
"id": 84,
"model": "Generic",
"description": null,
"configuration": {
"cpu": {
"type": "AMD Ryzen 7 3800X",
"count": "1"
},
"ram": {
"type": "DDR4 ECC",
"size": "32 GB DDR4 ECC"
},
"storage": {
"type": "NVMe",
"count": "2",
"size": "256"
},
"price": 139,
"location": {
"id": 1,
"name": "Maincubes, Frankfurt"
}
}
}
]
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
HTTP Request
GET api/v1/datacenter/dedicated/market
Show all available Parts for BYOD
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/dedicated/market/parts" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/market/parts"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/market/parts',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"cpu": [
{
"id": 38,
"name": "Intel(R) Xeon(R) CPU E5-2650 v1",
"description": "8 Cores \/ 16 Threads @ 2.00GHz",
"count": 1,
"price": 0
},
{
"id": 42,
"name": "Intel(R) Xeon(R) CPU E5-2670 v1 @ 2.60GHz",
"description": null,
"count": 1,
"price": 0
},
{
"id": 49,
"name": "Intel(R) Xeon(R) CPU E5-2690 v2 @ 3.00GHz",
"description": null,
"count": 1,
"price": 0
},
{
"id": 54,
"name": "Intel(R) Xeon(R) CPU E5-2609 v1 @ 2.40GHz",
"description": null,
"count": 1,
"price": 0
},
{
"id": 56,
"name": "Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz",
"description": null,
"count": 1,
"price": 0
},
{
"id": 58,
"name": "Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz",
"description": null,
"count": 1,
"price": 0
}
],
"ram": [
{
"id": 29,
"name": "16 GB DDR3 ECC",
"description": null,
"count": 10,
"price": 5
}
],
"hdd": [
{
"id": 27,
"name": "Seagate BarraCuda 2 TB HDD",
"description": null,
"count": 0,
"price": 0
}
],
"ssd": [
{
"id": 33,
"name": "Crucial BX500 240GB",
"description": null,
"count": 1,
"price": 0
},
{
"id": 35,
"name": "SanDisk SSD PLU 120GB",
"description": null,
"count": 1,
"price": 0
},
{
"id": 41,
"name": "SanDisk SSD PLU 240GB",
"description": null,
"count": 1,
"price": 0
}
]
}
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
HTTP Request
GET api/v1/datacenter/dedicated/market/parts
Place dedicated server order
Requires authentication
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/order" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"id":9,"template":"Debian Buster","hostname":"myserver.example.com"}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/order"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"id": 9,
"template": "Debian Buster",
"hostname": "myserver.example.com"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/order',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'id' => 9,
'template' => 'Debian Buster',
'hostname' => 'myserver.example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
POST api/v1/datacenter/dedicated/order
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
id |
integer | required | Server ID to order |
template |
string | required | Template to install |
hostname |
string | required | Server Hostname |
Build your own dedicated server
Requires authentication
This endpoint orders a custom server to be built and deplyoed. Response is a order number, which needs to be checked against the API in order to get the device ID on order completion.
Note: orders can take up to 48h to complete!
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/order/byod" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"parts":{"cpu":13,"ram":13,"ssd":18,"hdd":18},"template":"Debian Buster","ipCount":"2","hostname":"myserver.example.com"}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/order/byod"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"parts": {
"cpu": 13,
"ram": 13,
"ssd": 18,
"hdd": 18
},
"template": "Debian Buster",
"ipCount": "2",
"hostname": "myserver.example.com"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/order/byod',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'parts' => [
'cpu' => 13,
'ram' => 13,
'ssd' => 18,
'hdd' => 18,
],
'template' => 'Debian Buster',
'ipCount' => '2',
'hostname' => 'myserver.example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": 103
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
POST api/v1/datacenter/dedicated/order/byod
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
parts |
array | required | Parts to be in the server |
parts[cpu] |
integer | required | CPU part to be in the server |
parts[ram] |
integer | required | RAM part to be in the server |
parts[ssd] |
integer | optional | optional SSD part to be in the server |
parts[hdd] |
integer | optional | optional HDD part to be in the server |
template |
string | required | Template to install |
ipCount |
string | optional | optional IP Count |
hostname |
string | optional | optional Server Hostname |
Check BYOD order status
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/dedicated/order/byod/status/18" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/order/byod/status/18"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/order/byod/status/18',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
HTTP Request
GET api/v1/datacenter/dedicated/order/byod/status/{id}
URL Parameters
Parameter | Status | Description |
---|---|---|
id |
optional | int Order number |
Get available templates
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/dedicated/templates" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/templates"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/templates',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": [
"CentOS 7 (latest) (DE)",
"Debian 8 Jessie (DE)",
"Debian 9 Stretch (DE)",
"Ubuntu 16.04 LTS",
"Ubuntu 18.04 LTS (DE)",
"OpenSuse 42.3",
"VMware ESXi 6.5 U1",
"VMware ESXi 6.5 U2",
"Debian 10 Buster (DE)",
"Proxmox VE 6 (DE)",
"Debian 10 Buster - Software RAID (DE)",
"[COPY] Debian 10 Buster - Software RAID (DE) Test",
"CentOS 7 (latest)",
"Debian Jessie",
"Debian Stretch",
"Ubuntu 16.04 LTS",
"Ubuntu 18.04 LTS",
"OpenSuse 42.3",
"VMware ESXi 6.5 U1",
"VMware ESXi 6.5 U2",
"Debian Buster",
"Proxmox VE 6",
"Ubuntu 20.04 LTS"
]
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
HTTP Request
GET api/v1/datacenter/dedicated/templates
List owned servers
If you expect to find a ID here but it's not present, most likely there was an issue completing the order. You'll have to account for this case yourself with some kind of order tracking.
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/dedicated" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": [
{
"id": 9,
"orderComplete": false
}
]
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
HTTP Request
GET api/v1/datacenter/dedicated
Starts a dedicated server
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/start" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/start"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/start',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
PUT api/v1/datacenter/dedicated/{sid}/start
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Stops a dedicated server
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/shutdown" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/shutdown"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/shutdown',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
PUT api/v1/datacenter/dedicated/{sid}/shutdown
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Restarts a dedicated server
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/reboot" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/reboot"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/reboot',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
PUT api/v1/datacenter/dedicated/{sid}/reboot
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Reinstall server
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/1/reinstall" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"template":"Debian Buster","hostname":"myserver.example.com"}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/1/reinstall"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"template": "Debian Buster",
"hostname": "myserver.example.com"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/1/reinstall',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'template' => 'Debian Buster',
'hostname' => 'myserver.example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
HTTP Request
PUT api/v1/datacenter/dedicated/{sid}/reinstall
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
template |
string | required | Template to install |
hostname |
string | optional | optional Server Hostname |
Open noVNC Console
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/console" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/console"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/console',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": "https:\/\/example.com\/novnc\/vnc.html"
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/dedicated/{sid}/console
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Gets dedicated server status for specific server
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/status" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/status"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/status',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"orderId": 324,
"traffic": 0,
"netin": 0,
"netout": 0,
"uptime": 0,
"state": "halted",
"status": "offline"
}
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
GET api/v1/datacenter/dedicated/{sid}/status
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Gets configuration for specific server
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/config" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/config"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/config',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"ssh": {
"root": {
"password": "UOosKBueLhn8"
},
"user": {
"username": "user",
"password": "UOosKBueLhn8"
}
},
"ips": [
"92.246.85.200"
],
"template": "Debian Jessie",
"configuration": {
"cpu": {
"type": "Intel Xeon E5-2609 v1",
"count": "1"
},
"ram": {
"size": "16",
"type": "DDR3 ECC"
},
"price": 0,
"storage": {
"size": "240",
"type": "SSD",
"count": "2"
},
"location": {
"id": 2,
"name": "SkyLink, Eygelshoven"
}
}
}
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
GET api/v1/datacenter/dedicated/{sid}/config
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Set Server RDNS
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/rdns" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"ip":"dolorem","hostname":"nostrum"}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/rdns"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"ip": "dolorem",
"hostname": "nostrum"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/rdns',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'ip' => 'dolorem',
'hostname' => 'nostrum',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (400):
{
"result": false,
"error": "0xb1: Missing required parameter template"
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
PUT api/v1/datacenter/dedicated/{sid}/rdns
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
ip |
string | required | IP to set RDNS for (IPv4 only) |
hostname |
string | required | RDNS FQDN |
Gets installation status for specific server
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/installation" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/installation"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/installation',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"ssh": {
"root": {
"password": "UOosKBueLhn8"
},
"user": {
"username": "user",
"password": "UOosKBueLhn8"
}
},
"installation": true,
"template": "Debian Jessie",
"mac": ""
}
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/dedicated/{sid}/installation
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Terminate server
WARNING! THIS WILL IMMEDIATELY DELETE THE SERVER AND REVOKE ACCESS TO IT
Requires authentication
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/terminate" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/terminate"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "POST",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/datacenter/dedicated/9/terminate',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
POST api/v1/datacenter/dedicated/{sid}/terminate
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Jobs
Get job info
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/job/23" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/job/23"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/job/23',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"status": "queued",
"progress": 0,
"output": null
}
}
Example response (200):
{
"result": {
"status": "executing",
"progress": 0.33,
"output": null
}
}
Example response (200):
{
"result": {
"status": "finished",
"progress": 1,
"output": {
"vmid": 4001,
"ips": [
"37.114.XX.XXX"
],
"user": "root",
"password": "{password}"
}
}
}
Example response (200):
{
"result": {
"status": "failed",
"progress": 0.33,
"output": "0xb0: Requested resources exceed administrative limits"
}
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0xc1: job not found"
}
HTTP Request
GET api/v1/job/{jobId}
URL Parameters
Parameter | Status | Description |
---|---|---|
jobId |
required | Job ID |
Other
List all Locations
Returns all available locations for a deployment
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/location" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/location"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/location',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": [
{
"id": 1,
"name": "maincubes, Offenbach am Main",
"country": "Deutschland",
"iso": "DE",
"note": "AMD Epyc 7402P, DDR4 ECC RAM, Samsung Datacenter Ceph Storage"
}
]
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/location
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Server
Get current VM status
Requires authentication
(is running, cpu usage, mem, etc.)
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/status" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/status"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/status',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"cpu": 0,
"mem": 455467008,
"memfree": 577208320,
"netin": 52240,
"netout": 47492,
"uptime": 1164,
"state": "running"
}
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/server/{sid}/status
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Get current VM config
Requires authentication
(cpu usage, mem, etc.)
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/config" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/config"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/config',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"cpuCores": 2,
"mem": 2048,
"disk": "100G",
"ips": [
"127.0.0.1",
"fe80::1"
],
"template": "Ubuntu20.04",
"iso": null
}
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/server/{sid}/config
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Get installed software on the VM
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/software" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/software"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/software',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": [
{
"id": 2,
"status": "installing",
"package": "mc",
"version": "1",
"output": null,
"ip": "127.0.0.1",
"created_at": ""
}
]
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/server/{sid}/software
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Get incidents
Requires authentication
Returns all network incidents for this VM (DDoS Attempts, Suspicious network activity, etc.)
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/incidents" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/incidents"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/incidents',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"response": [
{
"gid": 117896,
"start": "2021-02-22 18:50:33",
"stop": "2021-02-22 18:50:33",
"host": "10.50.23.5",
"direction": 1,
"impact": 90107632,
"types": [
"NTP Amplification",
"DNS Amplification"
],
"ongoing": 0
},
{
"gid": 215486,
"start": "2021-02-22 18:50:33",
"stop": "2021-02-22 18:50:33",
"host": "10.50.23.5",
"direction": 1,
"impact": 90107632,
"types": [
"NTP Amplification",
"DNS Amplification"
],
"ongoing": 0
}
],
"error": false
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/server/{sid}/incidents
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Get noVNC Console URL
Requires authentication
This function returns a url to a ready-to-embed novnc console. You can put this url in a iframe.
Warning: This url must be accessed within 10 seconds after sending a request. Otherwise the supplied VNC ticket will expire.
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/console" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/console"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/console',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": "https:\/\/hosterapi.de\/novnc\/vnc.html?host=hosterapi.de&password=PVEVNC:604F72EF::e+9gopwLaB77MmLwK9eIUy50PhRjIEJd7ICVKwn3jd1NusqNeS2pIXOTDlCzIi+y6+Pxh\/fvSuCFh07dGVIMfm8a0fl\/ysS7zUmnZVlhVH4odguml\/0POryXQRhvsTWKC7hxeeOr3H1ljx8TIILpR5SXXdZy7Pa5Fo\/8asKuoLPXsGEAA7EcBwyscSGwN6hlHkBkNLKauDt49RyBhDi1Va\/ei7+NSpOaP0oT06B1ORmBMO5f+d0OxF0BI6jsqIBLMWwEL\/wUY+cx\/3KuM4i+UtT8eAhjQHhuIAhn7Q\/N+Mlj0LXXZCV7oBowY2zIBxG2y6Y1EG8Mdw16LEnGlAeHsg==&path=novnc%2Fproxy%2Fpve-dev%2F4007%2F%3Fport%3D5900%26vncticket%3DPVEVNC%253A604F72EF%253A%253Ae%252B9gopwLaB77MmLwK9eIUy50PhRjIEJd7ICVKwn3jd1NusqNeS2pIXOTDlCzIi%252By6%252BPxh%252FfvSuCFh07dGVIMfm8a0fl%252FysS7zUmnZVlhVH4odguml%252F0POryXQRhvsTWKC7hxeeOr3H1ljx8TIILpR5SXXdZy7Pa5Fo%252F8asKuoLPXsGEAA7EcBwyscSGwN6hlHkBkNLKauDt49RyBhDi1Va%252Fei7%252BNSpOaP0oT06B1ORmBMO5f%252Bd0OxF0BI6jsqIBLMWwEL%252FwUY%252Bcx%252F3KuM4i%252BUtT8eAhjQHhuIAhn7Q%252FN%252BMlj0LXXZCV7oBowY2zIBxG2y6Y1EG8Mdw16LEnGlAeHsg%253D%253D"
}
Example response (400):
{
"result": false,
"error": "0xb1: Missing required parameter template"
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/server/{sid}/console
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Remove VM
Requires authentication
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/delete" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"force":false}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/delete"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"force": false
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/delete',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'force' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa3: timeout"
}
HTTP Request
POST api/v1/datacenter/server/{sid}/delete
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
force |
boolean | optional | optional Force delete vm, even if running |
Set Server RDNS
Requires authentication
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/rdns" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"ip":"accusantium","hostname":"atque"}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/rdns"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"ip": "accusantium",
"hostname": "atque"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/rdns',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'ip' => 'accusantium',
'hostname' => 'atque',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (400):
{
"result": false,
"error": "0xb1: Missing required parameter template"
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
POST api/v1/datacenter/server/{sid}/rdns
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
ip |
string | required | IP to set RDNS for (IPv4 only) |
hostname |
string | required | RDNS FQDN |
Upgrade/Downgrade VM
Requires authentication
Please note that downgrading IPs is not supported at this time. Attempts at this will be silently ignored.
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/server/quis/change" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"cpuCores":4,"mem":2048,"disk":"10G","ipCount":2}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/quis/change"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"cpuCores": 4,
"mem": 2048,
"disk": "10G",
"ipCount": 2
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/server/quis/change',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'cpuCores' => 4,
'mem' => 2048,
'disk' => '10G',
'ipCount' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
HTTP Request
PUT api/v1/datacenter/server/{sid}/change
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
cpuCores |
integer | optional | Number of CPU cores |
mem |
integer | optional | Memory size in MB |
disk |
string | optional | Root disk size Note: Downgrading disk size is not allowed due to possible data loss |
ipCount |
integer | optional | Number of IPs to assign |
Start vm
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/start" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/start"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/start',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
PUT api/v1/datacenter/server/{sid}/start
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Gracefully stop VM
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/shutdown" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/shutdown"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/shutdown',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
PUT api/v1/datacenter/server/{sid}/shutdown
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Forcefully stop VM
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/stop" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/stop"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/stop',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
PUT api/v1/datacenter/server/{sid}/stop
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Gracefully restart VM
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
PUT api/v1/datacenter/server/{sid}/reboot
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Forcefully reset VM
Requires authentication
Please note that this command kill all running tasks and force reboot the VM.
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reset" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reset"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reset',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
PUT api/v1/datacenter/server/{sid}/reset
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Force reboot VM
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot/force" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot/force"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reboot/force',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
PUT api/v1/datacenter/server/{sid}/reboot/force
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Reinstall VM
Requires authentication
VM will be reinstalled matching the original config, including OS. Specify a template name to override automatic selection.
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reinstall" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"template":"Debian10.0","hostname":13}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reinstall"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"template": "Debian10.0",
"hostname": 13
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/reinstall',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'template' => 'Debian10.0',
'hostname' => 13,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"status": "queued",
"jobId": 15,
"progress": 0
}
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa3: timeout"
}
HTTP Request
PUT api/v1/datacenter/server/{sid}/reinstall
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
template |
string | optional | optional Template to use (overrides automatic selection) |
hostname |
integer | optional | optional custom hostname, min 4 characters |
Reset root password
Requires authentication
New password will be automatically generated and returned on success. You may give a custom password using the "password" parameter
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/password/reset" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"password":"et"}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/password/reset"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"password": "et"
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/password/reset',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'password' => 'et',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"status": "success",
"password": "{password}"
}
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to set config on vm"
}
HTTP Request
PUT api/v1/datacenter/server/{sid}/password/reset
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
password |
string | optional | optional password, minimum 6 characters |
List backups for VM
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/list" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/list"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/list',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": [
1606685300,
1606585800,
1606575200
]
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/server/{sid}/backups/list
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Get backup task status
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/status" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/status"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/status',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"status": "pending",
"progress": 0
}
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/server/{sid}/backups/status
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Create backup
Requires authentication
Example request:
curl -X PUT \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/create" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/create"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "PUT",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/create',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (400):
{
"result": false,
"error": "0xb1: Missing required parameter template"
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa3: timeout"
}
HTTP Request
PUT api/v1/datacenter/server/{sid}/backups/create
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Restore VM from backup
Requires authentication
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/restore" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"backup":1606345164}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/restore"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"backup": 1606345164
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/backups/restore',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'backup' => 1606345164,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": "pending"
}
Example response (400):
{
"result": false,
"error": "0xa5: no target backup defined"
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
Example response (500):
{
"result": false,
"error": "0xa1: failed to send {signal} signal to vm"
}
HTTP Request
POST api/v1/datacenter/server/{sid}/backups/restore
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
backup |
integer | required | Backup to restore (unix timestamp) |
List available ISO for VM
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/iso" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/iso"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/iso',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": [
{
"id": "ISOs:iso\/debian-11.5.0-amd64-netinst-0.iso",
"name": "debian-11.5.0-amd64-netinst.iso"
}
]
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/server/{sid}/iso
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Insert ISO in VM
Requires authentication
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/iso" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"isoId":"\"ISOs:iso\/debian-11.5.0-amd64-netinst-0.iso\""}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/iso"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"isoId": "\"ISOs:iso\/debian-11.5.0-amd64-netinst-0.iso\""
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/iso',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'isoId' => '"ISOs:iso/debian-11.5.0-amd64-netinst-0.iso"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true,
"rebooted": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
POST api/v1/datacenter/server/{sid}/iso
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
isoId |
string | required | ISO ID to insert |
Remove ISO from VM
Requires authentication
Example request:
curl -X DELETE \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/iso" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/iso"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/iso',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
DELETE api/v1/datacenter/server/{sid}/iso
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
List scheduled tasks for VM
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/server/4001/scheduled" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/scheduled"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/scheduled',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": [
{
"id": 1,
"interval": "DAILY",
"command": "BACKUP",
"execution_last": null,
"execution_next": "2022-07-13T15:35:48.000000Z"
}
]
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/datacenter/server/{sid}/scheduled
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Create scheduled tasks for VM
Requires authentication
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/scheduled" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"command":"quasi","interval":"iure"}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/4001/scheduled"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"command": "quasi",
"interval": "iure"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/datacenter/server/4001/scheduled',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'command' => 'quasi',
'interval' => 'iure',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
POST api/v1/datacenter/server/{sid}/scheduled
URL Parameters
Parameter | Status | Description |
---|---|---|
sid |
required | Server ID |
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
command |
required | optional | command to execute, available 'RESTART','BACKUP','SHUTDOWN','START' |
interval |
required | optional | interval, available 'DAILY','TWODAYS','THREEDAYS','WEEKLY','TWOWEEKS','MONTHLY','TWOMONTHS','THREEMONTHS' |
Delete scheduled task for VM
Requires authentication
Example request:
curl -X DELETE \
"https://reseller.hosterapi.de/api/v1/datacenter/server/1/scheduled/1" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server/1/scheduled/1"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://reseller.hosterapi.de/api/v1/datacenter/server/1/scheduled/1',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": true
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
DELETE api/v1/datacenter/server/{sid}/scheduled/{VMScheduledTask}
Create new VM
Requires authentication
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/datacenter/server" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"location":"1","template":"Debian10.0","cpuCores":4,"mem":2048,"disk":"10G","ipCount":2,"hostname":"doloremque","sshKey":"voluptatibus"}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"location": "1",
"template": "Debian10.0",
"cpuCores": 4,
"mem": 2048,
"disk": "10G",
"ipCount": 2,
"hostname": "doloremque",
"sshKey": "voluptatibus"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/datacenter/server',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'location' => '1',
'template' => 'Debian10.0',
'cpuCores' => 4,
'mem' => 2048,
'disk' => '10G',
'ipCount' => 2,
'hostname' => 'doloremque',
'sshKey' => 'voluptatibus',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"status": "queued",
"jobId": 15,
"progress": 0
}
}
Example response (400):
{
"result": false,
"error": "0xb1: Missing required parameter template"
}
HTTP Request
POST api/v1/datacenter/server
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
location |
string | optional | Location ID |
template |
string | required | OS Template Name |
cpuCores |
integer | required | Number of CPU cores |
mem |
integer | required | Memory size in MB |
disk |
string | required | Root disk size |
ipCount |
integer | required | Number of IPs to assign |
hostname |
string | optional | optional custom hostname, min 4 characters |
sshKey |
string | optional | optional custom ssh public key - if the key is invalid it will be ignored during installation |
List all assigned VMs
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/server" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/server"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/server',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": [
4001,
4002,
4003
]
}
Example response (200):
{
"result": []
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
HTTP Request
GET api/v1/datacenter/server
Get available template list
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/datacenter/templates" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/datacenter/templates"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/datacenter/templates',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": [
"Debian10.0"
]
}
HTTP Request
GET api/v1/datacenter/templates
Software
List available software to install
Requires authentication
Example request:
curl -X GET \
-G "https://reseller.hosterapi.de/api/v1/software/list" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
const url = new URL(
"https://reseller.hosterapi.de/api/v1/software/list"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://reseller.hosterapi.de/api/v1/software/list',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
GET api/v1/software/list
Install chosen software package
Requires authentication
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/software/install" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"sid|ip":"4001","package":"ts3","password":"testing123","port":22}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/software/install"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"sid|ip": "4001",
"package": "ts3",
"password": "testing123",
"port": 22
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/software/install',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'sid|ip' => '4001',
'package' => 'ts3',
'password' => 'testing123',
'port' => 22,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"status": "queued",
"jobId": 15,
"progress": 0
}
}
Example response (400):
{
"result": false,
"error": "0xb1: Missing required parameter template"
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
POST api/v1/software/install
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
sid|ip |
string | required | Server ID or IP |
package |
string | required | Package to install |
password |
string | required | SSH root password for server |
port |
integer | optional | optional SSH port for server |
Uninstall chosen software package
Requires authentication
Example request:
curl -X POST \
"https://reseller.hosterapi.de/api/v1/software/uninstall" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"sid|ip":"4001","package":"ts3","password":"testing123","port":22}'
const url = new URL(
"https://reseller.hosterapi.de/api/v1/software/uninstall"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"sid|ip": "4001",
"package": "ts3",
"password": "testing123",
"port": 22
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://reseller.hosterapi.de/api/v1/software/uninstall',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {token}',
],
'json' => [
'sid|ip' => '4001',
'package' => 'ts3',
'password' => 'testing123',
'port' => 22,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"result": {
"status": "queued",
"jobId": 15,
"progress": 0
}
}
Example response (400):
{
"result": false,
"error": "0xb1: Missing required parameter template"
}
Example response (401):
{
"result": false,
"error": "0x03: unauthorized"
}
Example response (404):
{
"result": false,
"error": "0x01: no vm with id 4001 found"
}
HTTP Request
POST api/v1/software/uninstall
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
sid|ip |
string | required | Server ID or IP |
package |
string | required | Package to install |
password |
string | required | SSH root password for server |
port |
integer | optional | optional SSH port for server |