From b63e086fd56069c36fd792b63457e0894e34c13c Mon Sep 17 00:00:00 2001 From: Aashish Sharma Date: Thu, 18 Jan 2024 13:28:46 +0530 Subject: [PATCH] mgr/dashboard: Export rgw multisite status via the API Fixes: https://tracker.ceph.com/issues/64081 Signed-off-by: Aashish Sharma --- src/pybind/mgr/dashboard/controllers/rgw.py | 5 ++++ .../app/shared/api/rgw-multisite.service.ts | 5 ++-- src/pybind/mgr/dashboard/openapi.yaml | 24 +++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/dashboard/controllers/rgw.py b/src/pybind/mgr/dashboard/controllers/rgw.py index 661dc8afb6dad..0a347a44d888e 100644 --- a/src/pybind/mgr/dashboard/controllers/rgw.py +++ b/src/pybind/mgr/dashboard/controllers/rgw.py @@ -86,6 +86,7 @@ class Rgw(BaseController): class RgwMultisiteStatus(RESTController): @Endpoint() @ReadPermission + @EndpointDoc("Get the multisite sync status") # pylint: disable=R0801 def status(self): status = {'available': True, 'message': None} @@ -110,6 +111,10 @@ class RgwMultisiteStatus(RESTController): secret_key) return result + +@APIRouter('rgw/multisite', Scope.RGW) +@APIDoc("RGW Multisite Management API", "RgwMultisite") +class RgwMultisiteSyncStatus(RESTController): @RESTController.Collection(method='GET', path='/sync_status') @allow_empty_body # pylint: disable=W0102,W0613 diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-multisite.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-multisite.service.ts index d36c3a29e1a95..da789d29fc495 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-multisite.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-multisite.service.ts @@ -7,7 +7,8 @@ import { RgwDaemonService } from './rgw-daemon.service'; providedIn: 'root' }) export class RgwMultisiteService { - private url = 'ui-api/rgw/multisite'; + private uiUrl = 'ui-api/rgw/multisite'; + private url = 'api/rgw/multisite'; constructor(private http: HttpClient, public rgwDaemonService: RgwDaemonService) {} @@ -22,7 +23,7 @@ export class RgwMultisiteService { access_key: zone.system_key.access_key, secret_key: zone.system_key.secret_key }); - return this.http.put(`${this.url}/migrate`, null, { params: params }); + return this.http.put(`${this.uiUrl}/migrate`, null, { params: params }); }); } diff --git a/src/pybind/mgr/dashboard/openapi.yaml b/src/pybind/mgr/dashboard/openapi.yaml index fb2b7059a53a3..73ad27c36e67c 100644 --- a/src/pybind/mgr/dashboard/openapi.yaml +++ b/src/pybind/mgr/dashboard/openapi.yaml @@ -9545,6 +9545,28 @@ paths: - jwt: [] tags: - RgwDaemon + /api/rgw/multisite/sync_status: + get: + parameters: [] + responses: + '200': + content: + application/vnd.ceph.api.v1.0+json: + type: object + description: OK + '400': + description: Operation exception. Please check the response body for details. + '401': + description: Unauthenticated access. Please login first. + '403': + description: Unauthorized access. Please check your permissions. + '500': + description: Unexpected error. Please check the response body for the stack + trace. + security: + - jwt: [] + tags: + - RgwMultisite /api/rgw/realm: get: parameters: [] @@ -13194,6 +13216,8 @@ tags: name: RgwDaemon - description: Rgw Mirroring Perf Counters Management API name: RgwMirrorPerfCounter +- description: RGW Multisite Management API + name: RgwMultisite - description: Rgw Perf Counters Management API name: RgwPerfCounter - description: '*No description available*' -- 2.39.5