"pool_name": (str, 'pool name')
}]
+RBD_GROUP_LIST_SCHEMA = [{
+ "group": (str, 'group name'),
+ "num_images": (int, '')
+}]
+
# pylint: disable=not-callable
def RbdTask(name, metadata, wait_for): # noqa: N802
'num_images': len(images) if images else 0
})
return result
+
+
+@APIRouter('/block/pool/{pool_name}/group', Scope.RBD_IMAGE)
+@APIDoc("RBD Group Management API", "RbdGroup")
+class RbdGroup(RESTController):
+ def __init__(self):
+ super().__init__()
+ self.rbd_inst = rbd.RBD()
+
+ @EndpointDoc("Display RBD Groups by pool name",
+ parameters={
+ 'pool_name': (str, 'Name of the pool'),
+ },
+ responses={200: RBD_GROUP_LIST_SCHEMA})
+ def list(self, pool_name):
+ with mgr.rados.open_ioctx(pool_name) as ioctx:
+ result = []
+ groups = self.rbd_inst.group_list(ioctx)
+ for group in groups:
+ result.append({
+ 'group': group,
+ 'num_images': len(list(rbd.Group(ioctx, group).list_images()))
+ })
+ return result
- jwt: []
tags:
- RbdMirroringSummary
+ /api/block/pool/{pool_name}/group:
+ get:
+ parameters:
+ - description: Name of the pool
+ in: path
+ name: pool_name
+ required: true
+ schema:
+ type: string
+ responses:
+ '200':
+ content:
+ application/vnd.ceph.api.v1.0+json:
+ schema:
+ items:
+ properties:
+ group:
+ description: group name
+ type: string
+ num_images:
+ description: ''
+ type: integer
+ type: object
+ required:
+ - group
+ - num_images
+ type: array
+ description: OK
+ '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: Display RBD Groups by pool name
+ tags:
+ - RbdGroup
/api/block/pool/{pool_name}/namespace:
get:
parameters:
name: RGW Topic Management
- description: RBD Management API
name: Rbd
+- description: RBD Group Management API
+ name: RbdGroup
- description: RBD Mirroring Management API
name: RbdMirroring
- description: RBD Mirroring Pool Bootstrap Management API