]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: add module method to send notifications
authorPatrick Donnelly <pdonnell@ibm.com>
Wed, 5 Feb 2025 16:19:25 +0000 (11:19 -0500)
committerPatrick Donnelly <pdonnell@ibm.com>
Fri, 28 Feb 2025 00:55:46 +0000 (19:55 -0500)
For use by MgrModule.send_command to signal MDS command completion.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/mgr/BaseMgrModule.cc
src/pybind/mgr/ceph_module.pyi

index bae5d54d74790f124a6cbfa2ef0618c450de2178..8ec4fc51989ebf6991051f020b5c5eb6e50cb332 100644 (file)
@@ -362,6 +362,20 @@ ceph_set_health_checks(BaseMgrModule *self, PyObject *args)
   Py_RETURN_NONE;
 }
 
+static PyObject*
+ceph_notify_all(BaseMgrModule *self, PyObject *args)
+{
+  char *type = nullptr;
+  char *id = nullptr;
+  if (!PyArg_ParseTuple(args, "ss:ceph_notify_all", &type, &id)) {
+    return nullptr;
+  }
+
+  without_gil([&] {
+    self->py_modules->notify_all(type, id);
+  });
+  return nullptr;
+}
 
 static PyObject*
 ceph_state_get(BaseMgrModule *self, PyObject *args)
@@ -1422,6 +1436,9 @@ PyMethodDef BaseMgrModule_methods[] = {
   {"_ceph_get", (PyCFunction)ceph_state_get, METH_VARARGS,
    "Get a cluster object"},
 
+  {"_ceph_notify_all", (PyCFunction)ceph_notify_all, METH_VARARGS,
+   "notify all modules"},
+
   {"_ceph_get_server", (PyCFunction)ceph_get_server, METH_VARARGS,
    "Get a server object"},
 
index 3777c469a1fdda61f69d76dc37ce54388ad664e5..32c9a244148001db9a1e00e5c600ffb9d8968ce0 100644 (file)
@@ -69,6 +69,7 @@ class BaseMgrModule(object):
     def _ceph_cluster_log(self, channel: str, priority: int, message: str) -> None: ...
     def _ceph_get_context(self) -> object: ...
     def _ceph_get(self, data_name: str) -> Any: ...
+    def _ceph_notify_all(self, what: str, tag: str) ->  None: ...
     def _ceph_get_server(self, hostname: Optional[str]) -> Union[ServerInfoT,
                                                                  List[ServerInfoT]]: ...
     def _ceph_get_perf_schema(self, svc_type: str, svc_name: str) -> Dict[str, Any]: ...