From 551ff3dbd44c33c556134b319b5e0c97c7518547 Mon Sep 17 00:00:00 2001 From: Tomer Haskalovitch Date: Wed, 17 Sep 2025 13:50:23 +0300 Subject: [PATCH] mgr/dashboard: add nsid param to ns list command Signed-off-by: Tomer Haskalovitch --- src/pybind/mgr/dashboard/controllers/nvmeof.py | 7 +++++-- src/pybind/mgr/dashboard/openapi.yaml | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/dashboard/controllers/nvmeof.py b/src/pybind/mgr/dashboard/controllers/nvmeof.py index 06537c189467b..40a7ad19e63d6 100644 --- a/src/pybind/mgr/dashboard/controllers/nvmeof.py +++ b/src/pybind/mgr/dashboard/controllers/nvmeof.py @@ -379,14 +379,17 @@ else: "List all NVMeoF namespaces in a subsystem", parameters={ "nqn": Param(str, "NVMeoF subsystem NQN"), + "nsid": Param(str, "NVMeoF Namespace ID to filter by", True, None), "gw_group": Param(str, "NVMeoF gateway group", True, None), }, ) @convert_to_model(model.NamespaceList) @handle_nvmeof_error - def list(self, nqn: str, gw_group: Optional[str] = None, traddr: Optional[str] = None): + def list(self, nqn: str, nsid: Optional[str] = None, + gw_group: Optional[str] = None, traddr: Optional[str] = None): return NVMeoFClient(gw_group=gw_group, traddr=traddr).stub.list_namespaces( - NVMeoFClient.pb2.list_namespaces_req(subsystem=nqn) + NVMeoFClient.pb2.list_namespaces_req(subsystem=nqn, + nsid=int(nsid) if nsid else None) ) @pick("namespaces", first=True) diff --git a/src/pybind/mgr/dashboard/openapi.yaml b/src/pybind/mgr/dashboard/openapi.yaml index f30651586dc4c..c724db5bd56a9 100755 --- a/src/pybind/mgr/dashboard/openapi.yaml +++ b/src/pybind/mgr/dashboard/openapi.yaml @@ -9301,6 +9301,12 @@ paths: required: true schema: type: string + - allowEmptyValue: true + description: NVMeoF Namespace ID to filter by + in: query + name: nsid + schema: + type: string - allowEmptyValue: true description: NVMeoF gateway group in: query -- 2.39.5