summaryrefslogtreecommitdiff
path: root/opendc
diff options
context:
space:
mode:
Diffstat (limited to 'opendc')
-rw-r--r--opendc/api/v2/__init__.py (renamed from opendc/api/v1/__init__.py)0
-rw-r--r--opendc/api/v2/datacenters/__init__.py (renamed from opendc/api/v1/datacenters/__init__.py)0
-rw-r--r--opendc/api/v2/datacenters/datacenterId/__init__.py (renamed from opendc/api/v1/datacenters/datacenterId/__init__.py)0
-rw-r--r--opendc/api/v2/datacenters/datacenterId/endpoint.py (renamed from opendc/api/v1/datacenters/datacenterId/endpoint.py)0
-rw-r--r--opendc/api/v2/datacenters/datacenterId/rooms/__init__.py (renamed from opendc/api/v1/datacenters/datacenterId/rooms/__init__.py)0
-rw-r--r--opendc/api/v2/datacenters/datacenterId/rooms/endpoint.py (renamed from opendc/api/v1/datacenters/datacenterId/rooms/endpoint.py)0
-rw-r--r--opendc/api/v2/experiments/__init__.py (renamed from opendc/api/v1/experiments/__init__.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/__init__.py (renamed from opendc/api/v1/experiments/experimentId/__init__.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/endpoint.py (renamed from opendc/api/v1/experiments/experimentId/endpoint.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/last-simulated-tick/__init__.py (renamed from opendc/api/v1/experiments/experimentId/last-simulated-tick/__init__.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/last-simulated-tick/endpoint.py (renamed from opendc/api/v1/experiments/experimentId/last-simulated-tick/endpoint.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/machine-states/__init__.py (renamed from opendc/api/v1/experiments/experimentId/machine-states/__init__.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/machine-states/endpoint.py (renamed from opendc/api/v1/experiments/experimentId/machine-states/endpoint.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/rack-states/__init__.py (renamed from opendc/api/v1/experiments/experimentId/rack-states/__init__.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/rack-states/endpoint.py (renamed from opendc/api/v1/experiments/experimentId/rack-states/endpoint.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/room-states/__init__.py (renamed from opendc/api/v1/experiments/experimentId/room-states/__init__.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/room-states/endpoint.py (renamed from opendc/api/v1/experiments/experimentId/room-states/endpoint.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/statistics/__init__.py (renamed from opendc/api/v1/experiments/experimentId/statistics/__init__.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/statistics/task-durations/__init__.py (renamed from opendc/api/v1/experiments/experimentId/statistics/task-durations/__init__.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/statistics/task-durations/endpoint.py (renamed from opendc/api/v1/experiments/experimentId/statistics/task-durations/endpoint.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/task-states/__init__.py (renamed from opendc/api/v1/experiments/experimentId/task-states/__init__.py)0
-rw-r--r--opendc/api/v2/experiments/experimentId/task-states/endpoint.py (renamed from opendc/api/v1/experiments/experimentId/task-states/endpoint.py)0
-rw-r--r--opendc/api/v2/jobs/__init__.py (renamed from opendc/api/v1/jobs/__init__.py)0
-rw-r--r--opendc/api/v2/jobs/jobId/__init__.py (renamed from opendc/api/v1/jobs/jobId/__init__.py)0
-rw-r--r--opendc/api/v2/jobs/jobId/endpoint.py (renamed from opendc/api/v1/jobs/jobId/endpoint.py)0
-rw-r--r--opendc/api/v2/jobs/jobId/tasks/__init__.py (renamed from opendc/api/v1/jobs/jobId/tasks/__init__.py)0
-rw-r--r--opendc/api/v2/jobs/jobId/tasks/endpoint.py (renamed from opendc/api/v1/jobs/jobId/tasks/endpoint.py)0
-rw-r--r--opendc/api/v2/paths.json (renamed from opendc/api/v1/paths.json)0
-rw-r--r--opendc/api/v2/paths/__init__.py (renamed from opendc/api/v1/paths/__init__.py)0
-rw-r--r--opendc/api/v2/paths/pathId/__init__.py (renamed from opendc/api/v1/paths/pathId/__init__.py)0
-rw-r--r--opendc/api/v2/paths/pathId/branches/__init__.py (renamed from opendc/api/v1/paths/pathId/branches/__init__.py)0
-rw-r--r--opendc/api/v2/paths/pathId/branches/endpoint.py (renamed from opendc/api/v1/paths/pathId/branches/endpoint.py)0
-rw-r--r--opendc/api/v2/paths/pathId/endpoint.py (renamed from opendc/api/v1/paths/pathId/endpoint.py)0
-rw-r--r--opendc/api/v2/paths/pathId/sections/__init__.py (renamed from opendc/api/v1/paths/pathId/sections/__init__.py)0
-rw-r--r--opendc/api/v2/paths/pathId/sections/endpoint.py (renamed from opendc/api/v1/paths/pathId/sections/endpoint.py)0
-rw-r--r--opendc/api/v2/room-types/__init__.py (renamed from opendc/api/v1/room-types/__init__.py)0
-rw-r--r--opendc/api/v2/room-types/endpoint.py (renamed from opendc/api/v1/room-types/endpoint.py)0
-rw-r--r--opendc/api/v2/room-types/name/__init__.py (renamed from opendc/api/v1/room-types/name/__init__.py)0
-rw-r--r--opendc/api/v2/room-types/name/allowed-objects/__init__.py (renamed from opendc/api/v1/room-types/name/allowed-objects/__init__.py)0
-rw-r--r--opendc/api/v2/room-types/name/allowed-objects/endpoint.py (renamed from opendc/api/v1/room-types/name/allowed-objects/endpoint.py)0
-rw-r--r--opendc/api/v2/rooms/__init__.py (renamed from opendc/api/v1/rooms/__init__.py)0
-rw-r--r--opendc/api/v2/rooms/roomId/__init__.py (renamed from opendc/api/v1/rooms/roomId/__init__.py)0
-rw-r--r--opendc/api/v2/rooms/roomId/endpoint.py (renamed from opendc/api/v1/rooms/roomId/endpoint.py)0
-rw-r--r--opendc/api/v2/rooms/roomId/tiles/__init__.py (renamed from opendc/api/v1/rooms/roomId/tiles/__init__.py)0
-rw-r--r--opendc/api/v2/rooms/roomId/tiles/endpoint.py (renamed from opendc/api/v1/rooms/roomId/tiles/endpoint.py)0
-rw-r--r--opendc/api/v2/schedulers/__init__.py (renamed from opendc/api/v1/schedulers/__init__.py)0
-rw-r--r--opendc/api/v2/schedulers/endpoint.py (renamed from opendc/api/v1/schedulers/endpoint.py)0
-rw-r--r--opendc/api/v2/sections/__init__.py (renamed from opendc/api/v1/sections/__init__.py)0
-rw-r--r--opendc/api/v2/sections/sectionId/__init__.py (renamed from opendc/api/v1/sections/sectionId/__init__.py)0
-rw-r--r--opendc/api/v2/sections/sectionId/endpoint.py (renamed from opendc/api/v1/sections/sectionId/endpoint.py)0
-rw-r--r--opendc/api/v2/simulations/__init__.py (renamed from opendc/api/v1/simulations/__init__.py)0
-rw-r--r--opendc/api/v2/simulations/endpoint.py (renamed from opendc/api/v1/simulations/endpoint.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/__init__.py (renamed from opendc/api/v1/simulations/simulationId/__init__.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/authorizations/__init__.py (renamed from opendc/api/v1/simulations/simulationId/authorizations/__init__.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/authorizations/endpoint.py (renamed from opendc/api/v1/simulations/simulationId/authorizations/endpoint.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/authorizations/userId/__init__.py (renamed from opendc/api/v1/simulations/simulationId/authorizations/userId/__init__.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/authorizations/userId/endpoint.py (renamed from opendc/api/v1/simulations/simulationId/authorizations/userId/endpoint.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/datacenters/__init__.py (renamed from opendc/api/v1/simulations/simulationId/datacenters/__init__.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/datacenters/endpoint.py (renamed from opendc/api/v1/simulations/simulationId/datacenters/endpoint.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/endpoint.py (renamed from opendc/api/v1/simulations/simulationId/endpoint.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/experiments/__init__.py (renamed from opendc/api/v1/simulations/simulationId/experiments/__init__.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/experiments/endpoint.py (renamed from opendc/api/v1/simulations/simulationId/experiments/endpoint.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/paths/__init__.py (renamed from opendc/api/v1/simulations/simulationId/paths/__init__.py)0
-rw-r--r--opendc/api/v2/simulations/simulationId/paths/endpoint.py (renamed from opendc/api/v1/simulations/simulationId/paths/endpoint.py)0
-rw-r--r--opendc/api/v2/specifications/__init__.py (renamed from opendc/api/v1/specifications/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/cpus/__init__.py (renamed from opendc/api/v1/specifications/cpus/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/cpus/endpoint.py (renamed from opendc/api/v1/specifications/cpus/endpoint.py)0
-rw-r--r--opendc/api/v2/specifications/cpus/id/__init__.py (renamed from opendc/api/v1/specifications/cpus/id/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/cpus/id/endpoint.py (renamed from opendc/api/v1/specifications/cpus/id/endpoint.py)0
-rw-r--r--opendc/api/v2/specifications/failure-models/__init__.py (renamed from opendc/api/v1/specifications/failure-models/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/failure-models/endpoint.py (renamed from opendc/api/v1/specifications/failure-models/endpoint.py)0
-rw-r--r--opendc/api/v2/specifications/failure-models/id/__init__.py (renamed from opendc/api/v1/specifications/failure-models/id/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/failure-models/id/endpoint.py (renamed from opendc/api/v1/specifications/failure-models/id/endpoint.py)0
-rw-r--r--opendc/api/v2/specifications/gpus/__init__.py (renamed from opendc/api/v1/specifications/gpus/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/gpus/endpoint.py (renamed from opendc/api/v1/specifications/gpus/endpoint.py)0
-rw-r--r--opendc/api/v2/specifications/gpus/id/__init__.py (renamed from opendc/api/v1/specifications/gpus/id/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/gpus/id/endpoint.py (renamed from opendc/api/v1/specifications/gpus/id/endpoint.py)0
-rw-r--r--opendc/api/v2/specifications/memories/__init__.py (renamed from opendc/api/v1/specifications/memories/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/memories/endpoint.py (renamed from opendc/api/v1/specifications/memories/endpoint.py)0
-rw-r--r--opendc/api/v2/specifications/memories/id/__init__.py (renamed from opendc/api/v1/specifications/memories/id/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/memories/id/endpoint.py (renamed from opendc/api/v1/specifications/memories/id/endpoint.py)0
-rw-r--r--opendc/api/v2/specifications/storages/__init__.py (renamed from opendc/api/v1/specifications/storages/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/storages/endpoint.py (renamed from opendc/api/v1/specifications/storages/endpoint.py)0
-rw-r--r--opendc/api/v2/specifications/storages/id/__init__.py (renamed from opendc/api/v1/specifications/storages/id/__init__.py)0
-rw-r--r--opendc/api/v2/specifications/storages/id/endpoint.py (renamed from opendc/api/v1/specifications/storages/id/endpoint.py)0
-rw-r--r--opendc/api/v2/tiles/__init__.py (renamed from opendc/api/v1/tiles/__init__.py)0
-rw-r--r--opendc/api/v2/tiles/tileId/__init__.py (renamed from opendc/api/v1/tiles/tileId/__init__.py)0
-rw-r--r--opendc/api/v2/tiles/tileId/endpoint.py (renamed from opendc/api/v1/tiles/tileId/endpoint.py)0
-rw-r--r--opendc/api/v2/tiles/tileId/rack/__init__.py (renamed from opendc/api/v1/tiles/tileId/rack/__init__.py)0
-rw-r--r--opendc/api/v2/tiles/tileId/rack/endpoint.py (renamed from opendc/api/v1/tiles/tileId/rack/endpoint.py)0
-rw-r--r--opendc/api/v2/tiles/tileId/rack/machines/__init__.py (renamed from opendc/api/v1/tiles/tileId/rack/machines/__init__.py)0
-rw-r--r--opendc/api/v2/tiles/tileId/rack/machines/endpoint.py (renamed from opendc/api/v1/tiles/tileId/rack/machines/endpoint.py)0
-rw-r--r--opendc/api/v2/tiles/tileId/rack/machines/position/__init__.py (renamed from opendc/api/v1/tiles/tileId/rack/machines/position/__init__.py)0
-rw-r--r--opendc/api/v2/tiles/tileId/rack/machines/position/endpoint.py (renamed from opendc/api/v1/tiles/tileId/rack/machines/position/endpoint.py)0
-rw-r--r--opendc/api/v2/traces/__init__.py (renamed from opendc/api/v1/traces/__init__.py)0
-rw-r--r--opendc/api/v2/traces/endpoint.py (renamed from opendc/api/v1/traces/endpoint.py)0
-rw-r--r--opendc/api/v2/traces/traceId/__init__.py (renamed from opendc/api/v1/traces/traceId/__init__.py)0
-rw-r--r--opendc/api/v2/traces/traceId/endpoint.py (renamed from opendc/api/v1/traces/traceId/endpoint.py)0
-rw-r--r--opendc/api/v2/traces/traceId/jobs/__init__.py (renamed from opendc/api/v1/traces/traceId/jobs/__init__.py)0
-rw-r--r--opendc/api/v2/traces/traceId/jobs/endpoint.py (renamed from opendc/api/v1/traces/traceId/jobs/endpoint.py)0
-rw-r--r--opendc/api/v2/users/__init__.py (renamed from opendc/api/v1/users/__init__.py)0
-rw-r--r--opendc/api/v2/users/endpoint.py (renamed from opendc/api/v1/users/endpoint.py)0
-rw-r--r--opendc/api/v2/users/userId/__init__.py (renamed from opendc/api/v1/users/userId/__init__.py)0
-rw-r--r--opendc/api/v2/users/userId/authorizations/__init__.py (renamed from opendc/api/v1/users/userId/authorizations/__init__.py)0
-rw-r--r--opendc/api/v2/users/userId/authorizations/endpoint.py (renamed from opendc/api/v1/users/userId/authorizations/endpoint.py)0
-rw-r--r--opendc/api/v2/users/userId/endpoint.py (renamed from opendc/api/v1/users/userId/endpoint.py)0
-rw-r--r--opendc/models/machine.py4
-rw-r--r--opendc/models/machine_state.py6
-rw-r--r--opendc/models/model.py8
-rw-r--r--opendc/models/rack_state.py4
-rw-r--r--opendc/models/room_state.py4
-rw-r--r--opendc/models/task_duration.py2
-rw-r--r--opendc/models/task_state.py2
-rw-r--r--opendc/util/database.py78
114 files changed, 47 insertions, 61 deletions
diff --git a/opendc/api/v1/__init__.py b/opendc/api/v2/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/__init__.py
+++ b/opendc/api/v2/__init__.py
diff --git a/opendc/api/v1/datacenters/__init__.py b/opendc/api/v2/datacenters/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/datacenters/__init__.py
+++ b/opendc/api/v2/datacenters/__init__.py
diff --git a/opendc/api/v1/datacenters/datacenterId/__init__.py b/opendc/api/v2/datacenters/datacenterId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/datacenters/datacenterId/__init__.py
+++ b/opendc/api/v2/datacenters/datacenterId/__init__.py
diff --git a/opendc/api/v1/datacenters/datacenterId/endpoint.py b/opendc/api/v2/datacenters/datacenterId/endpoint.py
index 9444fb80..9444fb80 100644
--- a/opendc/api/v1/datacenters/datacenterId/endpoint.py
+++ b/opendc/api/v2/datacenters/datacenterId/endpoint.py
diff --git a/opendc/api/v1/datacenters/datacenterId/rooms/__init__.py b/opendc/api/v2/datacenters/datacenterId/rooms/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/datacenters/datacenterId/rooms/__init__.py
+++ b/opendc/api/v2/datacenters/datacenterId/rooms/__init__.py
diff --git a/opendc/api/v1/datacenters/datacenterId/rooms/endpoint.py b/opendc/api/v2/datacenters/datacenterId/rooms/endpoint.py
index e0155c7c..e0155c7c 100644
--- a/opendc/api/v1/datacenters/datacenterId/rooms/endpoint.py
+++ b/opendc/api/v2/datacenters/datacenterId/rooms/endpoint.py
diff --git a/opendc/api/v1/experiments/__init__.py b/opendc/api/v2/experiments/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/experiments/__init__.py
+++ b/opendc/api/v2/experiments/__init__.py
diff --git a/opendc/api/v1/experiments/experimentId/__init__.py b/opendc/api/v2/experiments/experimentId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/experiments/experimentId/__init__.py
+++ b/opendc/api/v2/experiments/experimentId/__init__.py
diff --git a/opendc/api/v1/experiments/experimentId/endpoint.py b/opendc/api/v2/experiments/experimentId/endpoint.py
index 59e0e0fe..59e0e0fe 100644
--- a/opendc/api/v1/experiments/experimentId/endpoint.py
+++ b/opendc/api/v2/experiments/experimentId/endpoint.py
diff --git a/opendc/api/v1/experiments/experimentId/last-simulated-tick/__init__.py b/opendc/api/v2/experiments/experimentId/last-simulated-tick/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/experiments/experimentId/last-simulated-tick/__init__.py
+++ b/opendc/api/v2/experiments/experimentId/last-simulated-tick/__init__.py
diff --git a/opendc/api/v1/experiments/experimentId/last-simulated-tick/endpoint.py b/opendc/api/v2/experiments/experimentId/last-simulated-tick/endpoint.py
index b4b19f59..b4b19f59 100644
--- a/opendc/api/v1/experiments/experimentId/last-simulated-tick/endpoint.py
+++ b/opendc/api/v2/experiments/experimentId/last-simulated-tick/endpoint.py
diff --git a/opendc/api/v1/experiments/experimentId/machine-states/__init__.py b/opendc/api/v2/experiments/experimentId/machine-states/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/experiments/experimentId/machine-states/__init__.py
+++ b/opendc/api/v2/experiments/experimentId/machine-states/__init__.py
diff --git a/opendc/api/v1/experiments/experimentId/machine-states/endpoint.py b/opendc/api/v2/experiments/experimentId/machine-states/endpoint.py
index 8ad588d2..8ad588d2 100644
--- a/opendc/api/v1/experiments/experimentId/machine-states/endpoint.py
+++ b/opendc/api/v2/experiments/experimentId/machine-states/endpoint.py
diff --git a/opendc/api/v1/experiments/experimentId/rack-states/__init__.py b/opendc/api/v2/experiments/experimentId/rack-states/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/experiments/experimentId/rack-states/__init__.py
+++ b/opendc/api/v2/experiments/experimentId/rack-states/__init__.py
diff --git a/opendc/api/v1/experiments/experimentId/rack-states/endpoint.py b/opendc/api/v2/experiments/experimentId/rack-states/endpoint.py
index 03570039..03570039 100644
--- a/opendc/api/v1/experiments/experimentId/rack-states/endpoint.py
+++ b/opendc/api/v2/experiments/experimentId/rack-states/endpoint.py
diff --git a/opendc/api/v1/experiments/experimentId/room-states/__init__.py b/opendc/api/v2/experiments/experimentId/room-states/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/experiments/experimentId/room-states/__init__.py
+++ b/opendc/api/v2/experiments/experimentId/room-states/__init__.py
diff --git a/opendc/api/v1/experiments/experimentId/room-states/endpoint.py b/opendc/api/v2/experiments/experimentId/room-states/endpoint.py
index 2693dc89..2693dc89 100644
--- a/opendc/api/v1/experiments/experimentId/room-states/endpoint.py
+++ b/opendc/api/v2/experiments/experimentId/room-states/endpoint.py
diff --git a/opendc/api/v1/experiments/experimentId/statistics/__init__.py b/opendc/api/v2/experiments/experimentId/statistics/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/experiments/experimentId/statistics/__init__.py
+++ b/opendc/api/v2/experiments/experimentId/statistics/__init__.py
diff --git a/opendc/api/v1/experiments/experimentId/statistics/task-durations/__init__.py b/opendc/api/v2/experiments/experimentId/statistics/task-durations/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/experiments/experimentId/statistics/task-durations/__init__.py
+++ b/opendc/api/v2/experiments/experimentId/statistics/task-durations/__init__.py
diff --git a/opendc/api/v1/experiments/experimentId/statistics/task-durations/endpoint.py b/opendc/api/v2/experiments/experimentId/statistics/task-durations/endpoint.py
index b8311f08..b8311f08 100644
--- a/opendc/api/v1/experiments/experimentId/statistics/task-durations/endpoint.py
+++ b/opendc/api/v2/experiments/experimentId/statistics/task-durations/endpoint.py
diff --git a/opendc/api/v1/experiments/experimentId/task-states/__init__.py b/opendc/api/v2/experiments/experimentId/task-states/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/experiments/experimentId/task-states/__init__.py
+++ b/opendc/api/v2/experiments/experimentId/task-states/__init__.py
diff --git a/opendc/api/v1/experiments/experimentId/task-states/endpoint.py b/opendc/api/v2/experiments/experimentId/task-states/endpoint.py
index 0c3fae89..0c3fae89 100644
--- a/opendc/api/v1/experiments/experimentId/task-states/endpoint.py
+++ b/opendc/api/v2/experiments/experimentId/task-states/endpoint.py
diff --git a/opendc/api/v1/jobs/__init__.py b/opendc/api/v2/jobs/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/jobs/__init__.py
+++ b/opendc/api/v2/jobs/__init__.py
diff --git a/opendc/api/v1/jobs/jobId/__init__.py b/opendc/api/v2/jobs/jobId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/jobs/jobId/__init__.py
+++ b/opendc/api/v2/jobs/jobId/__init__.py
diff --git a/opendc/api/v1/jobs/jobId/endpoint.py b/opendc/api/v2/jobs/jobId/endpoint.py
index da4dcd9d..da4dcd9d 100644
--- a/opendc/api/v1/jobs/jobId/endpoint.py
+++ b/opendc/api/v2/jobs/jobId/endpoint.py
diff --git a/opendc/api/v1/jobs/jobId/tasks/__init__.py b/opendc/api/v2/jobs/jobId/tasks/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/jobs/jobId/tasks/__init__.py
+++ b/opendc/api/v2/jobs/jobId/tasks/__init__.py
diff --git a/opendc/api/v1/jobs/jobId/tasks/endpoint.py b/opendc/api/v2/jobs/jobId/tasks/endpoint.py
index 04ac5b8c..04ac5b8c 100644
--- a/opendc/api/v1/jobs/jobId/tasks/endpoint.py
+++ b/opendc/api/v2/jobs/jobId/tasks/endpoint.py
diff --git a/opendc/api/v1/paths.json b/opendc/api/v2/paths.json
index bac7fc71..bac7fc71 100644
--- a/opendc/api/v1/paths.json
+++ b/opendc/api/v2/paths.json
diff --git a/opendc/api/v1/paths/__init__.py b/opendc/api/v2/paths/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/paths/__init__.py
+++ b/opendc/api/v2/paths/__init__.py
diff --git a/opendc/api/v1/paths/pathId/__init__.py b/opendc/api/v2/paths/pathId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/paths/pathId/__init__.py
+++ b/opendc/api/v2/paths/pathId/__init__.py
diff --git a/opendc/api/v1/paths/pathId/branches/__init__.py b/opendc/api/v2/paths/pathId/branches/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/paths/pathId/branches/__init__.py
+++ b/opendc/api/v2/paths/pathId/branches/__init__.py
diff --git a/opendc/api/v1/paths/pathId/branches/endpoint.py b/opendc/api/v2/paths/pathId/branches/endpoint.py
index 13638ffa..13638ffa 100644
--- a/opendc/api/v1/paths/pathId/branches/endpoint.py
+++ b/opendc/api/v2/paths/pathId/branches/endpoint.py
diff --git a/opendc/api/v1/paths/pathId/endpoint.py b/opendc/api/v2/paths/pathId/endpoint.py
index 7ade19ce..7ade19ce 100644
--- a/opendc/api/v1/paths/pathId/endpoint.py
+++ b/opendc/api/v2/paths/pathId/endpoint.py
diff --git a/opendc/api/v1/paths/pathId/sections/__init__.py b/opendc/api/v2/paths/pathId/sections/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/paths/pathId/sections/__init__.py
+++ b/opendc/api/v2/paths/pathId/sections/__init__.py
diff --git a/opendc/api/v1/paths/pathId/sections/endpoint.py b/opendc/api/v2/paths/pathId/sections/endpoint.py
index d4161839..d4161839 100644
--- a/opendc/api/v1/paths/pathId/sections/endpoint.py
+++ b/opendc/api/v2/paths/pathId/sections/endpoint.py
diff --git a/opendc/api/v1/room-types/__init__.py b/opendc/api/v2/room-types/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/room-types/__init__.py
+++ b/opendc/api/v2/room-types/__init__.py
diff --git a/opendc/api/v1/room-types/endpoint.py b/opendc/api/v2/room-types/endpoint.py
index fe00f226..fe00f226 100644
--- a/opendc/api/v1/room-types/endpoint.py
+++ b/opendc/api/v2/room-types/endpoint.py
diff --git a/opendc/api/v1/room-types/name/__init__.py b/opendc/api/v2/room-types/name/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/room-types/name/__init__.py
+++ b/opendc/api/v2/room-types/name/__init__.py
diff --git a/opendc/api/v1/room-types/name/allowed-objects/__init__.py b/opendc/api/v2/room-types/name/allowed-objects/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/room-types/name/allowed-objects/__init__.py
+++ b/opendc/api/v2/room-types/name/allowed-objects/__init__.py
diff --git a/opendc/api/v1/room-types/name/allowed-objects/endpoint.py b/opendc/api/v2/room-types/name/allowed-objects/endpoint.py
index a574591c..a574591c 100644
--- a/opendc/api/v1/room-types/name/allowed-objects/endpoint.py
+++ b/opendc/api/v2/room-types/name/allowed-objects/endpoint.py
diff --git a/opendc/api/v1/rooms/__init__.py b/opendc/api/v2/rooms/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/rooms/__init__.py
+++ b/opendc/api/v2/rooms/__init__.py
diff --git a/opendc/api/v1/rooms/roomId/__init__.py b/opendc/api/v2/rooms/roomId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/rooms/roomId/__init__.py
+++ b/opendc/api/v2/rooms/roomId/__init__.py
diff --git a/opendc/api/v1/rooms/roomId/endpoint.py b/opendc/api/v2/rooms/roomId/endpoint.py
index 1dfc32cc..1dfc32cc 100644
--- a/opendc/api/v1/rooms/roomId/endpoint.py
+++ b/opendc/api/v2/rooms/roomId/endpoint.py
diff --git a/opendc/api/v1/rooms/roomId/tiles/__init__.py b/opendc/api/v2/rooms/roomId/tiles/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/rooms/roomId/tiles/__init__.py
+++ b/opendc/api/v2/rooms/roomId/tiles/__init__.py
diff --git a/opendc/api/v1/rooms/roomId/tiles/endpoint.py b/opendc/api/v2/rooms/roomId/tiles/endpoint.py
index a4ef51e7..a4ef51e7 100644
--- a/opendc/api/v1/rooms/roomId/tiles/endpoint.py
+++ b/opendc/api/v2/rooms/roomId/tiles/endpoint.py
diff --git a/opendc/api/v1/schedulers/__init__.py b/opendc/api/v2/schedulers/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/schedulers/__init__.py
+++ b/opendc/api/v2/schedulers/__init__.py
diff --git a/opendc/api/v1/schedulers/endpoint.py b/opendc/api/v2/schedulers/endpoint.py
index 36537764..36537764 100644
--- a/opendc/api/v1/schedulers/endpoint.py
+++ b/opendc/api/v2/schedulers/endpoint.py
diff --git a/opendc/api/v1/sections/__init__.py b/opendc/api/v2/sections/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/sections/__init__.py
+++ b/opendc/api/v2/sections/__init__.py
diff --git a/opendc/api/v1/sections/sectionId/__init__.py b/opendc/api/v2/sections/sectionId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/sections/sectionId/__init__.py
+++ b/opendc/api/v2/sections/sectionId/__init__.py
diff --git a/opendc/api/v1/sections/sectionId/endpoint.py b/opendc/api/v2/sections/sectionId/endpoint.py
index 94c81d37..94c81d37 100644
--- a/opendc/api/v1/sections/sectionId/endpoint.py
+++ b/opendc/api/v2/sections/sectionId/endpoint.py
diff --git a/opendc/api/v1/simulations/__init__.py b/opendc/api/v2/simulations/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/simulations/__init__.py
+++ b/opendc/api/v2/simulations/__init__.py
diff --git a/opendc/api/v1/simulations/endpoint.py b/opendc/api/v2/simulations/endpoint.py
index a8637728..a8637728 100644
--- a/opendc/api/v1/simulations/endpoint.py
+++ b/opendc/api/v2/simulations/endpoint.py
diff --git a/opendc/api/v1/simulations/simulationId/__init__.py b/opendc/api/v2/simulations/simulationId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/simulations/simulationId/__init__.py
+++ b/opendc/api/v2/simulations/simulationId/__init__.py
diff --git a/opendc/api/v1/simulations/simulationId/authorizations/__init__.py b/opendc/api/v2/simulations/simulationId/authorizations/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/simulations/simulationId/authorizations/__init__.py
+++ b/opendc/api/v2/simulations/simulationId/authorizations/__init__.py
diff --git a/opendc/api/v1/simulations/simulationId/authorizations/endpoint.py b/opendc/api/v2/simulations/simulationId/authorizations/endpoint.py
index 1d6b494e..1d6b494e 100644
--- a/opendc/api/v1/simulations/simulationId/authorizations/endpoint.py
+++ b/opendc/api/v2/simulations/simulationId/authorizations/endpoint.py
diff --git a/opendc/api/v1/simulations/simulationId/authorizations/userId/__init__.py b/opendc/api/v2/simulations/simulationId/authorizations/userId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/simulations/simulationId/authorizations/userId/__init__.py
+++ b/opendc/api/v2/simulations/simulationId/authorizations/userId/__init__.py
diff --git a/opendc/api/v1/simulations/simulationId/authorizations/userId/endpoint.py b/opendc/api/v2/simulations/simulationId/authorizations/userId/endpoint.py
index 46458ffc..46458ffc 100644
--- a/opendc/api/v1/simulations/simulationId/authorizations/userId/endpoint.py
+++ b/opendc/api/v2/simulations/simulationId/authorizations/userId/endpoint.py
diff --git a/opendc/api/v1/simulations/simulationId/datacenters/__init__.py b/opendc/api/v2/simulations/simulationId/datacenters/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/simulations/simulationId/datacenters/__init__.py
+++ b/opendc/api/v2/simulations/simulationId/datacenters/__init__.py
diff --git a/opendc/api/v1/simulations/simulationId/datacenters/endpoint.py b/opendc/api/v2/simulations/simulationId/datacenters/endpoint.py
index e28402e4..e28402e4 100644
--- a/opendc/api/v1/simulations/simulationId/datacenters/endpoint.py
+++ b/opendc/api/v2/simulations/simulationId/datacenters/endpoint.py
diff --git a/opendc/api/v1/simulations/simulationId/endpoint.py b/opendc/api/v2/simulations/simulationId/endpoint.py
index 5e595740..5e595740 100644
--- a/opendc/api/v1/simulations/simulationId/endpoint.py
+++ b/opendc/api/v2/simulations/simulationId/endpoint.py
diff --git a/opendc/api/v1/simulations/simulationId/experiments/__init__.py b/opendc/api/v2/simulations/simulationId/experiments/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/simulations/simulationId/experiments/__init__.py
+++ b/opendc/api/v2/simulations/simulationId/experiments/__init__.py
diff --git a/opendc/api/v1/simulations/simulationId/experiments/endpoint.py b/opendc/api/v2/simulations/simulationId/experiments/endpoint.py
index 86fadb24..86fadb24 100644
--- a/opendc/api/v1/simulations/simulationId/experiments/endpoint.py
+++ b/opendc/api/v2/simulations/simulationId/experiments/endpoint.py
diff --git a/opendc/api/v1/simulations/simulationId/paths/__init__.py b/opendc/api/v2/simulations/simulationId/paths/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/simulations/simulationId/paths/__init__.py
+++ b/opendc/api/v2/simulations/simulationId/paths/__init__.py
diff --git a/opendc/api/v1/simulations/simulationId/paths/endpoint.py b/opendc/api/v2/simulations/simulationId/paths/endpoint.py
index e4aab427..e4aab427 100644
--- a/opendc/api/v1/simulations/simulationId/paths/endpoint.py
+++ b/opendc/api/v2/simulations/simulationId/paths/endpoint.py
diff --git a/opendc/api/v1/specifications/__init__.py b/opendc/api/v2/specifications/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/__init__.py
+++ b/opendc/api/v2/specifications/__init__.py
diff --git a/opendc/api/v1/specifications/cpus/__init__.py b/opendc/api/v2/specifications/cpus/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/cpus/__init__.py
+++ b/opendc/api/v2/specifications/cpus/__init__.py
diff --git a/opendc/api/v1/specifications/cpus/endpoint.py b/opendc/api/v2/specifications/cpus/endpoint.py
index 5cdbb9ec..5cdbb9ec 100644
--- a/opendc/api/v1/specifications/cpus/endpoint.py
+++ b/opendc/api/v2/specifications/cpus/endpoint.py
diff --git a/opendc/api/v1/specifications/cpus/id/__init__.py b/opendc/api/v2/specifications/cpus/id/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/cpus/id/__init__.py
+++ b/opendc/api/v2/specifications/cpus/id/__init__.py
diff --git a/opendc/api/v1/specifications/cpus/id/endpoint.py b/opendc/api/v2/specifications/cpus/id/endpoint.py
index c2453e51..c2453e51 100644
--- a/opendc/api/v1/specifications/cpus/id/endpoint.py
+++ b/opendc/api/v2/specifications/cpus/id/endpoint.py
diff --git a/opendc/api/v1/specifications/failure-models/__init__.py b/opendc/api/v2/specifications/failure-models/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/failure-models/__init__.py
+++ b/opendc/api/v2/specifications/failure-models/__init__.py
diff --git a/opendc/api/v1/specifications/failure-models/endpoint.py b/opendc/api/v2/specifications/failure-models/endpoint.py
index fff668c0..fff668c0 100644
--- a/opendc/api/v1/specifications/failure-models/endpoint.py
+++ b/opendc/api/v2/specifications/failure-models/endpoint.py
diff --git a/opendc/api/v1/specifications/failure-models/id/__init__.py b/opendc/api/v2/specifications/failure-models/id/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/failure-models/id/__init__.py
+++ b/opendc/api/v2/specifications/failure-models/id/__init__.py
diff --git a/opendc/api/v1/specifications/failure-models/id/endpoint.py b/opendc/api/v2/specifications/failure-models/id/endpoint.py
index 0797c9c9..0797c9c9 100644
--- a/opendc/api/v1/specifications/failure-models/id/endpoint.py
+++ b/opendc/api/v2/specifications/failure-models/id/endpoint.py
diff --git a/opendc/api/v1/specifications/gpus/__init__.py b/opendc/api/v2/specifications/gpus/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/gpus/__init__.py
+++ b/opendc/api/v2/specifications/gpus/__init__.py
diff --git a/opendc/api/v1/specifications/gpus/endpoint.py b/opendc/api/v2/specifications/gpus/endpoint.py
index 5676f62b..5676f62b 100644
--- a/opendc/api/v1/specifications/gpus/endpoint.py
+++ b/opendc/api/v2/specifications/gpus/endpoint.py
diff --git a/opendc/api/v1/specifications/gpus/id/__init__.py b/opendc/api/v2/specifications/gpus/id/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/gpus/id/__init__.py
+++ b/opendc/api/v2/specifications/gpus/id/__init__.py
diff --git a/opendc/api/v1/specifications/gpus/id/endpoint.py b/opendc/api/v2/specifications/gpus/id/endpoint.py
index 81113dc3..81113dc3 100644
--- a/opendc/api/v1/specifications/gpus/id/endpoint.py
+++ b/opendc/api/v2/specifications/gpus/id/endpoint.py
diff --git a/opendc/api/v1/specifications/memories/__init__.py b/opendc/api/v2/specifications/memories/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/memories/__init__.py
+++ b/opendc/api/v2/specifications/memories/__init__.py
diff --git a/opendc/api/v1/specifications/memories/endpoint.py b/opendc/api/v2/specifications/memories/endpoint.py
index 271824b3..271824b3 100644
--- a/opendc/api/v1/specifications/memories/endpoint.py
+++ b/opendc/api/v2/specifications/memories/endpoint.py
diff --git a/opendc/api/v1/specifications/memories/id/__init__.py b/opendc/api/v2/specifications/memories/id/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/memories/id/__init__.py
+++ b/opendc/api/v2/specifications/memories/id/__init__.py
diff --git a/opendc/api/v1/specifications/memories/id/endpoint.py b/opendc/api/v2/specifications/memories/id/endpoint.py
index 863099ca..863099ca 100644
--- a/opendc/api/v1/specifications/memories/id/endpoint.py
+++ b/opendc/api/v2/specifications/memories/id/endpoint.py
diff --git a/opendc/api/v1/specifications/storages/__init__.py b/opendc/api/v2/specifications/storages/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/storages/__init__.py
+++ b/opendc/api/v2/specifications/storages/__init__.py
diff --git a/opendc/api/v1/specifications/storages/endpoint.py b/opendc/api/v2/specifications/storages/endpoint.py
index 28f33177..28f33177 100644
--- a/opendc/api/v1/specifications/storages/endpoint.py
+++ b/opendc/api/v2/specifications/storages/endpoint.py
diff --git a/opendc/api/v1/specifications/storages/id/__init__.py b/opendc/api/v2/specifications/storages/id/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/specifications/storages/id/__init__.py
+++ b/opendc/api/v2/specifications/storages/id/__init__.py
diff --git a/opendc/api/v1/specifications/storages/id/endpoint.py b/opendc/api/v2/specifications/storages/id/endpoint.py
index ebe65857..ebe65857 100644
--- a/opendc/api/v1/specifications/storages/id/endpoint.py
+++ b/opendc/api/v2/specifications/storages/id/endpoint.py
diff --git a/opendc/api/v1/tiles/__init__.py b/opendc/api/v2/tiles/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/tiles/__init__.py
+++ b/opendc/api/v2/tiles/__init__.py
diff --git a/opendc/api/v1/tiles/tileId/__init__.py b/opendc/api/v2/tiles/tileId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/tiles/tileId/__init__.py
+++ b/opendc/api/v2/tiles/tileId/__init__.py
diff --git a/opendc/api/v1/tiles/tileId/endpoint.py b/opendc/api/v2/tiles/tileId/endpoint.py
index 5ccc9cd7..5ccc9cd7 100644
--- a/opendc/api/v1/tiles/tileId/endpoint.py
+++ b/opendc/api/v2/tiles/tileId/endpoint.py
diff --git a/opendc/api/v1/tiles/tileId/rack/__init__.py b/opendc/api/v2/tiles/tileId/rack/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/tiles/tileId/rack/__init__.py
+++ b/opendc/api/v2/tiles/tileId/rack/__init__.py
diff --git a/opendc/api/v1/tiles/tileId/rack/endpoint.py b/opendc/api/v2/tiles/tileId/rack/endpoint.py
index 64245856..64245856 100644
--- a/opendc/api/v1/tiles/tileId/rack/endpoint.py
+++ b/opendc/api/v2/tiles/tileId/rack/endpoint.py
diff --git a/opendc/api/v1/tiles/tileId/rack/machines/__init__.py b/opendc/api/v2/tiles/tileId/rack/machines/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/tiles/tileId/rack/machines/__init__.py
+++ b/opendc/api/v2/tiles/tileId/rack/machines/__init__.py
diff --git a/opendc/api/v1/tiles/tileId/rack/machines/endpoint.py b/opendc/api/v2/tiles/tileId/rack/machines/endpoint.py
index 5272c117..5272c117 100644
--- a/opendc/api/v1/tiles/tileId/rack/machines/endpoint.py
+++ b/opendc/api/v2/tiles/tileId/rack/machines/endpoint.py
diff --git a/opendc/api/v1/tiles/tileId/rack/machines/position/__init__.py b/opendc/api/v2/tiles/tileId/rack/machines/position/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/tiles/tileId/rack/machines/position/__init__.py
+++ b/opendc/api/v2/tiles/tileId/rack/machines/position/__init__.py
diff --git a/opendc/api/v1/tiles/tileId/rack/machines/position/endpoint.py b/opendc/api/v2/tiles/tileId/rack/machines/position/endpoint.py
index 99011fa4..99011fa4 100644
--- a/opendc/api/v1/tiles/tileId/rack/machines/position/endpoint.py
+++ b/opendc/api/v2/tiles/tileId/rack/machines/position/endpoint.py
diff --git a/opendc/api/v1/traces/__init__.py b/opendc/api/v2/traces/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/traces/__init__.py
+++ b/opendc/api/v2/traces/__init__.py
diff --git a/opendc/api/v1/traces/endpoint.py b/opendc/api/v2/traces/endpoint.py
index 78930b0f..78930b0f 100644
--- a/opendc/api/v1/traces/endpoint.py
+++ b/opendc/api/v2/traces/endpoint.py
diff --git a/opendc/api/v1/traces/traceId/__init__.py b/opendc/api/v2/traces/traceId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/traces/traceId/__init__.py
+++ b/opendc/api/v2/traces/traceId/__init__.py
diff --git a/opendc/api/v1/traces/traceId/endpoint.py b/opendc/api/v2/traces/traceId/endpoint.py
index 50993c41..50993c41 100644
--- a/opendc/api/v1/traces/traceId/endpoint.py
+++ b/opendc/api/v2/traces/traceId/endpoint.py
diff --git a/opendc/api/v1/traces/traceId/jobs/__init__.py b/opendc/api/v2/traces/traceId/jobs/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/traces/traceId/jobs/__init__.py
+++ b/opendc/api/v2/traces/traceId/jobs/__init__.py
diff --git a/opendc/api/v1/traces/traceId/jobs/endpoint.py b/opendc/api/v2/traces/traceId/jobs/endpoint.py
index bd2c6eb0..bd2c6eb0 100644
--- a/opendc/api/v1/traces/traceId/jobs/endpoint.py
+++ b/opendc/api/v2/traces/traceId/jobs/endpoint.py
diff --git a/opendc/api/v1/users/__init__.py b/opendc/api/v2/users/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/users/__init__.py
+++ b/opendc/api/v2/users/__init__.py
diff --git a/opendc/api/v1/users/endpoint.py b/opendc/api/v2/users/endpoint.py
index abd54f27..abd54f27 100644
--- a/opendc/api/v1/users/endpoint.py
+++ b/opendc/api/v2/users/endpoint.py
diff --git a/opendc/api/v1/users/userId/__init__.py b/opendc/api/v2/users/userId/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/users/userId/__init__.py
+++ b/opendc/api/v2/users/userId/__init__.py
diff --git a/opendc/api/v1/users/userId/authorizations/__init__.py b/opendc/api/v2/users/userId/authorizations/__init__.py
index e69de29b..e69de29b 100644
--- a/opendc/api/v1/users/userId/authorizations/__init__.py
+++ b/opendc/api/v2/users/userId/authorizations/__init__.py
diff --git a/opendc/api/v1/users/userId/authorizations/endpoint.py b/opendc/api/v2/users/userId/authorizations/endpoint.py
index 46ca12ba..46ca12ba 100644
--- a/opendc/api/v1/users/userId/authorizations/endpoint.py
+++ b/opendc/api/v2/users/userId/authorizations/endpoint.py
diff --git a/opendc/api/v1/users/userId/endpoint.py b/opendc/api/v2/users/userId/endpoint.py
index 767c5d13..767c5d13 100644
--- a/opendc/api/v1/users/userId/endpoint.py
+++ b/opendc/api/v2/users/userId/endpoint.py
diff --git a/opendc/models/machine.py b/opendc/models/machine.py
index f233d329..e6e49c4b 100644
--- a/opendc/models/machine.py
+++ b/opendc/models/machine.py
@@ -64,7 +64,7 @@ class Machine(Model):
try:
statement = 'SELECT id FROM machines WHERE rack_id = %s AND position = %s'
- machine_id = database.fetchone(statement, (rack.id, position))[0]
+ machine_id = database.fetch_one(statement, (rack.id, position))[0]
except:
return cls(id=-1)
@@ -102,7 +102,7 @@ class Machine(Model):
for device_table in self.device_table_to_attribute.keys():
statement = 'SELECT * FROM machine_{} WHERE machine_id = %s'.format(device_table)
- results = database.fetchall(statement, (self.id,))
+ results = database.fetch_all(statement, (self.id,))
device_ids = []
diff --git a/opendc/models/machine_state.py b/opendc/models/machine_state.py
index ad295e1a..3e3fdab9 100644
--- a/opendc/models/machine_state.py
+++ b/opendc/models/machine_state.py
@@ -38,7 +38,7 @@ class MachineState(Model):
machine_states = []
statement = 'SELECT * FROM machine_states WHERE experiment_id = %s'
- results = database.fetchall(statement, (experiment_id,))
+ results = database.fetch_all(statement, (experiment_id,))
for row in results:
machine_states.append(cls._from_database_row(row))
@@ -52,7 +52,7 @@ class MachineState(Model):
machine_states = []
statement = 'SELECT * FROM machine_states WHERE experiment_id = %s AND machine_states.tick = %s'
- results = database.fetchall(statement, (experiment_id, tick))
+ results = database.fetch_all(statement, (experiment_id, tick))
for row in results:
machine_states.append(cls._from_database_row(row))
@@ -65,7 +65,7 @@ class MachineState(Model):
super(MachineState, self).read()
statement = 'SELECT tick FROM task_states WHERE id = %s'
- result = database.fetchone(statement, (self.task_state_id,))
+ result = database.fetch_one(statement, (self.task_state_id,))
self.tick = result[0]
diff --git a/opendc/models/model.py b/opendc/models/model.py
index 8ab410d4..00ab50d1 100644
--- a/opendc/models/model.py
+++ b/opendc/models/model.py
@@ -163,7 +163,7 @@ class Model(object):
"""Initialize a Model by fetching it from the database."""
parameters = {}
- model_from_database = database.fetchone(statement, values)
+ model_from_database = database.fetch_one(statement, values)
if model_from_database is None:
return None
@@ -207,11 +207,11 @@ class Model(object):
if column_name is not None and value is not None:
statement = 'SELECT * FROM {} WHERE {} = %s'.format(cls.TABLE_NAME, column_name)
- database_models = database.fetchall(statement, (value,))
+ database_models = database.fetch_all(statement, (value,))
else:
statement = 'SELECT * FROM {}'.format(cls.TABLE_NAME)
- database_models = database.fetchall(statement)
+ database_models = database.fetch_all(statement)
models = []
@@ -267,7 +267,7 @@ class Model(object):
)
values = (getattr(self, column),)
- return database.fetchone(query, values)[0] == 1
+ return database.fetch_one(query, values)[0] == 1
def insert(self):
"""Insert this Model into the database."""
diff --git a/opendc/models/rack_state.py b/opendc/models/rack_state.py
index c0f0ff6c..440ab293 100644
--- a/opendc/models/rack_state.py
+++ b/opendc/models/rack_state.py
@@ -35,7 +35,7 @@ class RackState(Model):
WHERE machine_states.experiment_id = %s
GROUP BY machine_states.tick, racks.id
'''
- results = database.fetchall(statement, (experiment_id,))
+ results = database.fetch_all(statement, (experiment_id,))
for row in results:
rack_states.append(cls._from_database_row(row))
@@ -57,7 +57,7 @@ class RackState(Model):
AND machine_states.tick = %s
GROUP BY machine_states.tick, racks.id
'''
- results = database.fetchall(statement, (experiment_id, tick))
+ results = database.fetch_all(statement, (experiment_id, tick))
for row in results:
rack_states.append(cls._from_database_row(row))
diff --git a/opendc/models/room_state.py b/opendc/models/room_state.py
index 2729407f..2404d86b 100644
--- a/opendc/models/room_state.py
+++ b/opendc/models/room_state.py
@@ -39,7 +39,7 @@ class RoomState(Model):
AND machine_states.experiment_id = %s
GROUP BY machine_states.tick, rooms.id
'''
- results = database.fetchall(statement, (experiment_id,))
+ results = database.fetch_all(statement, (experiment_id,))
for row in results:
room_states.append(cls._from_database_row(row))
@@ -65,7 +65,7 @@ class RoomState(Model):
AND machine_states.tick = %s
GROUP BY rooms.id
'''
- results = database.fetchall(statement, (experiment_id, tick))
+ results = database.fetch_all(statement, (experiment_id, tick))
for row in results:
room_states.append(cls._from_database_row(row))
diff --git a/opendc/models/task_duration.py b/opendc/models/task_duration.py
index 1dc3ca01..14cbc31a 100644
--- a/opendc/models/task_duration.py
+++ b/opendc/models/task_duration.py
@@ -31,7 +31,7 @@ class TaskDuration(Model):
GROUP BY task_id
'''
- results = database.fetchall(statement, (experiment_id,))
+ results = database.fetch_all(statement, (experiment_id,))
for row in results:
room_states.append(cls._from_database_row(row))
diff --git a/opendc/models/task_state.py b/opendc/models/task_state.py
index 8dca2d03..83cc6a62 100644
--- a/opendc/models/task_state.py
+++ b/opendc/models/task_state.py
@@ -26,7 +26,7 @@ class TaskState(Model):
task_states = []
statement = 'SELECT * FROM task_states WHERE experiment_id = %s AND tick = %s'
- results = database.fetchall(statement, (experiment_id, tick))
+ results = database.fetch_all(statement, (experiment_id, tick))
for row in results:
task_states.append(
diff --git a/opendc/util/database.py b/opendc/util/database.py
index 92d0feef..67632bd0 100644
--- a/opendc/util/database.py
+++ b/opendc/util/database.py
@@ -15,68 +15,54 @@ def init_connection_pool(user, password, database, host, port):
database = urllib.parse.quote_plus(database)
host = urllib.parse.quote_plus(host)
- global client
global opendcdb
- global prefabs_collection
- global user_collection
- global topologies_collection
client = MongoClient('mongodb://%s:%s@%s/default_db?authSource=%s' % (user, password, host, database))
opendcdb = client.opendc
- prefabs_collection = opendcdb.prefabs
- topologies_collection = opendcdb.topologies
- user_collection = opendcdb.users
- # global CONNECTION_POOL
- # CONNECTION_POOL = MySQLConnectionPool(pool_name="opendcpool", pool_size=5,
- # user=user, password=password, database=database, host=host, port=port)
+def fetch_one(query, collection):
+ """Uses existing mongo connection to return a single (the first) document in a collection matching the given
+ query as a JSON object.
-def execute(statement, t):
- """Open a database connection and execute the statement."""
+ The query needs to be in json format, i.e.: `{'name': prefab_name}`.
+ """
+ bson = getattr(opendcdb, collection).find_one(query)
- # Connect to the database
- connection = CONNECTION_POOL.get_connection()
- cursor = connection.cursor()
+ return convert_bson_to_json(bson)
- # Execute the statement
- cursor.execute(statement, t)
- # Get the id
- cursor.execute('SELECT last_insert_id();')
- row_id = cursor.fetchone()[0]
+def fetch_all(query, collection):
+ """Uses existing mongo connection to return all documents matching a given query, as a list of JSON objects.
- # Disconnect from the database
- connection.commit()
- connection.close()
+ The query needs to be in json format, i.e.: `{'name': prefab_name}`.
+ """
+ results = []
+ cursor = getattr(opendcdb, collection).find(query)
+ for doc in cursor:
+ results.append(convert_bson_to_json(doc))
+ return results
- # Return the id
- return row_id
+def insert(obj, collection):
+ """Updates an existing object."""
+ bson = getattr(opendcdb, collection).insert(obj)
-def fetchone(query, collection):
- """Uses existing mongo connection to return a single (the first) document in a collection matching the given query as a JSON object"""
- # query needs to be in json format, i.e.: {'name': prefab_name}
- # TODO: determine which collection to pull from
- bson = prefabs_collection.find_one(query)
- json_string = dumps(bson) # convert BSON representation to JSON
- json_obj = json.loads(json_string) # load as a JSON object
- # leave the id field in for now, we can use it later
- # json_obj.pop("_id")
- return json_obj
+ return convert_bson_to_json(bson)
-def fetchall(query, collection):
- """Uses existing mongo connection to return all documents matching a given query, as a list of JSON objects"""
- results = []
- cursor = prefabs_collection.find(query)
- for doc in cursor:
- json_string = dumps(doc) # convert BSON representation to JSON
- json_obj = json.loads(json_string) # load as a JSON object
- # leave the id field in for now, we can use it later
- # json_obj.pop("_id")
- results.append(json_obj)
- return results
+def update(_id, obj, collection):
+ """Updates an existing object."""
+ bson = getattr(opendcdb, collection).update({'_id': _id}, obj)
+
+ return convert_bson_to_json(bson)
+
+
+def convert_bson_to_json(bson):
+ # Convert BSON representation to JSON
+ json_string = dumps(bson)
+ # Load as a JSON object
+ return json.loads(json_string)
def datetime_to_string(datetime_to_convert):