summaryrefslogtreecommitdiff
path: root/opendc/api/v1/schedulers/endpoint.py
diff options
context:
space:
mode:
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]
+ )