summaryrefslogtreecommitdiff
path: root/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
diff options
context:
space:
mode:
Diffstat (limited to 'web-server/opendc/api/v2/topologies/topologyId/endpoint.py')
-rw-r--r--web-server/opendc/api/v2/topologies/topologyId/endpoint.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/web-server/opendc/api/v2/topologies/topologyId/endpoint.py b/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
index 824bb12b..a4f71ed6 100644
--- a/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
+++ b/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
@@ -6,7 +6,6 @@ from opendc.models.topology import Topology
from opendc.util.rest import Response
-
def GET(request):
"""Get this Topology."""
@@ -19,15 +18,10 @@ def GET(request):
return Response(200, 'Successfully retrieved topology.', topology.obj)
+
def PUT(request):
"""Update this topology"""
- request.check_required_parameters(path={'topologyId': 'int'},
- body={
- 'topology': {
- 'name': 'string',
- 'rooms': {}
- }
- })
+ request.check_required_parameters(path={'topologyId': 'int'}, body={'topology': {'name': 'string', 'rooms': {}}})
topology = Topology.from_id(request.params_path['topologyId'])
topology.check_exists()
@@ -41,6 +35,7 @@ def PUT(request):
return Response(200, 'Successfully updated topology.', topology.obj)
+
def DELETE(request):
"""Delete this topology"""
request.check_required_parameters(path={'topologyId': 'int'})