From: Ivo Almeida Date: Thu, 8 Feb 2024 15:23:42 +0000 (+0000) Subject: mgr/dashboard: added subvolume and translations X-Git-Tag: v18.2.4~259^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d6609be0afcd9ad1cb9a95c13f57eb086dadf496;p=ceph.git mgr/dashboard: added subvolume and translations This commit adds support for subvolume snap scheduling and translations for snap schedule repeat schedules and retention policies Fixes: https://tracker.ceph.com/issues/64372 Signed-off-by: Ivo Almeida --- diff --git a/src/pybind/mgr/dashboard/controllers/cephfs.py b/src/pybind/mgr/dashboard/controllers/cephfs.py index 83e9cbfd8533f..ad2cafe0ba8ea 100644 --- a/src/pybind/mgr/dashboard/controllers/cephfs.py +++ b/src/pybind/mgr/dashboard/controllers/cephfs.py @@ -969,13 +969,16 @@ class CephFSSnapshotSchedule(RESTController): ) return json.loads(output_json) - def create(self, fs: str, path: str, snap_schedule: str, start: str, retention_policy=None): + def create(self, fs: str, path: str, snap_schedule: str, start: str, retention_policy=None, + subvol=None, group=None): error_code, _, err = mgr.remote('snap_schedule', 'snap_schedule_add', path, snap_schedule, start, - fs) + fs, + subvol, + group) if retention_policy: retention_policies = retention_policy.split('|') @@ -999,7 +1002,8 @@ class CephFSSnapshotSchedule(RESTController): return f'Snapshot schedule for path {path} created successfully' - def set(self, fs: str, path: str, retention_to_add=None, retention_to_remove=None): + def set(self, fs: str, path: str, retention_to_add=None, retention_to_remove=None, + subvol=None, group=None): def editRetentionPolicies(method, retention_policy): if not retention_policy: return @@ -1014,8 +1018,8 @@ class CephFSSnapshotSchedule(RESTController): retention_spec_or_period, retention_count, fs, - None, - None) + subvol, + group) if error_code_retention != 0: raise DashboardException( f'Failed to add/remove retention policy for path {path}: {err_retention}' @@ -1027,15 +1031,16 @@ class CephFSSnapshotSchedule(RESTController): return f'Retention policies for snapshot schedule on path {path} updated successfully' @RESTController.Resource('DELETE') - def delete_snapshot(self, fs: str, path: str, schedule: str, start: str): + def delete_snapshot(self, fs: str, path: str, schedule: str, start: str, + subvol=None, group=None): error_code, _, err = mgr.remote('snap_schedule', 'snap_schedule_rm', path, schedule, start, fs, - None, - None) + subvol, + group) if error_code != 0: raise DashboardException( f'Failed to delete snapshot schedule for path {path}: {err}' @@ -1044,15 +1049,15 @@ class CephFSSnapshotSchedule(RESTController): return f'Snapshot schedule for path {path} deleted successfully' @RESTController.Resource('POST') - def deactivate(self, fs: str, path: str, schedule: str, start: str): + def deactivate(self, fs: str, path: str, schedule: str, start: str, subvol=None, group=None): error_code, _, err = mgr.remote('snap_schedule', 'snap_schedule_deactivate', path, schedule, start, fs, - None, - None) + subvol, + group) if error_code != 0: raise DashboardException( f'Failed to deactivate snapshot schedule for path {path}: {err}' @@ -1061,15 +1066,15 @@ class CephFSSnapshotSchedule(RESTController): return f'Snapshot schedule for path {path} deactivated successfully' @RESTController.Resource('POST') - def activate(self, fs: str, path: str, schedule: str, start: str): + def activate(self, fs: str, path: str, schedule: str, start: str, subvol=None, group=None): error_code, _, err = mgr.remote('snap_schedule', 'snap_schedule_activate', path, schedule, start, fs, - None, - None) + subvol, + group) if error_code != 0: raise DashboardException( f'Failed to activate snapshot schedule for path {path}: {err}' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-form/cephfs-snapshotschedule-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-form/cephfs-snapshotschedule-form.component.html index e315e8ab7671d..a67293e1138b5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-form/cephfs-snapshotschedule-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-form/cephfs-snapshotschedule-form.component.html @@ -36,6 +36,7 @@ i18n>A snapshot schedule for this path already exists. +