summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/controllers/cluster.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/pybind/mgr/dashboard/controllers/cluster.py
parentInitial commit. (diff)
downloadceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz
ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/pybind/mgr/dashboard/controllers/cluster.py')
-rw-r--r--src/pybind/mgr/dashboard/controllers/cluster.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/controllers/cluster.py b/src/pybind/mgr/dashboard/controllers/cluster.py
new file mode 100644
index 000000000..d8170e672
--- /dev/null
+++ b/src/pybind/mgr/dashboard/controllers/cluster.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+
+from ..security import Scope
+from ..services.cluster import ClusterModel
+from . import APIDoc, APIRouter, EndpointDoc, RESTController
+from ._version import APIVersion
+
+
+@APIRouter('/cluster', Scope.CONFIG_OPT)
+@APIDoc("Get Cluster Details", "Cluster")
+class Cluster(RESTController):
+ @RESTController.MethodMap(version=APIVersion.EXPERIMENTAL)
+ @EndpointDoc("Get the cluster status")
+ def list(self):
+ return ClusterModel.from_db().dict()
+
+ @RESTController.MethodMap(version=APIVersion.EXPERIMENTAL)
+ @EndpointDoc("Update the cluster status",
+ parameters={'status': (str, 'Cluster Status')})
+ def singleton_set(self, status: str):
+ ClusterModel(status).to_db()