diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-13 22:18:26 +0300 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-08-13 22:18:26 +0300 |
| commit | ac1e2b2f00d17ae3f7729b00d900f5072847278b (patch) | |
| tree | 2bd3480a4c58320a982187c4034d061b5fe33d65 /opendc-api-spec.json | |
| parent | 081dea194ba8f63878735775416c12faa769b6b3 (diff) | |
Flatten API
Flattens the nested structure of the API out into a large group of base-endpoints. This reduces the number of redundant parameters needed to make a single call on a nested resource, while preserving the same expressiveness.
Diffstat (limited to 'opendc-api-spec.json')
| -rw-r--r-- | opendc-api-spec.json | 648 |
1 files changed, 23 insertions, 625 deletions
diff --git a/opendc-api-spec.json b/opendc-api-spec.json index 7a8cd4d8..93a0207d 100644 --- a/opendc-api-spec.json +++ b/opendc-api-spec.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "0.1.0", + "version": "0.2.0", "title": "OpenDC API", "description": "OpenDC is an open-source datacenter simulator for education, featuring real-time online collaboration, diverse simulation models, and detailed performance feedback statistics." }, @@ -637,7 +637,7 @@ } } }, - "/simulations/{simulationId}/datacenters/{datacenterId}": { + "/datacenters/{datacenterId}": { "get": { "tags": [ "datacenterDesign" @@ -645,13 +645,6 @@ "description": "Get this Datacenter.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "datacenterId", "in": "path", "description": "Datacenter's ID.", @@ -681,7 +674,7 @@ } } }, - "/simulations/{simulationId}/datacenters/{datacenterId}/rooms": { + "/datacenters/{datacenterId}/rooms": { "get": { "tags": [ "datacenterDesign", @@ -690,13 +683,6 @@ "description": "Get this Datacenter's Rooms.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "datacenterId", "in": "path", "description": "Datacenter's ID.", @@ -736,13 +722,6 @@ "description": "Add a Room.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "datacenterId", "in": "path", "description": "Datacenter's ID.", @@ -781,7 +760,7 @@ } } }, - "/simulations/{simulationId}/datacenters/{datacenterId}/rooms/{roomId}": { + "/rooms/{roomId}": { "get": { "tags": [ "datacenterDesign", @@ -790,20 +769,6 @@ "description": "Get this Room.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { "name": "roomId", "in": "path", "description": "Room's ID.", @@ -840,20 +805,6 @@ "description": "Update a Room's name or type.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { "name": "roomId", "in": "path", "description": "Room's ID.", @@ -906,20 +857,6 @@ "description": "Delete this Room.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { "name": "roomId", "in": "path", "description": "Room's ID.", @@ -949,7 +886,7 @@ } } }, - "/simulations/{simulationId}/datacenters/{datacenterId}/rooms/{roomId}/tiles": { + "/rooms/{roomId}/tiles": { "get": { "tags": [ "datacenterDesign", @@ -959,20 +896,6 @@ "description": "Get this Room's Tiles.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { "name": "roomId", "in": "path", "description": "Room's ID.", @@ -1013,20 +936,6 @@ "description": "Add a Tile to this Room.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { "name": "roomId", "in": "path", "description": "Room's ID.", @@ -1068,7 +977,7 @@ } } }, - "/simulations/{simulationId}/datacenters/{datacenterId}/rooms/{roomId}/tiles/{tileId}": { + "/tiles/{tileId}": { "get": { "tags": [ "datacenterDesign", @@ -1077,27 +986,6 @@ "description": "Get this Tile.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1134,27 +1022,6 @@ "description": "Delete this Tile.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1184,7 +1051,7 @@ } } }, - "/simulations/{simulationId}/datacenters/{datacenterId}/rooms/{roomId}/tiles/{tileId}/cooling-item": { + "/tiles/{tileId}/cooling-item": { "get": { "tags": [ "tiles", @@ -1193,27 +1060,6 @@ "description": "Get this Tile's Cooling Item.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1250,27 +1096,6 @@ "description": "Add a Cooling Item to this Tile if it is empty.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1319,27 +1144,6 @@ "description": "Update which Cooling Item is on this Tile.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1388,27 +1192,6 @@ "description": "Delete this Tile's Cooling Item.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1438,7 +1221,7 @@ } } }, - "/simulations/{simulationId}/datacenters/{datacenterId}/rooms/{roomId}/tiles/{tileId}/psu": { + "/tiles/{tileId}/psu": { "get": { "tags": [ "tiles", @@ -1447,27 +1230,6 @@ "description": "Get this Tile's PSU.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1504,27 +1266,6 @@ "description": "Add a PSU to this Tile if it is empty.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1573,27 +1314,6 @@ "description": "Update which PSU is on this Tile.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1642,27 +1362,6 @@ "description": "Delete this Tile's PSU.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1692,7 +1391,7 @@ } } }, - "/simulations/{simulationId}/datacenters/{datacenterId}/rooms/{roomId}/tiles/{tileId}/rack": { + "/tiles/{tileId}/rack": { "get": { "tags": [ "tiles", @@ -1701,27 +1400,6 @@ "description": "Get this Tile's Rack.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1758,27 +1436,6 @@ "description": "Add a Rack to this Tile if it is empty.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1834,27 +1491,6 @@ "description": "Update the Rack on this Tile.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1910,27 +1546,6 @@ "description": "Delete this Tile's Rack.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -1960,7 +1575,7 @@ } } }, - "/simulations/{simulationId}/datacenters/{datacenterId}/rooms/{roomId}/tiles/{tileId}/rack/machines": { + "/tiles/{tileId}/rack/machines": { "get": { "tags": [ "objects", @@ -1969,27 +1584,6 @@ "description": "Get this Rack's Machines.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -2029,27 +1623,6 @@ "description": "Add a Machine to this rack", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -2091,7 +1664,7 @@ } } }, - "/simulations/{simulationId}/datacenters/{datacenterId}/rooms/{roomId}/tiles/{tileId}/rack/machines/{position}": { + "/tiles/{tileId}/rack/machines/{position}": { "get": { "tags": [ "machines" @@ -2099,27 +1672,6 @@ "description": "Get the Machine at this location in this Rack.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -2159,27 +1711,6 @@ "description": "Update the Machine at this location in this Rack.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -2234,27 +1765,6 @@ "description": "Delete the Machine at this location in this Rack.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "datacenterId", - "in": "path", - "description": "Datacenter's ID.", - "required": true, - "type": "integer" - }, - { - "name": "roomId", - "in": "path", - "description": "Room's ID.", - "required": true, - "type": "integer" - }, - { "name": "tileId", "in": "path", "description": "Tile's ID.", @@ -2372,7 +1882,7 @@ } } }, - "/simulations/{simulationId}/experiments/{experimentId}": { + "/experiments/{experimentId}": { "get": { "tags": [ "experiments" @@ -2380,13 +1890,6 @@ "description": "Get this Experiment.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "experimentId", "in": "path", "description": "Experiment's ID.", @@ -2422,13 +1925,6 @@ "description": "Update this Experiment's Path, Trace, Scheduler, and/ or name.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "experimentId", "in": "path", "description": "Experiment's ID.", @@ -2486,13 +1982,6 @@ "description": "Delete this Experiment.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "experimentId", "in": "path", "description": "Experiment's ID.", @@ -2519,7 +2008,7 @@ } } }, - "/simulations/{simulationId}/experiments/{experimentId}/last-simulated-tick": { + "/experiments/{experimentId}/last-simulated-tick": { "get": { "tags": [ "simulations" @@ -2527,13 +2016,6 @@ "description": "Get this Experiment's last simulated tick.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "experimentId", "in": "path", "description": "Experiment's ID.", @@ -2567,7 +2049,7 @@ } } }, - "/simulations/{simulationId}/experiments/{experimentId}/machine-states": { + "/experiments/{experimentId}/machine-states": { "get": { "tags": [ "simulations", @@ -2577,13 +2059,6 @@ "description": "Get this experiment's Machine States.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "experimentId", "in": "path", "description": "Experiment's ID.", @@ -2644,7 +2119,7 @@ } } }, - "/simulations/{simulationId}/experiments/{experimentId}/rack-states": { + "/experiments/{experimentId}/rack-states": { "get": { "tags": [ "simulations", @@ -2654,13 +2129,6 @@ "description": "Get this Experiment's Rack States.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "experimentId", "in": "path", "description": "Experiment's ID.", @@ -2714,7 +2182,7 @@ } } }, - "/simulations/{simulationId}/experiments/{experimentId}/room-states": { + "/experiments/{experimentId}/room-states": { "get": { "tags": [ "simulations", @@ -2724,13 +2192,6 @@ "description": "Get this Experiment's Room States.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "experimentId", "in": "path", "description": "Experiment's ID.", @@ -2777,7 +2238,7 @@ } } }, - "/simulations/{simulationId}/experiments/{experimentId}/task-states": { + "/experiments/{experimentId}/task-states": { "get": { "tags": [ "simulations", @@ -2787,13 +2248,6 @@ "description": "Get this Experiment's Task States.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "experimentId", "in": "path", "description": "Experiment's ID.", @@ -2901,7 +2355,7 @@ } } }, - "/simulations/{simulationId}/paths/{pathId}": { + "/paths/{pathId}": { "get": { "tags": [ "paths" @@ -2909,13 +2363,6 @@ "description": "Get this Path.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "pathId", "in": "path", "description": "Path's ID.", @@ -2945,7 +2392,7 @@ } } }, - "/simulations/{simulationId}/paths/{pathId}/branches": { + "/paths/{pathId}/branches": { "get": { "tags": [ "paths" @@ -2953,13 +2400,6 @@ "description": "Get this Path's branches - Paths that start with this Path's Sections.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "pathId", "in": "path", "description": "Path's ID.", @@ -2998,13 +2438,6 @@ "description": "Create a new Path that branches off of this Path at the specified tick.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "pathId", "in": "path", "description": "Path's ID.", @@ -3047,7 +2480,7 @@ } } }, - "/simulations/{simulationId}/paths/{pathId}/sections": { + "/paths/{pathId}/sections": { "get": { "tags": [ "paths" @@ -3055,13 +2488,6 @@ "description": "Get this Path's Sections.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { "name": "pathId", "in": "path", "description": "Path's ID.", @@ -3091,7 +2517,7 @@ } } }, - "/simulations/{simulationId}/paths/{pathId}/sections/{sectionId}": { + "/sections/{sectionId}": { "get": { "tags": [ "simulations" @@ -3099,20 +2525,6 @@ "description": "Get this Section.", "parameters": [ { - "name": "simulationId", - "in": "path", - "description": "Simulation's ID.", - "required": true, - "type": "integer" - }, - { - "name": "pathId", - "in": "path", - "description": "Path's ID.", - "required": true, - "type": "integer" - }, - { "name": "sectionId", "in": "path", "description": "Section's ID.", @@ -3251,7 +2663,7 @@ } } }, - "/traces/{traceId}/jobs/{jobId}": { + "/jobs/{jobId}": { "get": { "tags": [ "experiments" @@ -3259,13 +2671,6 @@ "description": "Get this Job.", "parameters": [ { - "name": "traceId", - "in": "path", - "description": "Trace's ID.", - "required": true, - "type": "integer" - }, - { "name": "jobId", "in": "path", "description": "Job's ID.", @@ -3289,7 +2694,7 @@ } } }, - "/traces/{traceId}/jobs/{jobId}/tasks": { + "/jobs/{jobId}/tasks": { "get": { "tags": [ "experiments" @@ -3297,13 +2702,6 @@ "description": "Get this Job's Tasks.", "parameters": [ { - "name": "traceId", - "in": "path", - "description": "Trace's ID.", - "required": true, - "type": "integer" - }, - { "name": "jobId", "in": "path", "description": "Job's ID.", |
