summaryrefslogtreecommitdiff
path: root/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-06-30 19:33:19 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:44:39 +0200
commiteb82c4b678d60d74816d46df0f3b18b1760b7c6e (patch)
treedb1be1998a1f73ce8f8e77fa0ec902a8a731b685 /web-server/opendc/api/v2/topologies/topologyId/endpoint.py
parent61baf441680953b3d6fa47be0a69309570548fa4 (diff)
Revamp web server instructions
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'})