From de8f12d74faef5fa3f9e38d1340948cab2d06ea3 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 1 Jul 2020 13:33:31 +0200 Subject: Manually generate IDs --- .../opendc/api/v2/simulations/simulationId/topologies/endpoint.py | 7 +------ web-server/opendc/api/v2/topologies/topologyId/endpoint.py | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'web-server/opendc/api') diff --git a/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py b/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py index ecf80353..09c84019 100644 --- a/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py +++ b/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py @@ -9,12 +9,7 @@ from opendc.util.database import Database def POST(request): """Add a new Topology to the specified simulation and return it""" - request.check_required_parameters(path={'simulationId': 'string'}, - body={ - 'topology': { - 'name': 'string' - } - }) + request.check_required_parameters(path={'simulationId': 'string'}, body={'topology': {'name': 'string'}}) simulation = Simulation.from_id(request.params_path['simulationId']) diff --git a/web-server/opendc/api/v2/topologies/topologyId/endpoint.py b/web-server/opendc/api/v2/topologies/topologyId/endpoint.py index a4f71ed6..84f20903 100644 --- a/web-server/opendc/api/v2/topologies/topologyId/endpoint.py +++ b/web-server/opendc/api/v2/topologies/topologyId/endpoint.py @@ -9,7 +9,7 @@ from opendc.util.rest import Response def GET(request): """Get this Topology.""" - request.check_required_parameters(path={'topologyId': 'int'}) + request.check_required_parameters(path={'topologyId': 'string'}) topology = Topology.from_id(request.params_path['topologyId']) @@ -21,7 +21,7 @@ def GET(request): def PUT(request): """Update this topology""" - request.check_required_parameters(path={'topologyId': 'int'}, body={'topology': {'name': 'string', 'rooms': {}}}) + request.check_required_parameters(path={'topologyId': 'string'}, body={'topology': {'name': 'string', 'rooms': {}}}) topology = Topology.from_id(request.params_path['topologyId']) topology.check_exists() @@ -38,7 +38,7 @@ def PUT(request): def DELETE(request): """Delete this topology""" - request.check_required_parameters(path={'topologyId': 'int'}) + request.check_required_parameters(path={'topologyId': 'string'}) topology = Topology.from_id(request.params_path['topologyId']) -- cgit v1.2.3