]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Make API backward compatible with size param change
authorAfreen Misbah <afreen@ibm.com>
Tue, 18 Feb 2025 11:24:19 +0000 (16:54 +0530)
committerAfreen Misbah <your@email.com>
Wed, 19 Feb 2025 19:26:04 +0000 (00:56 +0530)
- We changed the api with size and now its an issue for other folks utilizing the API
- Hence making it compatible to work backwards as well

Fixes https://tracker.ceph.com/issues/70020

Signed-off-by: Afreen Misbah <afreen@ibm.com>
src/pybind/mgr/dashboard/controllers/nvmeof.py
src/pybind/mgr/dashboard/openapi.yaml

index a1af3948d6d9c7f767ddcd9be1d877de2cdb5cee..4ae3f79ed3004c4f74a353b55a573f2be9f84c77 100644 (file)
@@ -340,6 +340,7 @@ else:
                 "rbd_pool": Param(str, "RBD pool name"),
                 "rbd_image_name": Param(str, "RBD image name"),
                 "create_image": Param(bool, "Create RBD image"),
+                "size": Param(int, "RBD image size"),
                 "rbd_image_size": Param(int, "RBD image size"),
                 "block_size": Param(int, "NVMeoF namespace block size"),
                 "load_balancing_group": Param(int, "Load balancing group"),
@@ -355,7 +356,8 @@ else:
             rbd_image_name: str,
             rbd_pool: str = "rbd",
             create_image: Optional[bool] = True,
-            rbd_image_size: Optional[int] = 1024,
+            size: Optional[int] = 1024,
+            rbd_image_size: Optional[int] = None,
             block_size: int = 512,
             load_balancing_group: Optional[int] = None,
             gw_group: Optional[str] = None,
@@ -367,7 +369,7 @@ else:
                     rbd_pool_name=rbd_pool,
                     block_size=block_size,
                     create_image=create_image,
-                    size=rbd_image_size,
+                    size=rbd_image_size or size,
                     anagrpid=load_balancing_group,
                 )
             )
index c4fb7fc9465bdef28fcd254c6b20b759f78d27e1..f30490e73c2cf5390457a158843df7e7f24445b9 100644 (file)
@@ -9013,13 +9013,16 @@ paths:
                   description: RBD image name
                   type: string
                 rbd_image_size:
-                  default: 1024
                   description: RBD image size
                   type: integer
                 rbd_pool:
                   default: rbd
                   description: RBD pool name
                   type: string
+                size:
+                  default: 1024
+                  description: RBD image size
+                  type: integer
               required:
               - rbd_image_name
               type: object