API / Endpoints

The Zare API exposes all functionality of the manager via a RESTful API


Introduction


All Servers

GET https://api.zare.co.uk/servers/[secret_key]

Result

{ "status": "OK", "server": [ { "id": 1, "hostname": "demo.zare.co.uk", "ip": "127.0.0.1", "os":"CentOS 6.X (64 Bit)", "region": "BRS-1", "memory": 1024, "disk": 30, "cores": 1, "status": "active", "transfer: 3000, "transfer_total": 520, "transfer_out": 500 } ] }


Single Server

POST https://api.zare.co.uk/servers/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all VPS's over the API or via the URL bar in the Zare manager.

Result

{ "status": "OK", "server": [ { "id": 1, "hostname": "demo.zare.co.uk", "ip": "127.0.0.1", "os":"CentOS 6.X (64 Bit)", "region": "BRS-1", "memory": 1024, "disk": 30, "cores": 1, "status": "active", "transfer: 3000, "transfer_total": 520, "transfer_out": 500 } ] }


GET Servers History

GET https://api.zare.co.uk/history/[secret_key]/[server_id]

Result

{ "status": "OK", "history": [ { "server_id": "1", "event": "Power Off", "timestamp": "2014-03-10 22:16:21", "IP": "127.0.0.1" }, { "server_id": "1", "event": "Power Cycle", "timestamp": "2014-03-10 22:54:20", "IP": "127.0.0.1" }, { "server_id": "1", "event": "Power Cycle", "timestamp": "2014-03-10 23:03:42", "IP": "127.0.0.1" } ] }


Power Cycle

POST https://api.zare.co.uk/powercycle/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all VPS's over the API or via the URL bar in the Zare manager.

Result

{ "status": "OK", "result": "Your cloud server was successfully power cycled." }


Power Off

POST https://api.zare.co.uk/poweroff/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all VPS's over the API or via the URL bar in the Zare manager.

Result

{ "status": "OK", "result": "Your cloud server was successfully powered off." }

Destroy

POST https://api.zare.co.uk/destroy/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all VPS's over the API or via the URL bar in the Zare manager.

Result

{ "status": "OK", "result": "Your cloud server was successfully destroyed." }

DNS

POST https://api.zare.co.uk/dns/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all VPS's over the API or via the URL bar in the Zare manager.
content The rDNS record that you wish to set.

Result

{ "status": "OK", "result": "The rDNS record was successfully updated." }

Rebuild

POST https://api.zare.co.uk/rebuild/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all VPS's over the API or via the URL bar in the Zare manager.
os_id The ID of the OS you want to install, these can be found in the table below.

Result

{ "status": "OK", "result": { "password": "password" } }

Deploy

POST https://api.zare.co.uk/deploy/[secret_key]
Parameter Description
hostname Valid hostname (server.zare.co.uk)
os Valid OS ID from the list below.
plan_id Lowest plan is 1 and highest is 7 (1 = 512MB RAM package)
location The location ID of the region you wish to setup the VPS in (Bristol, UK = 1, London, UK = 2)
OS ID Name
1 CentOS 5 (32 Bit)
2 CentOS 5 (64 Bit)
3 CentOS 6 (32 Bit)
4 CentOS 6 (64 Bit)
5 CentOS 7 (32 Bit)
6 CentOS 7 (64 Bit)
7 Debian 7 (64Bit)
8 Debian 6 (64Bit)
9 Ubuntu 12.04 (64Bit)
10 Ubuntu 14.04 (64Bit)
11 Fedora 20 (64 Bit)

Result

{ "status":"OK", "result":{ "uid":"YOUR-UID", "vsid":"1", "ip":"185.38.151.XXX", "node":"UK-VM-1", "hostname":"zare.co.uk", "plan_id":"1", "hourly":"0.0035", "memory":"512", "disk":"10", "cores":"1", "transfer":"1000", "os":"Debian 6 (64Bit)", "region":"Bristol, UK", "status":"active", "id":"VPS_ID", "root_password":"PASSWORD" } }

DDoS Check

POST https://api.zare.co.uk/protection/check/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all cloud servers over the API or via the URL bar in the Zare manager.
ip The root or additional IP you wish to check is under a DDoS attack. This must be assigned to the server ID above.

Result

{ "success":true, "under_attack": true }

DDoS Attack Info

POST https://api.zare.co.uk/protection/attacks/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all cloud servers over the API or via the URL bar in the Zare manager.
ip The root or additional IP you wish to check is under a DDoS attack. This must be assigned to the server ID above.

Result

{ "success": true, "attacks": [ { "id": "1", "ip": "xxx.xxx.xxx.xxx", "start": "2016-08-03 08:00:52", "duration": "00:05:36", "type": "Abnormally high rate of UDP incoming packets", "active": "0" } ] }

Dedicated Servers

Get Servers

GET https://api.zare.co.uk/dedicated/servers/[secret_key]/[server_id[optional]]

Result

{ "status":"OK", "server": { "id":"84", "hostname":"demo.zare.co.uk", "IP":"example", "processor":"Intel Core i7-4790", "memory":"16", "drives":"1TB HDD", "OS":"Debian 7 (64 Bit)", "bandwidth":"10000", "total_in":"210GB", "total_out":"659GB", "current_bw_in":"2.2Mbits", "current_bw_out":"5.9Mbits", "graph_binary":"graph data", "status":"", "additional_ips": [{ "ip": "1.1.1.1.dedicated.zare.com", "rdns": "", "ddos_mode": "2", "layer_7": "1" }, { "ip": "1.1.1.1", "rdns": "1.1.1.1.dedicated.zare.com", "ddos_mode": "2", "layer_7": "1" }, "deployed_time":"2015-03-10 21:45:38" } }


Power Cycle

GET https://api.zare.co.uk/dedicated/powercycle/[secret_key]/[server_id]

Result

{ "status": "OK", "result": "Your dedicated server was successfully power cycled." }


Power Off

GET https://api.zare.co.uk/dedicated/poweroff/[secret_key]/[server_id]

Result

{ "status": "OK", "result": "Your dedicated server was successfully powered off." }


DDoS Filter

POST https://api.zare.co.uk/dedicated/filter/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all dedicated servers over the API or via the URL bar in the Zare manager.
setting DDoS mode = (1=always on or 2=sensor mode) or Layer mode = (0=off on or 1=on)
type Type of filter (mode=sensor mode or layer=layer7 on/off)
ip The root or additional IP you wish to change the ddos/layer mode on. This must be assigned to the server ID above.

Result

{ "status": "OK", "result": "Your IP has been successfully updated." }


rDNS

POST https://api.zare.co.uk/dedicated/dns/ptr/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all dedicated servers over the API or via the URL bar in the Zare manager.
ip The root or additional IP you wish to change the ddos/layer mode on. This must be assigned to the server ID above.
record The PRT rDNS record content, example (yourserver.yourdomain.com). This must be a fully qualified domain name.

Result

{ "status": "OK", "result": "Your rDNS record has been updated." }

DDoS Check

POST https://api.zare.co.uk/dedicated/protection/check/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all cloud servers over the API or via the URL bar in the Zare manager.
ip The root or additional IP you wish to check is under a DDoS attack. This must be assigned to the server ID above.

Result

{ "success":true, "under_attack": true }

DDoS Attack Info

POST https://api.zare.co.uk/dedicated/protection/attacks/[secret_key]
Parameter Description
server_id This is your servers unique ID, you can find this by listing all cloud servers over the API or via the URL bar in the Zare manager.
ip The root or additional IP you wish to check is under a DDoS attack. This must be assigned to the server ID above.

Result

{ "success": true, "attacks": [ { "id": "1", "ip": "xxx.xxx.xxx.xxx", "start": "2016-08-03 08:00:52", "duration": "00:05:36", "type": "Abnormally high rate of UDP incoming packets", "active": "0" } ] }

Signup and get yourself a DDoS protected server today!

Sign up