summaryrefslogtreecommitdiff
path: root/opendc/api/v2/schedulers/endpoint.py
blob: 224ecfb873d546fe571131a10916b58c2740293d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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])