diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-22 17:08:55 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:44 +0200 |
| commit | 1ddbbd3563af77a218020021ea50a8832900b4db (patch) | |
| tree | 5647f9cfde2de3918eeeac58d6c598bb55e50d82 /src/api/routes/datacenters.js | |
| parent | 602c3eb9327a3681f5a220e13b8291bb60643cd7 (diff) | |
Add route logic for construction routes
Diffstat (limited to 'src/api/routes/datacenters.js')
| -rw-r--r-- | src/api/routes/datacenters.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/api/routes/datacenters.js b/src/api/routes/datacenters.js new file mode 100644 index 00000000..df621a62 --- /dev/null +++ b/src/api/routes/datacenters.js @@ -0,0 +1,26 @@ +import {sendRequest} from "../index"; +import {getById} from "./util"; + +export function getDatacenter(datacenterId) { + return getById("/datacenters/{datacenterId}", {datacenterId}); +} + +export function getRoomsOfDatacenter(datacenterId) { + return getById("/datacenters/{datacenterId}/rooms", {datacenterId}); +} + +export function addRoomToDatacenter(room) { + return sendRequest({ + path: "/datacenters/{datacenterId}/rooms", + method: "POST", + parameters: { + body: { + room + }, + path: { + datacenterId: room.datacenterId + }, + query: {} + } + }); +} |
