summaryrefslogtreecommitdiff
path: root/opendc/api/v1/schedulers/endpoint.py
diff options
context:
space:
mode:
authorleonoverweel <l.overweel@gmail.com>2017-01-24 12:05:15 +0100
committerleonoverweel <l.overweel@gmail.com>2017-01-24 12:05:15 +0100
commit86a50a4f6df9ece982743a3b7ca510846d248909 (patch)
tree79edc0478908b7fee9e5dca2088e562c7a62038b /opendc/api/v1/schedulers/endpoint.py
Initial commit
Diffstat (limited to 'opendc/api/v1/schedulers/endpoint.py')
-rw-r--r--opendc/api/v1/schedulers/endpoint.py17
1 files changed, 17 insertions, 0 deletions
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]
+ )