# Module `netapp_ontap.resources.nvme_namespace`

Copyright © 2023 NetApp Inc. All rights reserved.

This file has been automatically generated based on the ONTAP REST API documentation.

## Overview

An NVMe namespace is a collection of addressable logical blocks presented to hosts connected to the storage virtual machine using the NVMe over Fabrics protocol.
The NVMe namespace REST API allows you to create, update, delete and discover NVMe namespaces.
In ONTAP, an NVMe namespace is located within a volume. Optionally, it can be located within a qtree in a volume.
An NVMe namespace is created to a specified size using thin or thick provisioning as determined by the volume on which it is created. NVMe namespaces support being cloned. An NVMe namespace cannot be renamed, resized, or moved to a different volume. NVMe namespaces do not support the assignment of a QoS policy for performance management, but a QoS policy can be assigned to the volume containing the namespace. See the NVMe namespace object model to learn more about each of the properties supported by the NVMe namespace REST API.
An NVMe namespace must be mapped to an NVMe subsystem to grant access to the subsystem's hosts. Hosts can then access the NVMe namespace and perform I/O using the NVMe over Fabrics protocol.

## Performance monitoring

Performance of an NVMe namespace can be monitored by observing the `metric.*` and `statistics.*` properties. These properties show the performance of an NVMe namespace in terms of IOPS, latency, and throughput. The `metric.*` properties denote an average, whereas `statistics.*` properties denote a real-time monotonically increasing value aggregated across all nodes.

## Examples

### Creating an NVMe namespace

This example creates a 300 gigabyte NVMe namespace, with 4096-byte blocks, in SVM svm1, volume vol1, configured for use by linux hosts. The `return_records` query parameter is used to retrieve properties of the newly created NVMe namespace in the POST response.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import NvmeNamespace

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = NvmeNamespace()
        resource.svm = {"name": "svm1"}
        resource.os_type = "linux"
        resource.space = {"block_size": "4096", "size": "300G"}
        resource.name = "/vol/vol1/namespace1"
        resource.post(hydrate=True)
        print(resource)

Try it out

    NvmeNamespace(
        {
            "svm": {
                "_links": {
                    "self": {"href": "/api/svm/svms/6bf967fd-2a1c-11e9-b682-005056bbc17d"}
                },
                "uuid": "6bf967fd-2a1c-11e9-b682-005056bbc17d",
                "name": "svm1",
            },
            "enabled": True,
            "name": "/vol/vol1/namespace1",
            "status": {"container_state": "online", "read_only": False, "state": "online"},
            "uuid": "dccdc3e6-cf4e-498f-bec6-f7897f945669",
            "_links": {
                "self": {
                    "href": "/api/storage/namespaces/dccdc3e6-cf4e-498f-bec6-f7897f945669"
                }
            },
            "location": {
                "volume": {
                    "_links": {
                        "self": {
                            "href": "/api/storage/volumes/71cd0dba-2a1c-11e9-b682-005056bbc17d"
                        }
                    },
                    "uuid": "71cd0dba-2a1c-11e9-b682-005056bbc17d",
                    "name": "vol1",
                },
                "namespace": "namespace1",
            },
            "os_type": "linux",
            "space": {
                "block_size": 4096,
                "size": 322122547200,
                "used": 0,
                "guarantee": {"requested": False, "reserved": False},
            },
        }
    )

### Updating an NVMe namespace comment

This example sets the `comment` property of an NVMe namespace.

    # The API:
    PATCH /api/storage/namespaces/{uuid}
    # The call:

### Updating the size of an NVMe namespace

This example increases the size of an NVMe namespace.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import NvmeNamespace

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = NvmeNamespace(uuid="dccdc3e6-cf4e-498f-bec6-f7897f945669")
        resource.space = {"size": "1073741824"}
        resource.patch()

### Retrieving NVMe namespaces

This example retrieves summary information for all online NVMe namespaces in SVM svm1. The `svm.name` and `status.state` query parameters are to find the desired NVMe namespaces.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import NvmeNamespace

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        print(
            list(
                NvmeNamespace.get_collection(
                    **{"svm.name": "svm1", "status.state": "online"}
                )
            )
        )

