Skip to content

Commit 4b56f3d

Browse files
authored
Merge pull request ceph#66218 from imran-imtiaz/dashboard
mgr/dashboard: add API endpoint to create consistency groups Reviewed-by: Nizamudeen A <[email protected]>
2 parents c94c142 + c275c4e commit 4b56f3d

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,3 +486,12 @@ def list(self, pool_name):
486486
'num_images': len(list(rbd.Group(ioctx, group).list_images()))
487487
})
488488
return result
489+
490+
@EndpointDoc("Create an RBD Group",
491+
parameters={
492+
'pool_name': (str, 'Name of the pool'),
493+
'name': (str, 'Name of the group'),
494+
})
495+
def create(self, pool_name, name):
496+
with mgr.rados.open_ioctx(pool_name) as ioctx:
497+
return self.rbd_inst.group_create(ioctx, name)

src/pybind/mgr/dashboard/openapi.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,50 @@ paths:
16321632
summary: Display RBD Groups by pool name
16331633
tags:
16341634
- RbdGroup
1635+
post:
1636+
parameters:
1637+
- description: Name of the pool
1638+
in: path
1639+
name: pool_name
1640+
required: true
1641+
schema:
1642+
type: string
1643+
requestBody:
1644+
content:
1645+
application/json:
1646+
schema:
1647+
properties:
1648+
name:
1649+
description: Name of the group
1650+
type: string
1651+
required:
1652+
- name
1653+
type: object
1654+
responses:
1655+
'201':
1656+
content:
1657+
application/vnd.ceph.api.v1.0+json:
1658+
type: object
1659+
description: Resource created.
1660+
'202':
1661+
content:
1662+
application/vnd.ceph.api.v1.0+json:
1663+
type: object
1664+
description: Operation is still executing. Please check the task queue.
1665+
'400':
1666+
description: Operation exception. Please check the response body for details.
1667+
'401':
1668+
description: Unauthenticated access. Please login first.
1669+
'403':
1670+
description: Unauthorized access. Please check your permissions.
1671+
'500':
1672+
description: Unexpected error. Please check the response body for the stack
1673+
trace.
1674+
security:
1675+
- jwt: []
1676+
summary: Create an RBD Group
1677+
tags:
1678+
- RbdGroup
16351679
/api/block/pool/{pool_name}/namespace:
16361680
get:
16371681
parameters:

0 commit comments

Comments
 (0)