From: Imran Imtiaz Date: Fri, 5 Dec 2025 08:46:40 +0000 (+0000) Subject: mgr/dashboard: add API endpoint for consistency group name update X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d9b8ca1af8d1e8991f0dc8580ee152886af89f5a;p=ceph.git mgr/dashboard: add API endpoint for consistency group name update Signed-off-by: Imran Imtiaz Fixes: https://tracker.ceph.com/issues/74121 Add a dashboard API endpoint to update (rename) consistency groups. --- diff --git a/src/pybind/mgr/dashboard/controllers/rbd.py b/src/pybind/mgr/dashboard/controllers/rbd.py index 4c1bbadc82f..fb8a6a3f78b 100644 --- a/src/pybind/mgr/dashboard/controllers/rbd.py +++ b/src/pybind/mgr/dashboard/controllers/rbd.py @@ -533,6 +533,22 @@ class RbdGroup(RESTController): ioctx.set_namespace(namespace) return self.rbd_inst.group_create(ioctx, name) + @handle_rbd_error() + @EndpointDoc("Update a group", + parameters={ + 'pool_name': (str, 'Name of the pool'), + 'group_name': (str, 'Name of the group'), + 'new_name': (str, 'New name for the group'), + }, + responses={200: None}) + def set(self, pool_name, group_name, new_name, namespace=None): + with mgr.rados.open_ioctx(pool_name) as ioctx: + RbdService.validate_namespace(ioctx, namespace) + ioctx.set_namespace(namespace) + if new_name == group_name: + return None + return self.rbd_inst.group_rename(ioctx, group_name, new_name) + @RESTController.Collection('POST', path='/{group_name}/image') @handle_rbd_error() @EndpointDoc("Add image to a group", diff --git a/src/pybind/mgr/dashboard/openapi.yaml b/src/pybind/mgr/dashboard/openapi.yaml index da561a761c1..136877377e1 100755 --- a/src/pybind/mgr/dashboard/openapi.yaml +++ b/src/pybind/mgr/dashboard/openapi.yaml @@ -1738,6 +1738,60 @@ paths: summary: Get the list of images in a group tags: - RbdGroup + put: + parameters: + - description: Name of the pool + in: path + name: pool_name + required: true + schema: + type: string + - description: Name of the group + in: path + name: group_name + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + namespace: + type: string + new_name: + description: New name for the group + type: string + required: + - new_name + type: object + responses: + '200': + content: + application/vnd.ceph.api.v1.0+json: + schema: + properties: {} + type: object + description: Resource updated. + '202': + content: + application/vnd.ceph.api.v1.0+json: + type: object + description: Operation is still executing. Please check the task queue. + '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: [] + summary: Update a group + tags: + - RbdGroup /api/block/pool/{pool_name}/group/{group_name}/image: delete: parameters: