@APIRouter("/nvmeof/subsystem/{nqn}/namespace", Scope.NVME_OF)
@APIDoc("NVMe-oF Subsystem Namespace Management API", "NVMe-oF Subsystem Namespace")
+ # pylint: disable=too-many-public-methods
class NVMeoFNamespace(RESTController):
@pick("namespaces")
@NvmeofCLICommand(
)
)
+ @ReadPermission
+ @Endpoint('PUT', '{nsid}/unpin')
+ @NvmeofCLICommand(
+ "nvmeof namespace unpin",
+ model=model.RequestStatus,
+ alias="nvmeof ns unpin",
+ success_message_template=(
+ 'Unpinning load balancing group for namespace {nsid} '
+ 'in {nqn}: Successful'
+ ),
+ )
+ @EndpointDoc(
+ "Unpin namespace load balancing group",
+ parameters={
+ "nqn": Param(str, "NVMeoF subsystem NQN"),
+ "nsid": Param(str, "NVMeoF Namespace ID"),
+ "gw_group": Param(str, "NVMeoF gateway group", True, None),
+ "server_address": Param(str, "NVMeoF gateway address", True, None),
+ "traddr": Param(str, "NVMeoF gateway address (deprecated)", True, None),
+ },
+ )
+ @convert_to_model(model.RequestStatus)
+ @handle_nvmeof_error
+ def unpin_ns(
+ self,
+ nqn: str,
+ nsid: str,
+ gw_group: Optional[str] = None,
+ server_address: Optional[str] = None,
+ traddr: Optional[str] = None
+ ):
+ server_address = resolve_nvmeof_server_address(
+ server_address=server_address,
+ traddr=traddr
+ )
+ return NVMeoFClient(
+ gw_group=gw_group,
+ server_address=server_address
+ ).stub.namespace_unpin(
+ NVMeoFClient.pb2.namespace_unpin_req(
+ subsystem_nqn=nqn,
+ nsid=int(nsid),
+ )
+ )
+
@pick("namespaces", first=True)
@NvmeofCLICommand(
"nvmeof namespace update", model.NamespaceList, alias="nvmeof ns update"
to all or selected hosts
tags:
- NVMe-oF Subsystem Namespace
+ /api/nvmeof/subsystem/{nqn}/namespace/{nsid}/unpin:
+ put:
+ parameters:
+ - description: NVMeoF subsystem NQN
+ in: path
+ name: nqn
+ required: true
+ schema:
+ type: string
+ - description: NVMeoF Namespace ID
+ in: path
+ name: nsid
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ properties:
+ gw_group:
+ description: NVMeoF gateway group
+ type: string
+ server_address:
+ description: NVMeoF gateway address
+ type: string
+ traddr:
+ description: NVMeoF gateway address (deprecated)
+ type: string
+ type: object
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ type: object
+ application/vnd.ceph.api.v1.0+json:
+ schema:
+ type: object
+ description: Resource updated.
+ '202':
+ content:
+ application/json:
+ schema:
+ type: object
+ application/vnd.ceph.api.v1.0+json:
+ schema:
+ type: object
+ description: Operation is still executing. Please check the task queue.
+ '400':
+ description: Operation exception. Please check the response body for details.
+ '401':
+ description: Unauthenticated access. Please login first.
+ '403':
+ description: Unauthorized access. Please check your permissions.
+ '500':
+ description: Unexpected error. Please check the response body for the stack
+ trace.
+ security:
+ - jwt: []
+ summary: Unpin namespace load balancing group
+ tags:
+ - NVMe-oF Subsystem Namespace
/api/osd:
get:
parameters: