From c275c4eca2b7550558f5604e45cda826a962c76a Mon Sep 17 00:00:00 2001 From: Imran Imtiaz Date: Wed, 12 Nov 2025 14:04:44 +0000 Subject: [PATCH] mgr/dashboard: add API endpoint to create consistency groups Signed-off-by: Imran Imtiaz Fixes: https://tracker.ceph.com/issues/73821 Add the ability to create a consistency group via the Dashboard API. --- src/pybind/mgr/dashboard/controllers/rbd.py | 9 +++++ src/pybind/mgr/dashboard/openapi.yaml | 44 +++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/src/pybind/mgr/dashboard/controllers/rbd.py b/src/pybind/mgr/dashboard/controllers/rbd.py index 591a04e676d28..c1d1c01934b5f 100644 --- a/src/pybind/mgr/dashboard/controllers/rbd.py +++ b/src/pybind/mgr/dashboard/controllers/rbd.py @@ -486,3 +486,12 @@ class RbdGroup(RESTController): 'num_images': len(list(rbd.Group(ioctx, group).list_images())) }) return result + + @EndpointDoc("Create an RBD Group", + parameters={ + 'pool_name': (str, 'Name of the pool'), + 'name': (str, 'Name of the group'), + }) + def create(self, pool_name, name): + with mgr.rados.open_ioctx(pool_name) as ioctx: + return self.rbd_inst.group_create(ioctx, name) diff --git a/src/pybind/mgr/dashboard/openapi.yaml b/src/pybind/mgr/dashboard/openapi.yaml index abe9d85d11b93..ca0163d98f69e 100755 --- a/src/pybind/mgr/dashboard/openapi.yaml +++ b/src/pybind/mgr/dashboard/openapi.yaml @@ -1632,6 +1632,50 @@ paths: summary: Display RBD Groups by pool name tags: - RbdGroup + post: + parameters: + - description: Name of the pool + in: path + name: pool_name + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + name: + description: Name of the group + type: string + required: + - name + type: object + responses: + '201': + content: + application/vnd.ceph.api.v1.0+json: + type: object + description: Resource created. + '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: Create an RBD Group + tags: + - RbdGroup /api/block/pool/{pool_name}/namespace: get: parameters: -- 2.39.5