]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: add API endpoint to delete consistency group 66617/head
authorImran Imtiaz <imran.imtiaz@uk.ibm.com>
Fri, 12 Dec 2025 10:02:59 +0000 (10:02 +0000)
committerImran Imtiaz <imran.imtiaz@uk.ibm.com>
Fri, 12 Dec 2025 10:03:27 +0000 (10:03 +0000)
Signed-off-by: Imran Imtiaz <imran.imtiaz@uk.ibm.com>
Fixes: https://tracker.ceph.com/issues/74201
Add a dashboard API endpoint to delete a consistency group.

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

index fb8a6a3f78bf13cc30a19bebe9dec151c364ecb7..7d8cbd3afea11fd9575e7a21908d6374a9c1d90a 100644 (file)
@@ -534,7 +534,20 @@ class RbdGroup(RESTController):
             return self.rbd_inst.group_create(ioctx, name)
 
     @handle_rbd_error()
-    @EndpointDoc("Update a group",
+    @EndpointDoc("Delete a group",
+                 parameters={
+                     'pool_name': (str, 'Name of the pool'),
+                     'group_name': (str, 'Name of the group'),
+                 },
+                 responses={200: None})
+    def delete(self, pool_name, group_name, namespace=None):
+        with mgr.rados.open_ioctx(pool_name) as ioctx:
+            RbdService.validate_namespace(ioctx, namespace)
+            ioctx.set_namespace(namespace)
+            return self.rbd_inst.group_remove(ioctx, group_name)
+
+    @handle_rbd_error()
+    @EndpointDoc("Update a group (rename)",
                  parameters={
                      'pool_name': (str, 'Name of the pool'),
                      'group_name': (str, 'Name of the group'),
index 9ff77c843759b3c754052f5e22385d0f59b55662..328422dd14bd746fa97578c377af3810d62843bb 100755 (executable)
@@ -1684,6 +1684,50 @@ paths:
       tags:
       - RbdGroup
   /api/block/pool/{pool_name}/group/{group_name}:
+    delete:
+      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
+      - allowEmptyValue: true
+        in: query
+        name: namespace
+        schema:
+          type: string
+      responses:
+        '202':
+          content:
+            application/vnd.ceph.api.v1.0+json:
+              type: object
+          description: Operation is still executing. Please check the task queue.
+        '204':
+          content:
+            application/vnd.ceph.api.v1.0+json:
+              type: object
+          description: Resource deleted.
+        '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: Delete a group
+      tags:
+      - RbdGroup
     get:
       parameters:
       - description: Name of the pool
@@ -1789,7 +1833,7 @@ paths:
             trace.
       security:
       - jwt: []
-      summary: Update a group
+      summary: Update a group (rename)
       tags:
       - RbdGroup
   /api/block/pool/{pool_name}/group/{group_name}/image: