From: Imran Imtiaz Date: Wed, 12 Nov 2025 14:04:44 +0000 (+0000) Subject: mgr/dashboard: add API endpoint to create consistency groups X-Git-Tag: testing/wip-jcollin-testing-20260212.143545-tentacle~74^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=96c1d22511ec2c314bf190ab08185336f6538a86;p=ceph-ci.git 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. (cherry picked from commit c275c4eca2b7550558f5604e45cda826a962c76a) --- diff --git a/src/pybind/mgr/dashboard/controllers/rbd.py b/src/pybind/mgr/dashboard/controllers/rbd.py index 591a04e676d..c1d1c01934b 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 a2009eb3098..53335decfb7 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: