From cce4412fc4150d2769e02c815dd2e0871dac8729 Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Thu, 7 Dec 2023 14:03:39 +0530 Subject: [PATCH] mgr/volumes: add remote helper methods to fetch subvolume info * 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 (cherry picked from commit d2205bf8247edec08a456377c1e8988428e9ba29) Signed-off-by: Milind Changire --- src/pybind/mgr/volumes/fs/volume.py | 1 + src/pybind/mgr/volumes/module.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/pybind/mgr/volumes/fs/volume.py b/src/pybind/mgr/volumes/fs/volume.py index 5c6642444b116..6772d64c3970b 100644 --- a/src/pybind/mgr/volumes/fs/volume.py +++ b/src/pybind/mgr/volumes/fs/volume.py @@ -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) diff --git a/src/pybind/mgr/volumes/module.py b/src/pybind/mgr/volumes/module.py index b9c8e78934359..1d62f447b0efa 100644 --- a/src/pybind/mgr/volumes/module.py +++ b/src/pybind/mgr/volumes/module.py @@ -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) -- 2.39.5