ioctx.set_namespace(namespace)
group = rbd.Group(ioctx, group_name)
return group.remove_snap(snapshot_name)
+
+ @RbdTask('group_snap/update',
+ ['{pool_name}', '{group_name}', '{snapshot_name}'], 4.0)
+ @EndpointDoc("Update a group snapshot",
+ parameters={
+ 'pool_name': (str, 'Name of the pool'),
+ 'group_name': (str, 'Name of the group'),
+ 'snapshot_name': (str, 'Current name of the snapshot'),
+ 'new_snap_name': (str, 'New name for the snapshot'),
+ },
+ responses={200: None})
+ def set(self, pool_name, group_name, snapshot_name, new_snap_name=None, namespace=None):
+ with mgr.rados.open_ioctx(pool_name) as ioctx:
+ RbdService.validate_namespace(ioctx, namespace)
+ ioctx.set_namespace(namespace)
+ group = rbd.Group(ioctx, group_name)
+ if new_snap_name and new_snap_name != snapshot_name:
+ return group.rename_snap(snapshot_name, new_snap_name)
+ return None
+
+ @RbdTask('group_snap/rollback',
+ ['{pool_name}', '{group_name}', '{snapshot_name}'], 5.0)
+ @RESTController.Resource('POST')
+ @UpdatePermission
+ @allow_empty_body
+ @EndpointDoc("Rollback group to snapshot",
+ parameters={
+ 'pool_name': (str, 'Name of the pool'),
+ 'group_name': (str, 'Name of the group'),
+ 'snapshot_name': (str, 'Name of the snapshot'),
+ },
+ responses={200: None})
+ def rollback(self, pool_name, group_name, snapshot_name, namespace=None):
+ with mgr.rados.open_ioctx(pool_name) as ioctx:
+ RbdService.validate_namespace(ioctx, namespace)
+ ioctx.set_namespace(namespace)
+ group = rbd.Group(ioctx, group_name)
+ return group.rollback_to_snap(snapshot_name)
summary: Get group snapshot information
tags:
- RbdGroupSnapshot
+ put:
+ 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
+ - description: Current name of the snapshot
+ in: path
+ name: snapshot_name
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ properties:
+ namespace:
+ type: string
+ new_snap_name:
+ description: New name for the snapshot
+ type: string
+ type: object
+ responses:
+ '200':
+ content:
+ application/vnd.ceph.api.v1.0+json:
+ schema:
+ properties: {}
+ type: object
+ description: Resource updated.
+ '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: Update a group snapshot
+ tags:
+ - RbdGroupSnapshot
+ /api/block/pool/{pool_name}/group/{group_name}/snap/{snapshot_name}/rollback:
+ post:
+ 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
+ - description: Name of the snapshot
+ in: path
+ name: snapshot_name
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ properties:
+ namespace:
+ type: string
+ 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: Rollback group to snapshot
+ tags:
+ - RbdGroupSnapshot
/api/block/pool/{pool_name}/namespace:
get:
parameters: