Skip to content

Commit 55bce00

Browse files
authored
Merge pull request ceph#61870 from afreen23/backward-compatibility
mgr/dashboard: Make API backward compatible with size param change Reviewed-by: Afreen Misbah <[email protected]>
2 parents cfe543f + 5d5cf5b commit 55bce00

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ def io_stats(self, nqn: str, nsid: str, gw_group: Optional[str] = None):
340340
"rbd_pool": Param(str, "RBD pool name"),
341341
"rbd_image_name": Param(str, "RBD image name"),
342342
"create_image": Param(bool, "Create RBD image"),
343+
"size": Param(int, "RBD image size"),
343344
"rbd_image_size": Param(int, "RBD image size"),
344345
"block_size": Param(int, "NVMeoF namespace block size"),
345346
"load_balancing_group": Param(int, "Load balancing group"),
@@ -355,7 +356,8 @@ def create(
355356
rbd_image_name: str,
356357
rbd_pool: str = "rbd",
357358
create_image: Optional[bool] = True,
358-
rbd_image_size: Optional[int] = 1024,
359+
size: Optional[int] = 1024,
360+
rbd_image_size: Optional[int] = None,
359361
block_size: int = 512,
360362
load_balancing_group: Optional[int] = None,
361363
gw_group: Optional[str] = None,
@@ -367,7 +369,7 @@ def create(
367369
rbd_pool_name=rbd_pool,
368370
block_size=block_size,
369371
create_image=create_image,
370-
size=rbd_image_size,
372+
size=rbd_image_size or size,
371373
anagrpid=load_balancing_group,
372374
)
373375
)

src/pybind/mgr/dashboard/openapi.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9013,13 +9013,16 @@ paths:
90139013
description: RBD image name
90149014
type: string
90159015
rbd_image_size:
9016-
default: 1024
90179016
description: RBD image size
90189017
type: integer
90199018
rbd_pool:
90209019
default: rbd
90219020
description: RBD pool name
90229021
type: string
9022+
size:
9023+
default: 1024
9024+
description: RBD image size
9025+
type: integer
90239026
required:
90249027
- rbd_image_name
90259028
type: object

0 commit comments

Comments
 (0)