NAV
bash javascript php

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

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","ipCount":"2","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",
    "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',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'id' => 9,
            'template' => 'Debian Buster',
            'ipCount' => '2',
            '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
ipCount string optional optional IP Count
hostname string optional optional Server Hostname

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": {
        "state": "halted"
    }
}

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

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

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"
    }
}

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 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":true}'
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": true
}

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' => true,
        ],
    ]
);
$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":"voluptatem","hostname":"velit"}'
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": "voluptatem",
    "hostname": "velit"
}

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' => 'voluptatem',
            'hostname' => 'velit',
        ],
    ]
);
$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/eligendi/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/eligendi/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/eligendi/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

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"}'
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"
}

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',
        ],
    ]
);
$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)

Reset root password


Requires authentication New password will be automatically generated and returned on success

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}"
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}",
};

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/password/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": {
        "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

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)

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 '{"template":"Debian10.0","cpuCores":4,"mem":2048,"disk":"10G","ipCount":2}'
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 = {
    "template": "Debian10.0",
    "cpuCores": 4,
    "mem": 2048,
    "disk": "10G",
    "ipCount": 2
}

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' => [
            'template' => 'Debian10.0',
            'cpuCores' => 4,
            'mem' => 2048,
            'disk' => '10G',
            'ipCount' => 2,
        ],
    ]
);
$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
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

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