Try it out

    [
        NvmeNamespace(
            {
                "svm": {"name": "svm1"},
                "name": "/vol/vol1/namespace2",
                "status": {"state": "online"},
                "uuid": "5c254d22-96a6-42ac-aad8-0cd9ebd126b6",
                "_links": {
                    "self": {
                        "href": "/api/storage/namespaces/5c254d22-96a6-42ac-aad8-0cd9ebd126b6"
                    }
                },
            }
        ),
        NvmeNamespace(
            {
                "svm": {"name": "svm1"},
                "name": "/vol/vol1/namespace1",
                "status": {"state": "online"},
                "uuid": "dccdc3e6-cf4e-498f-bec6-f7897f945669",
                "_links": {
                    "self": {
                        "href": "/api/storage/namespaces/dccdc3e6-cf4e-498f-bec6-f7897f945669"
                    }
                },
            }
        ),
        NvmeNamespace(
            {
                "svm": {"name": "svm1"},
                "name": "/vol/vol2/namespace3",
                "status": {"state": "online"},
                "uuid": "be732687-20cf-47d2-a0e2-2a989d15661d",
                "_links": {
                    "self": {
                        "href": "/api/storage/namespaces/be732687-20cf-47d2-a0e2-2a989d15661d"
                    }
                },
            }
        ),
    ]

### Retrieving details for a specific NVMe namespace

In this example, the `fields` query parameter is used to request all fields, including advanced fields, that would not otherwise be returned by default for the NVMe namespace.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import NvmeNamespace

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = NvmeNamespace(uuid="dccdc3e6-cf4e-498f-bec6-f7897f945669")
        resource.get(fields="**")
        print(resource)

Try it out

    NvmeNamespace(
        {
            "statistics": {
                "timestamp": "2019-04-09T05:50:42+00:00",
                "latency_raw": {"other": 38298, "total": 38298, "read": 0, "write": 0},
                "status": "ok",
                "iops_raw": {"other": 3, "total": 3, "read": 0, "write": 0},
                "throughput_raw": {"total": 0, "read": 0, "write": 0},
            },
            "auto_delete": False,
            "svm": {
                "_links": {
                    "self": {"href": "/api/svm/svms/6bf967fd-2a1c-11e9-b682-005056bbc17d"}
                },
                "uuid": "6bf967fd-2a1c-11e9-b682-005056bbc17d",
                "name": "svm1",
            },
            "enabled": True,
            "name": "/vol/vol1/namespace1",
            "status": {
                "container_state": "online",
                "read_only": False,
                "mapped": True,
                "state": "online",
            },
            "subsystem_map": {
                "_links": {
                    "self": {
                        "href": "/api/protocols/nvme/subsystem-maps/dccdc3e6-cf4e-498f-bec6-f7897f945669/01f17d05-2be9-11e9-bed2-005056bbc17d"
                    }
                },
                "nsid": "00000001h",
                "anagrpid": "00000001h",
                "subsystem": {
                    "name": "subsystem1",
                    "uuid": "01f17d05-2be9-11e9-bed2-005056bbc17d",
                    "_links": {
                        "self": {
                            "href": "/api/protocols/nvme/subsystems/01f17d05-2be9-11e9-bed2-005056bbc17d"
                        }
                    },
                },
            },
            "uuid": "dccdc3e6-cf4e-498f-bec6-f7897f945669",
            "metric": {
                "timestamp": "2019-04-09T05:50:15+00:00",
                "throughput": {"total": 0, "read": 0, "write": 0},
                "status": "ok",
                "iops": {"other": 0, "total": 0, "read": 0, "write": 0},
                "duration": "PT15S",
                "latency": {"other": 0, "total": 0, "read": 0, "write": 0},
            },
            "_links": {
                "self": {
                    "href": "/api/storage/namespaces/dccdc3e6-cf4e-498f-bec6-f7897f945669?fields=**"
                }
            },
            "location": {
                "volume": {
                    "_links": {
                        "self": {
                            "href": "/api/storage/volumes/71cd0dba-2a1c-11e9-b682-005056bbc17d"
                        }
                    },
                    "uuid": "71cd0dba-2a1c-11e9-b682-005056bbc17d",
                    "name": "vol1",
                },
                "namespace": "namespace1",
            },
            "comment": "Data for the research department.",
            "os_type": "linux",
            "space": {
                "block_size": 4096,
                "size": 322122547200,
                "used": 0,
                "guarantee": {"requested": False, "reserved": False},
            },
        }
    )

## Cloning NVMe namespaces

A clone of an NVMe namespace is an independent "copy" of the namespace that shares unchanged data blocks with the original. As blocks of the source and clone are modified, unique blocks are written for each. NVMe namespace clones can be created quickly and consume very little space initially. They can be created for the purpose of back-up, or to replicate data for multiple consumers.
An NVMe namespace clone can also be set to auto-delete by setting the `auto_delete` property. If the namespace's volume is configured for automatic deletion, NVMe namespaces that have auto-delete enabled are deleted when a volume is nearly full to reclaim a target amount of free space in the volume.

### Creating a new NVMe namespace clone

You create an NVMe namespace clone as you create any NVMe namespace – a POST to `/storage/namespaces`. Set `clone.source.uuid` or `clone.source.name` to identify the source NVMe namespace from which the clone is created. The NVMe namespace clone and its source must reside in the same volume.
The source NVMe namespace can reside in a Snapshot copy, in which case, the `clone.source.name` field must be used to identify it. Add `/.snapshot/<snapshot_name>` to the path after the volume name to identify the Snapshot copy. For example `/vol/vol1/.snapshot/snap1/namespace1`.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import NvmeNamespace

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = NvmeNamespace()
        resource.svm = {"name": "svm1"}
        resource.name = "/vol/vol1/namespace2clone1"
        resource.clone = {"source": {"name": "/vol/vol1/namespace2"}}
        resource.post(hydrate=True)
        print(resource)

### Over-writing an existing NVMe namespace's data as a clone of another

You can over-write an existing NVMe namespace as a clone of another. You do this as a PATCH on the NVMe namespace to overwrite – a PATCH to `/storage/namespaces/{uuid}`. Set the `clone.source.uuid` or `clone.source.name` property to identify the source NVMe namespace from which the clone data is taken. The NVMe namespace clone and its source must reside in the same volume.
When used in a PATCH, the patched NVMe namespace's data is over-written as a clone of the source and the following properties are preserved from the patched namespace unless otherwise specified as part of the PATCH: `auto_delete`, `subsystem_map`, `status.state`, and `uuid`.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import NvmeNamespace

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = NvmeNamespace(uuid="dccdc3e6-cf4e-498f-bec6-f7897f945669")
        resource.clone = {"source": {"name": "/vol/vol1/namespace2"}}
        resource.patch()

## Converting a LUN into an NVMe namespace

An existing LUN can be converted in-place to an NVMe namespace with no modification to the data blocks. In other words, there is no additional copy created for the data blocks. There are certain requirements when converting a LUN to an NVMe namespace. For instance, the LUN should not be mapped to an initiator group, or exist as a protocol endpoint LUN, or in a foreign LUN import relationship. If the LUN exists as a VM volume, it should not be bound to a protocol endpoint LUN. Furthermore, only LUN with a supported operating system type for NVMe namespace can be converted.
The conversion process updates the metadata to the LUN, making it an NVMe namespace. The conversion is both time and space efficient. After conversion, the new namespace behaves as a regular namespace and may be mapped to an NVMe subsystem.

### Convert a LUN into an NVMe namespace

You convert a LUN into an NVMe namespace by calling a POST to `/storage/namespaces`. Set `convert.lun.uuid` or `convert.lun.name` to identify the source LUN which is to be converted in-place into an NVMe namespace.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import NvmeNamespace

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = NvmeNamespace()
        resource.svm = {"name": "svm1"}
        resource.convert = {"lun": {"name": "/vol/vol1/lun1"}}
        resource.post(hydrate=True)
        print(resource)

## Deleting an NVMe namespace

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import NvmeNamespace

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = NvmeNamespace(uuid="5c254d22-96a6-42ac-aad8-0cd9ebd126b6")
        resource.delete()

## Classes

