From 86a50a4f6df9ece982743a3b7ca510846d248909 Mon Sep 17 00:00:00 2001 From: leonoverweel Date: Tue, 24 Jan 2017 12:05:15 +0100 Subject: Initial commit --- opendc/api/v1/schedulers/__init__.py | 0 opendc/api/v1/schedulers/endpoint.py | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 opendc/api/v1/schedulers/__init__.py create mode 100644 opendc/api/v1/schedulers/endpoint.py (limited to 'opendc/api/v1/schedulers') diff --git a/opendc/api/v1/schedulers/__init__.py b/opendc/api/v1/schedulers/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/opendc/api/v1/schedulers/endpoint.py b/opendc/api/v1/schedulers/endpoint.py new file mode 100644 index 00000000..206c7cb9 --- /dev/null +++ b/opendc/api/v1/schedulers/endpoint.py @@ -0,0 +1,17 @@ +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] + ) -- cgit v1.2.3