Module netapp_ontap.resources.nvme_subsystem
Copyright © 2019 NetApp Inc. All rights reserved.
Overview
An NVMe subsystem maintains configuration state and namespace access control for a set of NVMe-connected hosts.
The NVMe subsystem REST API allows you to create, update, delete, and discover NVMe subsystems as well as add and remove NVMe hosts that can access the subsystem and associated namespaces.
Examples
Creating an NVMe subsystem
# The API:
POST /api/protocols/nvme/subsystems
# The call:
curl -X POST 'https://<mgmt-ip>/api/protocols/nvme/subsystems' -H 'accept: application/hal+json' -d '{ "svm": { "name": "svm1" }, "name": "subsystem1", "os_type": "linux" }'
Retrieving all NVMe subsystems
# The API:
GET /api/protocols/nvme/subsystems
# The call:
curl -X GET 'https://<mgmt-ip>/api/protocols/nvme/subsystems' -H 'accept: application/hal+json'
# The response:
{
"records": [
{
"svm": {
"uuid": "a009a9e7-4081-b576-7575-ada21efcaf16",
"name": "svm1",
"_links": {
"self": {
"href": "/api/svm/svms/a009a9e7-4081-b576-7575-ada21efcaf16"
}
}
},
"uuid": "acde901a-a379-4a91-9ea6-1b728ed6696f",
"name": "subsystem1",
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f"
}
}
}
],
"num_records": 1,
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems"
}
}
}
Retrieving all NVMe subsystems with OS type linux
Note that the os_type
query parameter is used to perform the query.
# The API:
GET /api/protocols/nvme/subsystems
# The call:
curl -X GET 'https://<mgmt-ip>/api/protocols/nvme/subsystems?os_type=linux' -H 'accept: application/hal+json'
# The response:
{
"records": [
{
"svm": {
"uuid": "a009a9e7-4081-b576-7575-ada21efcaf16",
"name": "svm1",
"_links": {
"self": {
"href": "/api/svm/svms/a009a9e7-4081-b576-7575-ada21efcaf16"
}
}
},
"uuid": "acde901a-a379-4a91-9ea6-1b728ed6696f",
"name": "subsystem1",
"os_type": "linux",
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f"
}
}
}
],
"num_records": 1,
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems?os_type=linux"
}
}
}
Retrieving a specific NVMe subsystem
# The API:
GET /api/protocols/nvme/subsystems/{uuid}
# The call:
curl -X GET 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f' -H 'accept: application/hal+json'
# The response:
{
"svm": {
"uuid": "a009a9e7-4081-b576-7575-ada21efcaf16",
"name": "svm1",
"_links": {
"self": {
"href": "/api/svm/svms/a009a9e7-4081-b576-7575-ada21efcaf16"
}
}
},
"uuid": "acde901a-a379-4a91-9ea6-1b728ed6696f",
"name": "subsystem1",
"os_type": "linux",
"target_nqn": "nqn.1992-08.com.netapp:sn.d04594ef915b4c73b642169e72e4c0b1:subsystem.subsystem1",
"serial_number": "wtJNKNKD-uPLAAAAAAAD",
"io_queue": {
"default": {
"count": 4,
"depth": 32
}
}
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f"
}
}
}
Retrieving the NVMe namespaces mapped to a specific NVMe subsystem
Note that the fields
query parameter is used to specify the desired properties.
# The API:
GET /api/protocols/nvme/subsystems/{uuid}
# The call:
curl -X GET 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f?fields=subsystem_maps' -H 'accept: application/hal+json'
# The response:
{
"svm": {
"uuid": "a009a9e7-4081-b576-7575-ada21efcaf16",
"name": "svm1",
"_links": {
"self": {
"href": "/api/svm/svms/a009a9e7-4081-b576-7575-ada21efcaf16"
}
}
},
"uuid": "acde901a-a379-4a91-9ea6-1b728ed6696f",
"name": "subsystem1",
"subsystem_maps": [
{
"anagrpid": "00000001h",
"namespace": {
"uuid": "eeaaca23-128d-4a7d-be4a-dc9106705799",
"name": "/vol/vol1/namespace1"
"_links": {
"self": {
"href": "/api/storage/namespaces/eeaaca23-128d-4a7d-be4a-dc9106705799"
}
}
},
"nsid": "00000001h"
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystem_maps/acde901a-a379-4a91-9ea6-1b728ed6696f/eeaaca23-128d-4a7d-be4a-dc9106705799"
}
}
},
{
"anagrpid": "00000002h",
"namespace": {
"uuid": "feaaca23-83a0-4a7d-beda-dc9106705799",
"name": "/vol/vol1/namespace2"
"_links": {
"self": {
"href": "/api/storage/namespaces/feaaca23-83a0-4a7d-beda-dc9106705799"
}
}
},
"nsid": "00000002h"
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystem_maps/acde901a-a379-4a91-9ea6-1b728ed6696f/feaaca23-83a0-4a7d-beda-dc9106705799"
}
}
}
]
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f"
}
}
}
Adding a comment about an NVMe subsystem
# The API:
PATCH /api/protocols/nvme/subsystems/{uuid}
# The call:
curl -X PATCH 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f' -H 'accept: application/hal+json' -d '{ "comment": "A brief comment about the subsystem" }'
Deleting an NVMe subsystem
# The API:
DELETE /api/protocols/nvme/subsystems/{uuid}
# The call:
curl -X DELETE 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f' -H 'accept: application/hal+json'
Deleting an NVMe subsystem with mapped NVMe namespaces
Normally, deleting an NVMe subsystem that has mapped NVMe namespaces is not allowed. The deletion can be forced using the allow_delete_while_mapped
query parameter.
# The API:
DELETE /api/protocols/nvme/subsystems/{uuid}
# The call:
curl -X DELETE 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f?allow_delete_while_mapped=true' -H 'accept: application/hal+json'
Delete an NVMe subsystem with NVMe subsystem hosts
Normally, deleting an NVMe subsystem with NVMe subsystem hosts is disallowed. The deletion can be forced using the allow_delete_with_hosts
query parameter.
# The API:
DELETE /api/protocols/nvme/subsystems/{uuid}
# The call:
curl -X DELETE 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f?allow_delete_with_hosts=true' -H 'accept: application/hal+json'
An NVMe Subsystem Host
An NVMe subsystem host is a network host provisioned to an NVMe subsystem to access namespaces mapped to that subsystem.
Examples
Adding an NVMe subsystem host to an NVMe subsystem
# The API:
POST /protocols/nvme/subsystems/{subsystem.uuid}/hosts
# The call:
curl -X POST 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f/hosts' -H 'accept: application/hal+json' -d '{ "nqn": "nqn.1992-01.com.example:subsys1.host1" }'
Adding multiple NVMe subsystem hosts to an NVMe subsystem
# The API:
POST /protocols/nvme/subsystems/{subsystem.uuid}/hosts
# The call:
curl -X POST 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f/hosts' -H 'accept: application/hal+json' -d '{ "records": [ { "nqn": "nqn.1992-01.com.example:subsys1.host2" }, { "nqn": "nqn.1992-01.com.example:subsys1.host3" } ] }'
Retrieving all NVMe subsystem hosts for an NVMe subsystem
# The API:
GET /protocols/nvme/subsystems/{subsystem.uuid}/hosts
# The call:
curl -X GET 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f/hosts' -H 'accept: application/hal+json'
# The response:
{
"records": [
{
"nqn": "nqn.1992-01.com.example:subsys1.host1",
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f/hosts/nqn.1992-01.com.example%3Asubsys1.host1"
}
}
},
{
"nqn": "nqn.1992-01.com.example:subsys1.host2",
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f/hosts/nqn.1992-01.com.example%3Asubsys1.host2"
}
}
},
{
"nqn": "nqn.1992-01.com.example:subsys1.host3",
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f/hosts/nqn.1992-01.com.example%3Asubsys1.host3"
}
}
}
],
"num_records": 3,
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f/hosts"
}
}
}
Retrieving a specific NVMe subsystem host for an NVMe subsystem
# The API:
GET /protocols/nvme/subsystems/{subsystem.uuid}/hosts/{nqn}
# The call:
curl -X GET 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f/hosts/nqn.1992-01.com.example:subsys1.host1' -H 'accept: application/hal+json'
# The response:
{
"subsystem": {
"uuid": "acde901a-a379-4a91-9ea6-1b728ed6696f",
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f"
}
}
},
"nqn": "nqn.1992-01.com.example:subsys1.host1",
"io_queue": {
"count": 4,
"depth": 32
},
"_links": {
"self": {
"href": "/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f/hosts/nqn.1992-01.com.example%3Asubsys1.host1"
}
}
}
Deleting an NVMe subsystem host from an NVMe subsystem
# The API:
DELETE /protocols/nvme/subsystems/{subsystem.uuid}/hosts/{nqn}
# The call:
curl -X DELETE 'https://<mgmt-ip>/api/protocols/nvme/subsystems/acde901a-a379-4a91-9ea6-1b728ed6696f/hosts/nqn.1992-01.com.example:subsys1.host1' -H 'accept: application/hal+json'
Classes
class NvmeSubsystem (*args, **kwargs)
-
An NVMe subsystem maintains configuration state and namespace access control for a set of NVMe-connected hosts.
Initialize the instance of the resource.
Any keyword arguments are set on the instance as properties. For example, if the class was named 'MyResource', then this statement would be true:
MyResource(name='foo').name == 'foo'
Args
*args
- Each positional argument represents a parent key as used in the URL of the object. That is, each value will be used to fill in a segment of the URL which refers to some parent object. The order of these arguments must match the order they are specified in the URL, from left to right.
**kwargs
- each entry will have its key set as an attribute name on the instance and its value will be the value of that attribute.
Ancestors
Static methods
def delete_collection(*args, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Removes an NVMe subsystem.
Related ONTAP commands
vserver nvme subsystem delete
Learn more
Delete all objects in a collection which match the given query.
All records on the host which match the query will be deleted.
Args
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to delete the collection of bars for a particular foo, the foo.name value should be passed.
connection
- The
HostConnection
object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context. **kwargs
- Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def find(*args, connection: HostConnection = None, **kwargs) -> Resource
-
Retrieves NVMe subsystems.
Related ONTAP commands
vserver nvme subsystem host show
vserver nvme subsystem map show
vserver nvme subsystem show
Learn more
Find an instance of an object on the host given a query.
The host will be queried with the provided key/value pairs to find a matching resource. If 0 are found or if more than 1 is found, an error will be raised or returned. If there is exactly 1 matching record, then it will be returned.
Args
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to find a bar for a particular foo, the foo.name value should be passed.
connection
- The
HostConnection
object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context. **kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A
Resource
object containing the details of the object.Raises
NetAppRestError
: If the API call did not return exactly 1 matching resource. def get_collection(*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> typing.Iterable
-
Retrieves NVMe subsystems.
Related ONTAP commands
vserver nvme subsystem host show
vserver nvme subsystem map show
vserver nvme subsystem show
Learn more
Fetch a list of all objects of this type from the host.
Args
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the collection of bars for a particular foo, the foo.name value should be passed.
connection
- The
HostConnection
object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context. max_records
- The maximum number of records to return per call
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A list of
Resource
objectsRaises
NetAppRestError
: If there is no connection available to use either passed in or on the library. def patch_collection(body: dict, *args, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Updates an NVMe subsystem.
Related ONTAP commands
vserver nvme subsystem modify
Learn more
Patch all objects in a collection which match the given query.
All records on the host which match the query will be patched with the provided body.
Args
body
- A dictionary of name/value pairs to set on all matching members of the collection.
*args
- Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to patch the collection of bars for a particular foo, the foo.name value should be passed.
connection
- The
HostConnection
object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context. **kwargs
- Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400
Methods
def delete(self, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Removes an NVMe subsystem.
Related ONTAP commands
vserver nvme subsystem delete
Learn more
Send a deletion request to the host for this object.
Args
poll
- If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
- If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
- If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def get(self, **kwargs) -> NetAppResponse
-
Retrieves an NVMe subsystem.
Expensive properties
There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the
fields
query parameter. SeeDOC Requesting specific fields
to learn more. *subsystem_maps.*
Related ONTAP commands
vserver nvme subsystem host show
vserver nvme subsystem map show
vserver nvme subsystem show
Learn more
Fetch the details of the object from the host.
Requires the keys to be set (if any). After returning, new or changed properties from the host will be set on the instance.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def patch(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Updates an NVMe subsystem.
Related ONTAP commands
vserver nvme subsystem modify
Learn more
Send the difference in the object's state to the host as a modification request.
Calculates the difference in the object's state since the last time we interacted with the host and sends this in the request body.
Args
hydrate
- If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
poll
- If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
- If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
- If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400 def post(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Creates an NVMe subsystem.
Required properties
svm.uuid
orsvm.name
- Existing SVM in which to create the NVMe subsystem.name
- Name for NVMe subsystem. Once created, an NVMe subsytem cannot be renamed.os_type
- Operating system of the NVMe subsystem's hosts.
Related ONTAP commands
vserver nvme subsystem create
Learn more
Send this object to the host as a creation request.
Args
hydrate
- If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
poll
- If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
- If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
- If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
- Any key/value pairs passed will be sent as query parameters to the host.
Returns
A
NetAppResponse
object containing the details of the HTTP response.Raises
NetAppRestError
: If the API call returned a status code >= 400
Inherited members
class NvmeSubsystemSchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
-
The fields of the NvmeSubsystem object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.schema.BaseSchema
- marshmallow.base.SchemaABC
Class variables
var comment
-
A configurable comment for the NVMe subsystem. Optional in POST and PATCH.
var hosts
-
The hosts field of the nvme_subsystem.
var io_queue
-
The io_queue field of the nvme_subsystem.
var links
-
The links field of the nvme_subsystem.
var name
-
The name of the NVMe subsystem. Once created, an NVMe subsystem cannot be renamed. Required in POST.
Example: subsystem1
var opts
var os_type
-
The host operating system of the NVMe subsystem's hosts. Required in POST.
Valid choices:
- hyper_v
- linux
- vmware
- windows
- xen
var serial_number
-
The serial number of the NVMe subsystem.
Example: wCVsgFMiuMhVAAAAAAAB
var subsystem_maps
-
The NVMe namespaces mapped to the NVMe subsystem.
There is an added cost to retrieving property values forsubsystem_maps
. They are not populated for either a collection GET or an instance GET unless explicitly requested using thefields
query parameter. SeeDOC Requesting specific fields
to learn more. var svm
-
The svm field of the nvme_subsystem.
var target_nqn
-
The NVMe qualified name (NQN) used to identify the NVMe storage target.
Example: nqn.1992-01.example.com:string
var uuid
-
The unique identifier of the NVMe subsystem.
Example: 1cd8a442-86d1-11e0-ae1c-123478563412