diff options
Diffstat (limited to 'web-server/opendc/api/v2/topologies/topologyId/endpoint.py')
| -rw-r--r-- | web-server/opendc/api/v2/topologies/topologyId/endpoint.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/web-server/opendc/api/v2/topologies/topologyId/endpoint.py b/web-server/opendc/api/v2/topologies/topologyId/endpoint.py new file mode 100644 index 00000000..6c6ab9c2 --- /dev/null +++ b/web-server/opendc/api/v2/topologies/topologyId/endpoint.py @@ -0,0 +1,16 @@ +from opendc.models.topology import Topology +from opendc.util import exceptions +from opendc.util.rest import Response + + +def GET(request): + """Get this Topology.""" + + request.check_required_parameters(path={'topologyId': 'int'}) + + topology = Topology.from_id(request.params_path['topologyId']) + + topology.check_exists() + topology.check_user_access(request.google_id, False) + + return Response(200, 'Successfully retrieved topology.', topology.obj) |
