]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: add remote helper methods to fetch subvolume info
authorMilind Changire <mchangir@redhat.com>
Thu, 7 Dec 2023 08:33:39 +0000 (14:03 +0530)
committerMilind Changire <mchangir@redhat.com>
Wed, 14 Feb 2024 08:28:20 +0000 (13:58 +0530)
  * add remote method to fetch subvolume path
  * add remote method to list subvolumes
  * add remote method to fetch subvolume attributes

Signed-off-by: Milind Changire <mchangir@redhat.com>
(cherry picked from commit d2205bf8247edec08a456377c1e8988428e9ba29)
Signed-off-by: Milind Changire <mchangir@redhat.com>
src/pybind/mgr/volumes/fs/volume.py
src/pybind/mgr/volumes/module.py

index 5c6642444b116b2f4b4f4cc109c3a356ee5190f7..6772d64c3970bf8c17bb6209029c451abb25244f 100644 (file)
@@ -424,6 +424,7 @@ class VolumeClient(CephfsClient["Module"]):
 
                         subvol_info_dict = subvolume.info()
                         subvol_info_dict["mon_addrs"] = mon_addr_lst
+                        subvol_info_dict["flavor"] = subvolume.VERSION
                         ret = 0, json.dumps(subvol_info_dict, indent=4, sort_keys=True), ""
         except VolumeException as ve:
             ret = self.volume_exception_to_retval(ve)
index b9c8e7893435934318aee3f8180f424bce813947..1d62f447b0efaf549559649399f75904f810f160 100644 (file)
@@ -845,3 +845,19 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
     def _cmd_fs_clone_cancel(self, inbuf, cmd):
         return self.vc.clone_cancel(
             vol_name=cmd['vol_name'], clone_name=cmd['clone_name'], group_name=cmd.get('group_name', None))
+
+    # remote method
+    def subvolume_getpath(self, vol_name, subvol, group_name):
+        return self.vc.subvolume_getpath(vol_name=vol_name,
+                                         sub_name=subvol,
+                                         group_name=group_name)
+
+    # remote method
+    def subvolume_ls(self, vol_name, group_name):
+        return self.vc.list_subvolumes(vol_name=vol_name, group_name=group_name)
+
+    # remote method
+    def subvolume_info(self, vol_name, subvol, group_name):
+        return self.vc.subvolume_info(vol_name=vol_name,
+                                      sub_name=subvol,
+                                      group_name=group_name)