]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: add API endpoint to create consistency groups
authorImran Imtiaz <imran.imtiaz@uk.ibm.com>
Wed, 12 Nov 2025 14:04:44 +0000 (14:04 +0000)
committerImran Imtiaz <imran.imtiaz@uk.ibm.com>
Fri, 16 Jan 2026 10:57:32 +0000 (10:57 +0000)
Signed-off-by: Imran Imtiaz <imran.imtiaz@uk.ibm.com>
Fixes: https://tracker.ceph.com/issues/73821
Add the ability to create a consistency group via the Dashboard API.

(cherry picked from commit c275c4eca2b7550558f5604e45cda826a962c76a)

src/pybind/mgr/dashboard/controllers/rbd.py
src/pybind/mgr/dashboard/openapi.yaml

index 591a04e676d2816008ea7d9671418b2365751da7..c1d1c01934b5fce534166e1217b780f6afafe63c 100644 (file)
@@ -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)
index a2009eb309825651fef68afb6b9079df6157417a..53335decfb798d221c130aa6157753b110393162 100755 (executable)
@@ -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: