Skip to content

Commit 734e239

Browse files
authored
Merge pull request ceph#65610 from Hezko/nvmeof-cli-ns-list-nsid-param
mgr/dashboard: add nsid param to ns list command Reviewed-by: Nizamudeen A <[email protected]>
2 parents 629e419 + 551ff3d commit 734e239

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,14 +379,17 @@ class NVMeoFNamespace(RESTController):
379379
"List all NVMeoF namespaces in a subsystem",
380380
parameters={
381381
"nqn": Param(str, "NVMeoF subsystem NQN"),
382+
"nsid": Param(str, "NVMeoF Namespace ID to filter by", True, None),
382383
"gw_group": Param(str, "NVMeoF gateway group", True, None),
383384
},
384385
)
385386
@convert_to_model(model.NamespaceList)
386387
@handle_nvmeof_error
387-
def list(self, nqn: str, gw_group: Optional[str] = None, traddr: Optional[str] = None):
388+
def list(self, nqn: str, nsid: Optional[str] = None,
389+
gw_group: Optional[str] = None, traddr: Optional[str] = None):
388390
return NVMeoFClient(gw_group=gw_group, traddr=traddr).stub.list_namespaces(
389-
NVMeoFClient.pb2.list_namespaces_req(subsystem=nqn)
391+
NVMeoFClient.pb2.list_namespaces_req(subsystem=nqn,
392+
nsid=int(nsid) if nsid else None)
390393
)
391394

392395
@pick("namespaces", first=True)

src/pybind/mgr/dashboard/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9301,6 +9301,12 @@ paths:
93019301
required: true
93029302
schema:
93039303
type: string
9304+
- allowEmptyValue: true
9305+
description: NVMeoF Namespace ID to filter by
9306+
in: query
9307+
name: nsid
9308+
schema:
9309+
type: string
93049310
- allowEmptyValue: true
93059311
description: NVMeoF gateway group
93069312
in: query

0 commit comments

Comments
 (0)