]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Allow empty port value when adding a listener in NVMEoF CLI 68766/head
authorGil Bregman <gbregman@il.ibm.com>
Tue, 5 May 2026 08:53:25 +0000 (11:53 +0300)
committerGil Bregman <gbregman@il.ibm.com>
Wed, 6 May 2026 09:52:43 +0000 (12:52 +0300)
Fixes: https://tracker.ceph.com/issues/76410
Signed-off-by: Gil Bregman <gbregman@il.ibm.com>
(cherry picked from commit 92237ee48467c7a2d03772592194cc059699ed63)

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

index c75ccd01f9dfe38ff97a186bb046329db97d2724..65feb5cda847d0b50a88721ef69641712ae32710 100644 (file)
@@ -345,7 +345,7 @@ else:
                 "nqn": Param(str, "NVMeoF subsystem NQN"),
                 "host_name": Param(str, "NVMeoF hostname"),
                 "traddr": Param(str, "NVMeoF transport address"),
-                "trsvcid": Param(int, "NVMeoF transport service port", True, 4420),
+                "trsvcid": Param(int, "NVMeoF transport service port", True, None),
                 "adrfam": Param(int, "NVMeoF address family (0 - IPv4, 1 - IPv6)", True, 0),
                 "gw_group": Param(str, "NVMeoF gateway group", True, None),
                 "secure": Param(bool, "Use a secure channel", True, False),
@@ -362,7 +362,7 @@ else:
             nqn: str,
             host_name: str,
             traddr: str,
-            trsvcid: int = 4420,
+            trsvcid: Optional[int] = None,
             adrfam: int = 0,  # IPv4,
             gw_group: Optional[str] = None,
             secure: Optional[bool] = False,
@@ -373,7 +373,7 @@ else:
                     nqn=nqn,
                     host_name=host_name,
                     traddr=traddr,
-                    trsvcid=int(trsvcid),
+                    trsvcid=int(trsvcid) if trsvcid is not None else None,
                     adrfam=int(adrfam),
                     secure=str_to_bool(secure),
                     verify_host_name=str_to_bool(verify_host_name),
@@ -388,7 +388,7 @@ else:
                 "nqn": Param(str, "NVMeoF subsystem NQN"),
                 "host_name": Param(str, "NVMeoF hostname"),
                 "traddr": Param(str, "NVMeoF transport address"),
-                "trsvcid": Param(int, "NVMeoF transport service port", True, 4420),
+                "trsvcid": Param(int, "NVMeoF transport service port"),
                 "adrfam": Param(int, "NVMeoF address family (0 - IPv4, 1 - IPv6)", True, 0),
                 "gw_group": Param(str, "NVMeoF gateway group", True, None),
             },
@@ -400,7 +400,7 @@ else:
             nqn: str,
             host_name: str,
             traddr: str,
-            trsvcid: int = 4420,
+            trsvcid: int,
             adrfam: int = 0,  # IPv4
             force: bool = False,
             gw_group: Optional[str] = None
index 510357627f4d210a3f4cdb242338bdff06d1c59a..288cc61d0a186982bd3f0dbf38c7fdbd90ec2f5a 100644 (file)
@@ -10272,7 +10272,6 @@ paths:
                   description: NVMeoF transport address
                   type: string
                 trsvcid:
-                  default: 4420
                   description: NVMeoF transport service port
                   type: integer
                 verify_host_name:
@@ -10309,7 +10308,7 @@ paths:
       summary: Create a new NVMeoF listener
       tags:
       - NVMe-oF Subsystem Listener
-  /api/nvmeof/subsystem/{nqn}/listener/{host_name}/{traddr}:
+  /api/nvmeof/subsystem/{nqn}/listener/{host_name}/{traddr}/{trsvcid}:
     delete:
       parameters:
       - description: NVMeoF subsystem NQN
@@ -10330,10 +10329,10 @@ paths:
         required: true
         schema:
           type: string
-      - default: 4420
-        description: NVMeoF transport service port
-        in: query
+      - description: NVMeoF transport service port
+        in: path
         name: trsvcid
+        required: true
         schema:
           type: integer
       - default: 0