From: Nizamudeen A Date: Fri, 7 Jun 2024 13:13:00 +0000 (+0530) Subject: mgr/dashboard: get bucket replication info X-Git-Tag: v20.0.0~1667^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9cdb55c2d2ed6f6ca4ab51d0cd40943107d90c0d;p=ceph.git mgr/dashboard: get bucket replication info - Show bucket replication status and replication policy in the details view Fixes: https://tracker.ceph.com/issues/66241 Signed-off-by: Nizamudeen A --- diff --git a/src/pybind/mgr/dashboard/controllers/rgw.py b/src/pybind/mgr/dashboard/controllers/rgw.py index a6d8c878a092..a87ebf12494f 100644 --- a/src/pybind/mgr/dashboard/controllers/rgw.py +++ b/src/pybind/mgr/dashboard/controllers/rgw.py @@ -409,6 +409,10 @@ class RgwBucket(RgwRESTController): multisite.create_dashboard_admin_sync_group(zonegroup_name=zonegroup_name) return rgw_client.set_bucket_replication(bucket_name, replication) + def _get_replication(self, bucket_name: str): + rgw_client = RgwClient.admin_instance() + return rgw_client.get_bucket_replication(bucket_name) + @staticmethod def strip_tenant_from_bucket_name(bucket_name): # type (str) -> str @@ -463,6 +467,7 @@ class RgwBucket(RgwRESTController): result['mfa_delete'] = versioning['MfaDelete'] result['bucket_policy'] = self._get_policy(bucket_name, daemon_name, result['owner']) result['acl'] = self._get_acl(bucket_name, daemon_name, result['owner']) + result['replication'] = self._get_replication(bucket_name) # Append the locking configuration. locking = self._get_locking(result['owner'], daemon_name, bucket_name) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.html index a68ea5661e20..f0b5f1872bcb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.html @@ -20,6 +20,11 @@ class="bold">Encryption {{ selection.encryption }} + + Replication + {{ replicationStatus }} + MFA Delete @@ -130,6 +135,11 @@ class="bold w-25">Bucket policy
{{ selection.bucket_policy | json}}
+ + Replication policy +
{{ selection.replication | json}}
+ ACL diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.ts index 451a7dd38111..1a709f8644f0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-details/rgw-bucket-details.component.ts @@ -14,6 +14,7 @@ export class RgwBucketDetailsComponent implements OnChanges { selection: any; aclPermissions: Record = {}; + replicationStatus = $localize`Disabled`; constructor(private rgwBucketService: RgwBucketService) {} @@ -23,6 +24,8 @@ export class RgwBucketDetailsComponent implements OnChanges { bucket['lock_retention_period_days'] = this.rgwBucketService.getLockDays(bucket); this.selection = bucket; this.aclPermissions = this.parseXmlAcl(this.selection.acl, this.selection.owner); + if (this.selection.replication?.['Rule']?.['Status']) + this.replicationStatus = this.selection.replication?.['Rule']?.['Status']; }); } } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html index 22b094d6bd54..87dbee26dc2e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html @@ -408,7 +408,8 @@ Enables replication for the objects in the bucket. -
+