summaryrefslogtreecommitdiff
path: root/opendc/api/v1/schedulers/endpoint.py
blob: 36537764e247e1dc13992c584b44976293492129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from opendc.models.scheduler import Scheduler
from opendc.util.rest import Response


def GET(request):
    """Get all available Schedulers."""

    # Get the Schedulers

    schedulers = Scheduler.query()

    # Return the Schedulers

    return Response(
        200,
        'Successfully retrieved Schedulers.',
        [x.to_JSON() for x in schedulers]
    )