`class NvmeNamespace (*args, **kwargs)`

  An NVMe namespace is a collection of addressable logical blocks presented to hosts connected to the storage virtual machine using the NVMe over Fabrics protocol.
  In ONTAP, an NVMe namespace is located within a volume. Optionally, it can be located within a qtree in a volume.
  An NVMe namespace is created to a specified size using thin or thick provisioning as determined by the volume on which it is created. NVMe namespaces support being cloned. An NVMe namespace cannot be renamed, resized, or moved to a different volume. NVMe namespaces do not support the assignment of a QoS policy for performance management, but a QoS policy can be assigned to the volume containing the namespace. See the NVMe namespace object model to learn more about each of the properties supported by the NVMe namespace REST API.
  An NVMe namespace must be mapped to an NVMe subsystem to grant access to the subsystem's hosts. Hosts can then access the NVMe namespace and perform I/O using the NVMe over Fabrics protocol.

  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

  - Resource

  ### Static methods

  `def count_collection (*args, connection: HostConnection = None, **kwargs) -> int`

    Returns a count of all NvmeNamespace resources that match the provided query

    This calls GET on the object to determine the number of records. It is more efficient than calling get_collection() because it will not construct any objects. Query parameters can be passed in as kwargs to determine a count of objects that match some filtered criteria.

    ## 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 count 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. These query parameters can affect the count. A return_records query param will be ignored.

    ## Returns

    On success, returns an integer count of the objects of this type. On failure, returns -1.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400, or if there is no connection available to use either passed in or on the library.

  `def delete_collection (*args, records: Iterable[_ForwardRef('NvmeNamespace')] = None, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Deletes an NVMe namespace.

    ### Related ONTAP commands

    - `vserver nvme namespace delete`

    ### Learn more

    - `DOC /storage/namespaces`

    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.
    `records`
      Can be provided in place of a query. If so, this list of objects will be deleted from the host.
    `body`
      The body of the delete request. This could be a Resource instance or a dictionary 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.
    `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 deleted.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  `def fast_get_collection (*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[RawResource]`

    Returns a list of RawResources that represent NvmeNamespace resources that match the provided query

    Fetch a list of all objects of this type from the host.

        This is a lazy fetch, making API calls only as necessary when the result
        of this call is iterated over. For instance, if max_records is set to 5,
        then iterating over the collection causes an API call to be sent to the
        server once for every 5 records. If the client stops iterating before
        getting to the 6th record, then no additional API calls are made.

    ## 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
    `raw`
      return a list of `netapp_ontap.resource.RawResource` objects that require to be promoted before any RESTful operations can be used on them. Setting this argument to True makes get_collection substantially quicker when many records are returned from the server.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A list of `Resource` objects

    ## Raises

    `NetAppRestError`: If there is no connection available to use either passed in or on the library. This would be not be raised when get_collection() is called, but rather when the result is iterated.

  `def find (*args, connection: HostConnection = None, **kwargs) -> Resource`

    Retrieves NVMe namespaces.

    ### Expensive properties

    There is an added computational 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. See `Requesting specific fields` to learn more. * `auto_delete` * `subsystem_map.*` * `status.mapped` * `statistics.*` * `metric.*`

    ### Related ONTAP commands

    - `vserver nvme namespace show`
    - `vserver nvme subsystem map show`

    ### Learn more

    - `DOC /storage/namespaces` to learn more and examples.

    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, None will be returned. 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 or None if no matches were found.

    ## Raises

    `NetAppRestError`: If the API call returned more than 1 matching resource.

  `def get_collection (*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[Resource]`

    Retrieves NVMe namespaces.

    ### Expensive properties

    There is an added computational 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. See `Requesting specific fields` to learn more. * `auto_delete` * `subsystem_map.*` * `status.mapped` * `statistics.*` * `metric.*`

    ### Related ONTAP commands

    - `vserver nvme namespace show`
    - `vserver nvme subsystem map show`

    ### Learn more

    - `DOC /storage/namespaces` to learn more and examples.

    Fetch a list of all objects of this type from the host.

        This is a lazy fetch, making API calls only as necessary when the result
        of this call is iterated over. For instance, if max_records is set to 5,
        then iterating over the collection causes an API call to be sent to the
        server once for every 5 records. If the client stops iterating before
        getting to the 6th record, then no additional API calls are made.

    ## 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
    `raw`
      return a list of `netapp_ontap.resource.RawResource` objects that require to be promoted before any RESTful operations can be used on them. Setting this argument to True makes get_collection substantially quicker when many records are returned from the server.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A list of `Resource` objects

    ## Raises

    `NetAppRestError`: If there is no connection available to use either passed in or on the library. This would be not be raised when get_collection() is called, but rather when the result is iterated.

  `def patch_collection (body: dict, *args, records: Iterable[_ForwardRef('NvmeNamespace')] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Updates an NVMe namespace.

    ### Related ONTAP commands

    - `volume file clone autodelete`
    - `vserver nvme namespace modify`

    ### Learn more

    - `DOC /storage/namespaces`

    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. The body argument will be ignored if records is provided.
    `*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.
    `records`
      Can be provided in place of a query. If so, this list of objects will be patched on the host.
    `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.
    `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 post_collection (records: Iterable[_ForwardRef('NvmeNamespace')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> Union[List[NvmeNamespace], NetAppResponse]`

    Creates an NVMe namespace.

    ### Required properties

    - `svm.uuid` or `svm.name` - Existing SVM in which to create the NVMe namespace.
    - `name`, `location.volume.name` or `location.volume.uuid` - Existing volume in which to create the NVMe namespace.
    - `name` or `location.namespace` - Base name for the NVMe namespace.
    - `os_type` - Operating system from which the NVMe namespace will be accessed. (Not used for clones, which are created based on the `os_type` of the source NVMe namespace.)
    - `space.size` - Size for the NVMe namespace. (Not used for clones, which are created based on the size of the source NVMe namespace.)

    ### Default property values

    If not specified in POST, the following default property values are assigned: * `auto_delete` - false * `space.block_size` - 4096 ( 512 when 'os_type' is vmware )

    ### Related ONTAP commands

    - `volume file clone autodelete`
    - `volume file clone create`
    - `vserver nvme namespace convert-from-lun`
    - `vserver nvme namespace create`

    ### Learn more

    - `DOC /storage/namespaces`

    Send this collection of objects to the host as a creation request.

    ## Args

    `records`
      A list of `Resource` objects to send to the server to be created.
    `*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 create a bar for a particular foo, the foo.name value should be passed.
    `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 each object. When hydrate is set to True, poll must also be set to True.
    `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.
    `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 list of `Resource` objects matching the provided type which have been created by the host and returned. This is not the same list that was provided, so to continue using the object, you should save this list. If poll is set to False, then a `NetAppResponse` object is returned instead.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  ### Methods

  `def delete (self, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse`

    Deletes an NVMe namespace.

    ### Related ONTAP commands

    - `vserver nvme namespace delete`

    ### Learn more

    - `DOC /storage/namespaces`

    Send a deletion request to the host for this object.

    ## Args

    `body`
      The body of the delete request. This could be a Resource instance or a dictionary 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.
    `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 `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 namespace.

    ### Expensive properties

    There is an added computational 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. See `Requesting specific fields` to learn more. * `auto_delete` * `subsystem_map.*` * `status.mapped` * `statistics.*` * `metric.*`

    ### Related ONTAP commands

    - `vserver nvme namespace show`
    - `vserver nvme subsystem map show`

    ### Learn more

    - `DOC /storage/namespaces`

    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: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse`

    Updates an NVMe namespace.

    ### Related ONTAP commands

    - `volume file clone autodelete`
    - `vserver nvme namespace modify`

    ### Learn more

    - `DOC /storage/namespaces`

    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.
    `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 normally be sent as query parameters to the host. If any of these pairs are parameters that are sent as formdata then only parameters of that type will be accepted and all others will be discarded.

    ## 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: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse`

    Creates an NVMe namespace.

    ### Required properties

    - `svm.uuid` or `svm.name` - Existing SVM in which to create the NVMe namespace.
    - `name`, `location.volume.name` or `location.volume.uuid` - Existing volume in which to create the NVMe namespace.
    - `name` or `location.namespace` - Base name for the NVMe namespace.
    - `os_type` - Operating system from which the NVMe namespace will be accessed. (Not used for clones, which are created based on the `os_type` of the source NVMe namespace.)
    - `space.size` - Size for the NVMe namespace. (Not used for clones, which are created based on the size of the source NVMe namespace.)

    ### Default property values

    If not specified in POST, the following default property values are assigned: * `auto_delete` - false * `space.block_size` - 4096 ( 512 when 'os_type' is vmware )

    ### Related ONTAP commands

    - `volume file clone autodelete`
    - `volume file clone create`
    - `vserver nvme namespace convert-from-lun`
    - `vserver nvme namespace create`

    ### Learn more

    - `DOC /storage/namespaces`

    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.
    `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 normally be sent as query parameters to the host. If any of these pairs are parameters that are sent as formdata then only parameters of that type will be accepted and all others will be discarded.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  ### Inherited members

  - `Resource`:
    - `from_dict`
    - `get_collection_url`
    - `get_connection`
    - `instance_location`
    - `path_keys`
    - `poll`
    - `set_connection`
    - `to_dict`
`class NvmeNamespaceSchema (*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)`

  The fields of the NvmeNamespace object

  ### Ancestors

  - netapp_ontap.resource.ResourceSchema
  - marshmallow.schema.Schema
  - marshmallow.base.SchemaABC

  ### Class variables

  `auto_delete: bool GET POST PATCH`

    This property marks the NVMe namespace for auto deletion when the volume containing the namespace runs out of space. This is most commonly set on namespace clones.
    When set to true, the NVMe namespace becomes eligible for automatic deletion when the volume runs out of space. Auto deletion only occurs when the volume containing the namespace is also configured for auto deletion and free space in the volume decreases below a particular threshold.
    This property is optional in POST and PATCH. The default value for a new NVMe namespace is false.
    There is an added computational cost to retrieving this property's value. It is not populated for either a collection GET or an instance GET unless it is explicitly requested using the `fields` query parameter. See `Requesting specific fields` to learn more.

  `clone: NvmeNamespaceClone POST PATCH`

    The clone field of the nvme_namespace.

  `comment: str GET POST PATCH`

    A configurable comment available for use by the administrator. Valid in POST and PATCH.

  `convert: NvmeNamespaceConvert POST`

    The convert field of the nvme_namespace.

  `create_time: ImpreciseDateTime GET`

    The time the NVMe namespace was created.

    Example: 2018-06-04T19:00:00.000+0000

  `enabled: bool GET`

    The enabled state of the NVMe namespace. Certain error conditions cause the namespace to become disabled. If the namespace is disabled, you can check the `state` property to determine what error disabled the namespace. An NVMe namespace is enabled automatically when it is created.

  `links: SelfLink GET`

    The links field of the nvme_namespace.

  `location: NvmeNamespaceLocation GET POST`

    The location field of the nvme_namespace.

  `metric: PerformanceMetricReducedThroughput GET`

    The metric field of the nvme_namespace.

  `name: str GET POST`

    The fully qualified path name of the NVMe namespace composed of a "/vol" prefix, the volume name, the (optional) qtree name and base name of the namespace. Valid in POST.
    NVMe namespaces do not support rename, or movement between volumes.

    Example: /vol/volume1/qtree1/namespace1

  `os_type: str GET POST`

    The operating system type of the NVMe namespace.
    Required in POST when creating an NVMe namespace that is not a clone of another. Disallowed in POST when creating a namespace clone.

    Valid choices:

    - aix
    - linux
    - vmware
    - windows
  `space: NvmeNamespaceSpace GET POST PATCH`

    The space field of the nvme_namespace.

  `statistics: PerformanceMetricRawReducedThroughput GET`

    The statistics field of the nvme_namespace.

  `status: NvmeNamespaceStatus GET`

    The status field of the nvme_namespace.

  `subsystem_map: NvmeNamespaceSubsystemMap GET`

    The subsystem_map field of the nvme_namespace.

  `svm: Svm GET POST PATCH`

    The svm field of the nvme_namespace.

  `uuid: str GET`

    The unique identifier of the NVMe namespace.

    Example: 1cd8a442-86d1-11e0-ae1c-123478563412