diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-06-30 19:33:37 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:44:40 +0200 |
| commit | 1f4e48e6f7751500a4539ca6eb989768ff8fdae3 (patch) | |
| tree | 335ecb51f0474a835de07d9fbaf9f6cbd05cc040 /web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py | |
| parent | eb82c4b678d60d74816d46df0f3b18b1760b7c6e (diff) | |
| parent | cf02cfc00efd664b79289fb867eed536656ac132 (diff) | |
Merge remote-tracking branch 'origin/feature/mongodb-migration' into feature/mongodb-migration
Diffstat (limited to 'web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py')
| -rw-r--r-- | web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py | 8 |
1 files changed, 7 insertions, 1 deletions
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 952959ca..ecf80353 100644 --- a/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py +++ b/web-server/opendc/api/v2/simulations/simulationId/topologies/endpoint.py @@ -9,7 +9,12 @@ 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']) @@ -17,6 +22,7 @@ def POST(request): simulation.check_user_access(request.google_id, True) topology = Topology({'name': request.params_body['topology']['name']}) + topology.set_property('datetimeCreated', Database.datetime_to_string(datetime.now())) topology.set_property('datetimeLastEdited', Database.datetime_to_string(datetime.now())) topology.insert() |
