]> 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>
Sat, 6 Jan 2024 03:28:30 +0000 (08: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>
src/pybind/mgr/volumes/fs/volume.py
src/pybind/mgr/volumes/module.py

index e19d1eafb2a6e8314587856cf4938b9e06d96291..c896fd73d0b05cc71cce8c1d1d8a94439da63d05 100644 (file)
@@ -422,6 +422,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 6227276fcaf576eb28bdb99b8a18424c8d2e68c0..68031ed55a3b890681141cea848f0ebf88a09b7b 100644 (file)
@@ -855,3 +855,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)