From 39277c91281dbc7bd40bdffabc5b5675e9ede483 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Fri, 3 Jul 2020 10:34:05 +0200 Subject: Get basic topology change working --- .../opendc/api/v2/simulations/simulationId/topologies/endpoint.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 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 09c84019..7c07e63b 100644 --- a/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py +++ b/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py @@ -16,10 +16,12 @@ def POST(request): simulation.check_exists() simulation.check_user_access(request.google_id, True) - topology = Topology({'name': request.params_body['topology']['name']}) + topology = Topology({ + 'simulationId': request.params_path['simulationId'], + 'name': request.params_body['topology']['name'], + 'rooms': request.params_body['topology']['rooms'], + }) - topology.set_property('datetimeCreated', Database.datetime_to_string(datetime.now())) - topology.set_property('datetimeLastEdited', Database.datetime_to_string(datetime.now())) topology.insert() simulation.obj['topologyIds'].append(topology.get_id()) -- cgit v1.2.3