summaryrefslogtreecommitdiff
path: root/opendc/api/v1/experiments/experimentId
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-25 13:50:49 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-25 13:50:49 +0200
commita1589e75358558eada7ffc2efc7e3fa7160d233e (patch)
tree7889a2364292cd8b90fe996da7907bebf200d3dc /opendc/api/v1/experiments/experimentId
parent1f34466d41ba01a3dd36b0866696367d397daf7e (diff)
Reformat codebase and fix spelling errors
Diffstat (limited to 'opendc/api/v1/experiments/experimentId')
-rw-r--r--opendc/api/v1/experiments/experimentId/endpoint.py13
-rw-r--r--opendc/api/v1/experiments/experimentId/last-simulated-tick/endpoint.py7
-rw-r--r--opendc/api/v1/experiments/experimentId/machine-states/endpoint.py7
-rw-r--r--opendc/api/v1/experiments/experimentId/rack-states/endpoint.py7
-rw-r--r--opendc/api/v1/experiments/experimentId/room-states/endpoint.py7
-rw-r--r--opendc/api/v1/experiments/experimentId/statistics/task-durations/endpoint.py7
-rw-r--r--opendc/api/v1/experiments/experimentId/task-states/endpoint.py5
7 files changed, 31 insertions, 22 deletions
diff --git a/opendc/api/v1/experiments/experimentId/endpoint.py b/opendc/api/v1/experiments/experimentId/endpoint.py
index 3bdd30d2..59e0e0fe 100644
--- a/opendc/api/v1/experiments/experimentId/endpoint.py
+++ b/opendc/api/v1/experiments/experimentId/endpoint.py
@@ -1,13 +1,14 @@
from opendc.models.experiment import Experiment
-from opendc.util import database, exceptions
+from opendc.util import exceptions
from opendc.util.rest import Response
+
def GET(request):
"""Get this Experiment."""
try:
request.check_required_parameters(
- path = {
+ path={
'experimentId': 'int'
}
)
@@ -39,6 +40,7 @@ def GET(request):
experiment.to_JSON()
)
+
def PUT(request):
"""Update this Experiment's Path, Trace, Scheduler, and/or name."""
@@ -46,10 +48,10 @@ def PUT(request):
try:
request.check_required_parameters(
- path = {
+ path={
'experimentId': 'int'
},
- body = {
+ body={
'experiment': {
'pathId': 'int',
'traceId': 'int',
@@ -97,6 +99,7 @@ def PUT(request):
experiment.to_JSON()
)
+
def DELETE(request):
"""Delete this Experiment."""
@@ -104,7 +107,7 @@ def DELETE(request):
try:
request.check_required_parameters(
- path = {
+ path={
'experimentId': 'int'
}
)
diff --git a/opendc/api/v1/experiments/experimentId/last-simulated-tick/endpoint.py b/opendc/api/v1/experiments/experimentId/last-simulated-tick/endpoint.py
index 24eb8932..b4b19f59 100644
--- a/opendc/api/v1/experiments/experimentId/last-simulated-tick/endpoint.py
+++ b/opendc/api/v1/experiments/experimentId/last-simulated-tick/endpoint.py
@@ -1,7 +1,8 @@
from opendc.models.experiment import Experiment
-from opendc.util import database, exceptions
+from opendc.util import exceptions
from opendc.util.rest import Response
+
def GET(request):
"""Get this Experiment's last simulated tick."""
@@ -9,7 +10,7 @@ def GET(request):
try:
request.check_required_parameters(
- path = {
+ path={
'experimentId': 'int'
}
)
@@ -21,7 +22,7 @@ def GET(request):
experiment = Experiment.from_primary_key((request.params_path['experimentId'],))
- # Make sure this Experiment exisits
+ # Make sure this Experiment exists
if not experiment.exists():
return Response(404, '{} not found.'.format(experiment))
diff --git a/opendc/api/v1/experiments/experimentId/machine-states/endpoint.py b/opendc/api/v1/experiments/experimentId/machine-states/endpoint.py
index 97113e4a..8ad588d2 100644
--- a/opendc/api/v1/experiments/experimentId/machine-states/endpoint.py
+++ b/opendc/api/v1/experiments/experimentId/machine-states/endpoint.py
@@ -1,8 +1,9 @@
from opendc.models.experiment import Experiment
from opendc.models.machine_state import MachineState
-from opendc.util import database, exceptions
+from opendc.util import exceptions
from opendc.util.rest import Response
+
def GET(request):
"""Get this Experiment's Machine States."""
@@ -10,7 +11,7 @@ def GET(request):
try:
request.check_required_parameters(
- path = {
+ path={
'experimentId': 'int'
}
)
@@ -22,7 +23,7 @@ def GET(request):
experiment = Experiment.from_primary_key((request.params_path['experimentId'],))
- # Make sure this Experiment exisits
+ # Make sure this Experiment exists
if not experiment.exists():
return Response(404, '{} not found.'.format(experiment))
diff --git a/opendc/api/v1/experiments/experimentId/rack-states/endpoint.py b/opendc/api/v1/experiments/experimentId/rack-states/endpoint.py
index daed45c5..03570039 100644
--- a/opendc/api/v1/experiments/experimentId/rack-states/endpoint.py
+++ b/opendc/api/v1/experiments/experimentId/rack-states/endpoint.py
@@ -1,8 +1,9 @@
from opendc.models.experiment import Experiment
from opendc.models.rack_state import RackState
-from opendc.util import database, exceptions
+from opendc.util import exceptions
from opendc.util.rest import Response
+
def GET(request):
"""Get this Experiment's Tack States."""
@@ -10,7 +11,7 @@ def GET(request):
try:
request.check_required_parameters(
- path = {
+ path={
'experimentId': 'int'
}
)
@@ -22,7 +23,7 @@ def GET(request):
experiment = Experiment.from_primary_key((request.params_path['experimentId'],))
- # Make sure this Experiment exisits
+ # Make sure this Experiment exists
if not experiment.exists():
return Response(404, '{} not found.'.format(experiment))
diff --git a/opendc/api/v1/experiments/experimentId/room-states/endpoint.py b/opendc/api/v1/experiments/experimentId/room-states/endpoint.py
index 9e283d34..2693dc89 100644
--- a/opendc/api/v1/experiments/experimentId/room-states/endpoint.py
+++ b/opendc/api/v1/experiments/experimentId/room-states/endpoint.py
@@ -1,8 +1,9 @@
from opendc.models.experiment import Experiment
from opendc.models.room_state import RoomState
-from opendc.util import database, exceptions
+from opendc.util import exceptions
from opendc.util.rest import Response
+
def GET(request):
"""Get this Experiment's Room States."""
@@ -10,7 +11,7 @@ def GET(request):
try:
request.check_required_parameters(
- path = {
+ path={
'experimentId': 'int'
}
)
@@ -22,7 +23,7 @@ def GET(request):
experiment = Experiment.from_primary_key((request.params_path['experimentId'],))
- # Make sure this Experiment exisits
+ # Make sure this Experiment exists
if not experiment.exists():
return Response(404, '{} not found.'.format(experiment))
diff --git a/opendc/api/v1/experiments/experimentId/statistics/task-durations/endpoint.py b/opendc/api/v1/experiments/experimentId/statistics/task-durations/endpoint.py
index ad73daa7..b8311f08 100644
--- a/opendc/api/v1/experiments/experimentId/statistics/task-durations/endpoint.py
+++ b/opendc/api/v1/experiments/experimentId/statistics/task-durations/endpoint.py
@@ -1,8 +1,9 @@
from opendc.models.experiment import Experiment
from opendc.models.task_duration import TaskDuration
-from opendc.util import database, exceptions
+from opendc.util import exceptions
from opendc.util.rest import Response
+
def GET(request):
"""Get this Experiment's Task Durations."""
@@ -10,7 +11,7 @@ def GET(request):
try:
request.check_required_parameters(
- path = {
+ path={
'experimentId': 'int'
}
)
@@ -22,7 +23,7 @@ def GET(request):
experiment = Experiment.from_primary_key((request.params_path['experimentId'],))
- # Make sure this Experiment exisits
+ # Make sure this Experiment exists
if not experiment.exists():
return Response(404, '{} not found.'.format(experiment))
diff --git a/opendc/api/v1/experiments/experimentId/task-states/endpoint.py b/opendc/api/v1/experiments/experimentId/task-states/endpoint.py
index 805d86fb..0c3fae89 100644
--- a/opendc/api/v1/experiments/experimentId/task-states/endpoint.py
+++ b/opendc/api/v1/experiments/experimentId/task-states/endpoint.py
@@ -1,8 +1,9 @@
from opendc.models.experiment import Experiment
from opendc.models.task_state import TaskState
-from opendc.util import database, exceptions
+from opendc.util import exceptions
from opendc.util.rest import Response
+
def GET(request):
"""Get this Experiment's Task States."""
@@ -10,7 +11,7 @@ def GET(request):
try:
request.check_required_parameters(
- path = {
+ path={
'experimentId': 'int'
}
)