]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Add secure and verify-host-name to "listener add" on NVMeoF CLI. 67799/head
authorGil Bregman <gbregman@il.ibm.com>
Thu, 12 Mar 2026 14:23:49 +0000 (16:23 +0200)
committerGil Bregman <gbregman@il.ibm.com>
Sun, 15 Mar 2026 09:01:29 +0000 (11:01 +0200)
Also add missing "manual" field in "listener list".

Fixes: https://tracker.ceph.com/issues/75447
Signed-off-by: Gil Bregman <gbregman@il.ibm.com>
(cherry picked from commit 6744a43d1bc4d021447323caee55b1ff6e0ae997)

src/pybind/mgr/dashboard/controllers/nvmeof.py
src/pybind/mgr/dashboard/model/nvmeof.py
src/pybind/mgr/dashboard/openapi.yaml [changed mode: 0755->0644]

index f1bf1c11824228cf10cd671985d8800803d3976d..296fd1abd414aaa5207d22cd51b9d39314ea6fba 100644 (file)
@@ -348,6 +348,11 @@ else:
                 "trsvcid": Param(int, "NVMeoF transport service port", True, 4420),
                 "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),
+                "verify_host_name": Param(bool,
+                                          "Fail if the host name doesn't match the "
+                                          "gateway's host name",
+                                          True, False),
             },
         )
         @convert_to_model(model.RequestStatus)
@@ -359,7 +364,9 @@ else:
             traddr: str,
             trsvcid: int = 4420,
             adrfam: int = 0,  # IPv4,
-            gw_group: Optional[str] = None
+            gw_group: Optional[str] = None,
+            secure: Optional[bool] = False,
+            verify_host_name: Optional[bool] = False,
         ):
             return NVMeoFClient(gw_group=gw_group, traddr=traddr).stub.create_listener(
                 NVMeoFClient.pb2.create_listener_req(
@@ -368,6 +375,8 @@ else:
                     traddr=traddr,
                     trsvcid=int(trsvcid),
                     adrfam=int(adrfam),
+                    secure=str_to_bool(secure),
+                    verify_host_name=str_to_bool(verify_host_name),
                 )
             )
 
index d5dde3cea4c04215680ec3bc09df06954309a4f8..f256cbb3327a15b202a310a733164550f17bdefb 100644 (file)
@@ -183,11 +183,12 @@ class NamespaceIOStats(NamedTuple):
 class Listener(NamedTuple):
     host_name: Annotated[str, CliHeader("Host")]
     trtype: Annotated[str, CliHeader("Transport")]
-    traddr: Annotated[str, CliHeader("Target Address")]
+    adrfam: Annotated[int, CliHeader("Address Family")]  # 0: IPv4, 1: IPv6
+    traddr: Annotated[str, CliHeader("Address")]
+    trsvcid: Annotated[int, CliHeader("Port")]
     secure: Optional[bool]
     active: Optional[bool]
-    adrfam: Annotated[int, CliHeader("Address Family")] = 0  # 0: IPv4, 1: IPv6
-    trsvcid: Annotated[int, CliHeader("Target Port")] = 4420
+    manual: Optional[bool]
 
 
 class ListenerList(NamedTuple):
old mode 100755 (executable)
new mode 100644 (file)
index dec615b..31ee1c7
@@ -10030,6 +10030,10 @@ paths:
                 host_name:
                   description: NVMeoF hostname
                   type: string
+                secure:
+                  default: false
+                  description: Use a secure channel
+                  type: boolean
                 traddr:
                   description: NVMeoF transport address
                   type: string
@@ -10037,6 +10041,11 @@ paths:
                   default: 4420
                   description: NVMeoF transport service port
                   type: integer
+                verify_host_name:
+                  default: false
+                  description: Fail if the host name doesn't match the gateway's host
+                    name
+                  type: boolean
               required:
               - host_name
               - traddr