diff --git a/README.md b/README.md index 01c302d..750ebfa 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ A HTTP server based on [JSON Server](https://github.com/typicode/json-server) th | `GET /vswitch/{vswitch-id}` | [get-vswitch-vswitch-id](https://robot.your-server.de/doc/webservice/de.html#get-vswitch-vswitch-id) | | `POST /vswitch/{vswitch-id}` | [post-vswitch-vswitch-id](https://robot.your-server.de/doc/webservice/de.html#post-vswitch-vswitch-id) | | `DELETE /vswitch/{vswitch-id}` | [delete-vswitch-vswitch-id](https://robot.your-server.de/doc/webservice/de.html#delete-vswitch-vswitch-id) | +| `GET /server/{server-ip}` | [get-server-server-ip](https://robot.your-server.de/doc/webservice/de.html#get-server-server-ip) | +| `POST /server/{server-ip}` | [post-server-server-ip](https://robot.your-server.de/doc/webservice/de.html#post-server-server-ip) | ## Authentication diff --git a/src/db.json b/src/db.json index c924aa2..0152906 100644 --- a/src/db.json +++ b/src/db.json @@ -1,58 +1,8 @@ { "vswitch": [], - "rescue": [ - { - "id": "123.123.123.123", - "server_ip": "123.123.123.123", - "server_number": 321, - "os": [ - "linux", - "freebsd", - "vkvm" - ], - "arch": [ - 64, - 32 - ], - "active": false, - "password": null, - "authorized_key": [], - "host_key": [] - }, - { - "id": "124.124.124.124", - "server_ip": "124.124.124.124", - "server_number": 69, - "os": "linux", - "arch": 64, - "active": true, - "password": "qwertz", - "authorized_key": [ - { - "key": { - "fingerprint": "fi:ng:er:pr:in:t0:00:00:00:00:00:00:00:00:00:00", - "name": "admin", - "size": 4096, - "type": "RSA" - } - } - ], - "host_key": [] - } - ], - "reset": [ - { - "id": "123.123.123.123", - "server_ip": "123.123.123.123", - "server_number": 111, - "type": [ - "power", - "hw", - "man" - ], - "operating_status": "running" - } - ], + "rescue": [], + "reset": [], "firewall_template": [], - "firewall": [] + "firewall": [], + "server": [] } diff --git a/src/ids.json b/src/ids.json index a214e8e..fbc1b71 100644 --- a/src/ids.json +++ b/src/ids.json @@ -1,5 +1,6 @@ { "firewall": "server_ip", "rescue": "server_ip", - "reset": "server_ip" + "reset": "server_ip", + "server": "server_ip" } diff --git a/src/routes.json b/src/routes.json index 1ebc191..f5cb351 100644 --- a/src/routes.json +++ b/src/routes.json @@ -8,5 +8,7 @@ "/firewall": "/firewall", "/firewall/:id": "/firewall/:id", "/vswitch": "/vswitch", - "/vswitch/:id": "/vswitch/:id" + "/vswitch/:id": "/vswitch/:id", + "/server": "/server", + "/server/:id": "/server/:id" } diff --git a/test/resources.json b/test/resources.json index c6b44f1..5535cbd 100644 --- a/test/resources.json +++ b/test/resources.json @@ -1,9 +1,9 @@ { "vswitch": { "data": { - "name":"my vSwitch", - "vlan":4000, - "cancelled":"false" + "name": "my vSwitch", + "vlan": 4000, + "cancelled": "false" } }, "reset": { @@ -69,7 +69,7 @@ }, "rescue": { "id": "server_ip", - "data": { + "data": { "server_ip": "123.123.123.123", "server_number": "123", "os": [ @@ -83,5 +83,30 @@ ], "active": "false" } + }, + "server": { + "id": "server_ip", + "data": { + "server_ip": "123.123.123.123", + "server_number": 321, + "server_name": "server1", + "product": "DS 3000", + "dc": "NBG1-DC1", + "traffic": "5 TB", + "flatrate": "true", + "status": "ready", + "throttled": "true", + "cancelled": "false", + "paid_until": "2010-09-02", + "ip": [ + "123.123.123.123" + ], + "subnet": [ + { + "ip": "2a01:4f8:111:4221::", + "mask": "64" + } + ] + } } }