summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-api/opendc/api/v2/schedulers
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-web/opendc-web-api/opendc/api/v2/schedulers')
-rw-r--r--opendc-web/opendc-web-api/opendc/api/v2/schedulers/__init__.py0
-rw-r--r--opendc-web/opendc-web-api/opendc/api/v2/schedulers/endpoint.py19
-rw-r--r--opendc-web/opendc-web-api/opendc/api/v2/schedulers/test_endpoint.py2
3 files changed, 21 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-api/opendc/api/v2/schedulers/__init__.py b/opendc-web/opendc-web-api/opendc/api/v2/schedulers/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/opendc-web/opendc-web-api/opendc/api/v2/schedulers/__init__.py
diff --git a/opendc-web/opendc-web-api/opendc/api/v2/schedulers/endpoint.py b/opendc-web/opendc-web-api/opendc/api/v2/schedulers/endpoint.py
new file mode 100644
index 00000000..f33159bf
--- /dev/null
+++ b/opendc-web/opendc-web-api/opendc/api/v2/schedulers/endpoint.py
@@ -0,0 +1,19 @@
+from opendc.util.rest import Response
+
+SCHEDULERS = [
+ 'mem',
+ 'mem-inv',
+ 'core-mem',
+ 'core-mem-inv',
+ 'active-servers',
+ 'active-servers-inv',
+ 'provisioned-cores',
+ 'provisioned-cores-inv',
+ 'random'
+]
+
+
+def GET(_):
+ """Get all available Schedulers."""
+
+ return Response(200, 'Successfully retrieved Schedulers.', [{'name': name} for name in SCHEDULERS])
diff --git a/opendc-web/opendc-web-api/opendc/api/v2/schedulers/test_endpoint.py b/opendc-web/opendc-web-api/opendc/api/v2/schedulers/test_endpoint.py
new file mode 100644
index 00000000..4950ca4c
--- /dev/null
+++ b/opendc-web/opendc-web-api/opendc/api/v2/schedulers/test_endpoint.py
@@ -0,0 +1,2 @@
+def test_get_schedulers(client):
+ assert '200' in client.get('/v2/schedulers').status