summaryrefslogtreecommitdiff
path: root/web-server/opendc/api/v2/topologies/topologyId/endpoint.py
blob: a8061d69f4f1e9e796750717c0958daa8dc40d52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from opendc.models.topology import Topology
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)