]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: show non default realm sync status in rgw overview page
authorAashish Sharma <aasharma@li-e74156cc-2f67-11b2-a85c-e98659a63c5c.ibm.com>
Wed, 25 Sep 2024 12:39:32 +0000 (18:09 +0530)
committerAashish Sharma <Aashish.Sharma1@ibm.com>
Fri, 29 Aug 2025 04:36:45 +0000 (10:06 +0530)
Currently, we just show the sync status of the default realm in rgw
overview page. This PR is to show the sync status of non-default realms
as well. Multisite sync status can be viewed for any of the active daemon
which runs in default/non-default realm.

Fixes: https://tracker.ceph.com/issues/68329
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit ea53aceb8d72187f7f8629aa6d3b66c7cca88a86)

Conflicts:
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-overview-dashboard/rgw-overview-dashboard.component.ts
src/pybind/mgr/dashboard/openapi.yaml

src/pybind/mgr/dashboard/controllers/rgw.py
src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-multisite.service.ts
src/pybind/mgr/dashboard/services/rgw_client.py

index ddf3acad802d2055eeb6c6f2d421e3c79a07630b..2d63cef12f38164f16cd24d645de1fc3f763c2a4 100644 (file)
@@ -113,9 +113,9 @@ class RgwMultisiteStatus(RESTController):
     @RESTController.Collection(method='GET', path='/sync_status')
     @allow_empty_body
     # pylint: disable=W0102,W0613
-    def get_sync_status(self):
+    def get_sync_status(self, daemon_name=None):
         multisite_instance = RgwMultisite()
-        result = multisite_instance.get_multisite_sync_status()
+        result = multisite_instance.get_multisite_sync_status(daemon_name)
         return result
 
 
index d36c3a29e1a955615a3e25ea1b2aec80887c94cf..3ad74bcaff65ea614f978ef1904205dfc226a268 100644 (file)
@@ -27,6 +27,8 @@ export class RgwMultisiteService {
   }
 
   getSyncStatus() {
-    return this.http.get(`${this.url}/sync_status`);
+    return this.rgwDaemonService.request((params: HttpParams) => {
+      return this.http.get(`${this.url}/sync_status`, { params: params });
+    });
   }
 }
index 46d7b7ba786f3a43e2726d7ec1b9ddcdeea3a59c..2cd92177d1c91fd8145cec65914c17475e8f4e58 100644 (file)
@@ -1650,8 +1650,16 @@ class RgwMultisite:
             is_multisite_configured = False
         return is_multisite_configured
 
-    def get_multisite_sync_status(self):
+    def get_multisite_sync_status(self, daemon_name: str):
         rgw_multisite_sync_status_cmd = ['sync', 'status']
+        daemons = _get_daemons()
+        try:
+            realm_name = daemons[daemon_name].realm_name
+        except (KeyError, AttributeError):
+            raise DashboardException('Unable to get realm name from daemon',
+                                     http_status_code=500, component='rgw')
+        if realm_name:
+            rgw_multisite_sync_status_cmd.extend(['--rgw-realm', realm_name])
         try:
             exit_code, out, _ = mgr.send_rgwadmin_command(rgw_multisite_sync_status_cmd, False)
             if exit_code > 0: