From eb82c4b678d60d74816d46df0f3b18b1760b7c6e Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 30 Jun 2020 19:33:19 +0200 Subject: Revamp web server instructions --- web-server/opendc/api/v2/topologies/topologyId/endpoint.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'web-server/opendc/api/v2/topologies/topologyId/endpoint.py') 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'}) -- cgit v1.2.3