netapp_ontap.resources.lun API documentation
Description: Copyright &copy; 2026 NetApp Inc. All rights reserved …

# Module `netapp_ontap.resources.lun`

Copyright © 2026 NetApp Inc. All rights reserved.

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

## Overview

A LUN is the logical representation of storage in a storage area network (SAN).
The LUN REST API allows you to create, update, delete, and discover LUNs.
A LUN must be mapped to an initiator group to grant access to the initiator group's initiators (client hosts). Initiators can then access the LUN and perform I/O over a Fibre Channel (FC) fabric using the FC Protocol or a TCP/IP network using iSCSI.
See the LUN object model to learn more about each of the properties supported by the LUN REST API.
A LUN is located within a volume. Optionally, it can be located within a qtree in a volume.
LUN names are paths of the form "/vol/\[/\]/\" where the qtree name is optional.
A LUN can be created to a specified size using thin or thick provisioning. A LUN can then be renamed, resized, cloned, moved to a different volume and copied. LUNs support the assignment of a QoS policy for performance management or a QoS policy can be assigned to a volume containing one or more LUNs. LUN names are simple names that share a namespace with NVMe namespaces within the same SVM. The name must begin with a letter or "_" and contain only "_" and alphanumeric characters. In specific cases, an optional snapshot-name can be used of the form "\[@\]". The snapshot name must not begin or end with whitespace.
A LUN can be created to a specified size. A LUN can then be renamed, resized, or cloned. LUNs support the assignment of a QoS policy for performance management.
Note: LUN related REST API examples use the Unified ONTAP form for LUN names. On ASA r2, the ASA r2 format must be used.

## Performance monitoring

Performance of a LUN can be monitored by observing the `metric.*` and `statistics.*` properties. These properties show the space utilization and performance of a LUN 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 a LUN

This example creates a 300 gigabyte, thin-provisioned LUN in SVM svm1, volume vol1, configured for use by linux initiators. The `return_records` query parameter is used to retrieve properties of the newly created LUN in the POST response.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

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

Try it out

    Lun(
        {
            "serial_number": "wf0Iq+N4uck3",
            "name": "/vol/vol1/lun1",
            "os_type": "linux",
            "status": {"container_state": "online", "state": "online", "read_only": False},
            "location": {
                "logical_unit": "lun1",
                "volume": {
                    "name": "vol1",
                    "_links": {
                        "self": {
                            "href": "/api/storage/volumes/71cd0dba-2a1c-11e9-b682-005056bbc17d"
                        }
                    },
                    "uuid": "71cd0dba-2a1c-11e9-b682-005056bbc17d",
                },
            },
            "enabled": True,
            "_links": {
                "self": {"href": "/api/storage/luns/5a24ae5b-28af-47fb-b129-5adf6cfba0a6"}
            },
            "space": {
                "scsi_thin_provisioning_support_enabled": True,
                "used": 0,
                "guarantee": {"reserved": False, "requested": False},
                "size": 322163441664,
            },
            "uuid": "5a24ae5b-28af-47fb-b129-5adf6cfba0a6",
            "class": "regular",
            "svm": {
                "name": "svm1",
                "_links": {
                    "self": {"href": "/api/svm/svms/6bf967fd-2a1c-11e9-b682-005056bbc17d"}
                },
                "uuid": "6bf967fd-2a1c-11e9-b682-005056bbc17d",
            },
        }
    )

### Updating a LUN

This example sets the `comment` property of a LUN.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Lun(uuid="5a24ae5b-28af-47fb-b129-5adf6cfba0a6")
        resource.comment = "Data for the finance department."
        resource.patch()

### Retrieving LUNs

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

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

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

Try it out

    [
        Lun(
            {
                "name": "/vol/vol1/lun1",
                "status": {"state": "online"},
                "_links": {
                    "self": {
                        "href": "/api/storage/luns/5a24ae5b-28af-47fb-b129-5adf6cfba0a6"
                    }
                },
                "uuid": "5a24ae5b-28af-47fb-b129-5adf6cfba0a6",
                "svm": {"name": "svm1"},
            }
        ),
        Lun(
            {
                "name": "/vol/vol1/lun2",
                "status": {"state": "online"},
                "_links": {
                    "self": {
                        "href": "/api/storage/luns/c903a978-9bac-4ce9-8237-4a3ba8b13f08"
                    }
                },
                "uuid": "c903a978-9bac-4ce9-8237-4a3ba8b13f08",
                "svm": {"name": "svm1"},
            }
        ),
        Lun(
            {
                "name": "/vol/vol2/lun3",
                "status": {"state": "online"},
                "_links": {
                    "self": {
                        "href": "/api/storage/luns/7faf0a9e-0a47-4876-8318-3638d5da16bf"
                    }
                },
                "uuid": "7faf0a9e-0a47-4876-8318-3638d5da16bf",
                "svm": {"name": "svm1"},
            }
        ),
    ]

### Retrieving details for a specific LUN

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 LUN.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Lun(uuid="5a24ae5b-28af-47fb-b129-5adf6cfba0a6")
        resource.get(fields="**")
        print(resource)

Try it out

    Lun(
        {
            "serial_number": "wf0Iq+N4uck3",
            "name": "/vol/vol1/lun1",
            "os_type": "linux",
            "auto_delete": False,
            "status": {
                "container_state": "online",
                "mapped": True,
                "state": "online",
                "read_only": False,
            },
            "vvol": {
                "is_bound": True,
                "bindings": [
                    {
                        "partner": {
                            "_links": {
                                "self": {
                                    "href": "/api/storage/luns/353c7262-be4b-4176-acf3-f1021faa8b64"
                                }
                            },
                            "name": "/vol/vol1/pelun1",
                            "uuid": "353c7262-be4b-4176-acf3-f1021faa8b64",
                        },
                        "_links": {
                            "self": {
                                "href": "/api/protocols/san/vvol-bindings/353c7262-be4b-4176-acf3-f1021faa8b64/5a24ae5b-28af-47fb-b129-5adf6cfba0a6"
                            }
                        },
                        "id": 4304512,
                    }
                ],
            },
            "metric": {
                "latency": {"write": 0, "total": 0, "other": 0, "read": 0},
                "timestamp": "2019-04-09T05:50:15+00:00",
                "iops": {"write": 0, "total": 0, "other": 0, "read": 0},
                "status": "ok",
                "duration": "PT15S",
                "throughput": {"write": 0, "total": 0, "other": 0, "read": 0},
            },
            "location": {
                "logical_unit": "lun1",
                "volume": {
                    "name": "vol1",
                    "_links": {
                        "self": {
                            "href": "/api/storage/volumes/71cd0dba-2a1c-11e9-b682-005056bbc17d"
                        }
                    },
                    "uuid": "71cd0dba-2a1c-11e9-b682-005056bbc17d",
                },
            },
            "enabled": True,
            "_links": {
                "self": {
                    "href": "/api/storage/luns/5a24ae5b-28af-47fb-b129-5adf6cfba0a6?fields=**"
                }
            },
            "space": {
                "scsi_thin_provisioning_support_enabled": True,
                "used": 0,
                "guarantee": {"reserved": False, "requested": False},
                "size": 322163441664,
            },
            "statistics": {
                "throughput_raw": {"write": 0, "total": 0, "other": 0, "read": 0},
                "iops_raw": {"write": 0, "total": 3, "other": 3, "read": 0},
                "timestamp": "2019-04-09T05:50:42+00:00",
                "status": "ok",
                "latency_raw": {"write": 0, "total": 38298, "other": 38298, "read": 0},
            },
            "comment": "Data for the finance department.",
            "uuid": "5a24ae5b-28af-47fb-b129-5adf6cfba0a6",
            "lun_maps": [
                {
                    "igroup": {
                        "_links": {
                            "self": {
                                "href": "/api/protocols/san/igroups/2b9d57e1-2a66-11e9-b682-005056bbc17d"
                            }
                        },
                        "name": "ig1",
                        "uuid": "2b9d57e1-2a66-11e9-b682-005056bbc17d",
                    },
                    "_links": {
                        "self": {
                            "href": "/api/protocols/san/lun-maps/5a24ae5b-28af-47fb-b129-5adf6cfba0a6/2b9d57e1-2a66-11e9-b682-005056bbc17d"
                        }
                    },
                    "logical_unit_number": 0,
                }
            ],
            "consistency_group": {
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/6d657aaf-b57a-5396-82ea-c01329e46c79"
                    }
                },
                "name": "vol1",
                "uuid": "6d657aaf-b57a-5396-82ea-c01329e46c79",
            },
            "class": "vvol",
            "svm": {
                "name": "svm1",
                "_links": {
                    "self": {"href": "/api/svm/svms/6bf967fd-2a1c-11e9-b682-005056bbc17d"}
                },
                "uuid": "6bf967fd-2a1c-11e9-b682-005056bbc17d",
            },
        }
    )

### Deleting a LUN

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Lun(uuid="c903a978-9bac-4ce9-8237-4a3ba8b13f08")
        resource.delete()

## LUN data

The LUN REST API also supports reading data from and writing data to a LUN via the REST API as multipart/form-data.
Reading data is performed using a GET request on the LUN endpoint. The request header must include `Accept: multipart/form-data`. When this header entry is provided, query parameters `data.offset` and `data.size` are required and used to specify the portion of the LUN's data to read; no other query parameters are allowed. Reads are limited to one megabyte (1MB) per request. Data is returned as `multipart/form-data` content with exactly one form entry containing the data. The form entry has content type `application/octet-stream`.
Writing data is performed using a PATCH request on the LUN endpoint. The request header must include `Content-Type: multipart/form-data`. When this header entry is provided, query parameter `data.offset` is required and used to specify the location within the LUN at which to write the data; no other query parameters are allowed. The request body must be `multipart/form-data` content with exactly one form entry containing the data to write. The content type entry of the form data is ignored and always treated as `application/octet-stream`. Writes are limited to one megabyte (1MB) per request.

### Reading data from a LUN

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Lun(uuid="c903a978-9bac-4ce9-8237-4a3ba8b13f08")
        resource.get(**{"data.offset": "0", "data.size": "9"})
        print(resource)

### Writing data to a LUN

This example writes the contents of a file to a LUN starting at offset 1024.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Lun(uuid="c903a978-9bac-4ce9-8237-4a3ba8b13f08")
        resource.patch(
            hydrate=True,
            data="@file;type=application/octet-stream",
            **{"data.offset": "1024"}
        )

## Cloning LUNs

A clone of a LUN is an independent "copy" of the LUN that shares unchanged data blocks with the original. As blocks of the source and clone are modified, unique blocks are written for each. LUN 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.
Space reservations can be set for the LUN clone independent of the source LUN by setting the `space.guarantee.requested` property in a POST or PATCH request.
A LUN clone can be set to auto-delete by setting the `auto_delete` property. If the LUN's volume is configured for automatic deletion, LUNs that have auto-delete enabled are deleted when a volume is nearly full to reclaim a target amount of free space in the volume.
The value of property `space.scsi_thin_provisioning_support_enabled` is not propagated to the destination when a LUN is cloned as a new LUN; it is reset to false. The value of this property is maintained from the destination LUN when a LUN is overwritten as a clone.

### Creating a new LUN clone

You create a new LUN clone as you create any LUN - a POST request to `/storage/luns`. Set `clone.source.uuid` or `clone.source.name` to identify the source LUN from which the clone is created. The LUN clone and its source must reside in the same volume.
The source LUN can reside in a snapshot, 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. For example `/vol/vol1/.snapshot/snap1/lun1`.
By default, new LUN clones do not inherit the QoS policy of the source LUN; a QoS policy should be set for the clone by setting the `qos_policy` property.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

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

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

You can overwrite an existing LUN as a clone of another, using a PATCH request to `/storage/luns/{uuid}`. Set the `clone.source.uuid` or `clone.source.name` property to identify the source LUN from which the clone data is taken. The LUN clone and its source must reside in the same volume.
When used in a PATCH request, the patched LUN's data is overwritten as a clone of the source. The following properties are preserved from the patched LUN unless otherwise specified as part of the PATCH: `class`, `auto_delete`, `lun_maps`, `vvol`, `serial_number`, `status.state`, and `uuid`.
Persistent reservations for the updated LUN are also preserved.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Lun(uuid="5a24ae5b-28af-47fb-b129-5adf6cfba0a6")
        resource.clone = {"source": {"name": "/vol/vol1/lun2"}}
        resource.patch()

## Converting an NVMe namespace into a LUN

An existing NVMe namespace can be converted in-place to a LUN with no modification to the data blocks. In other words, there is no additional copy created for the data blocks. There are certain requirements for converting an NVMe namespace to a LUN. For instance, the namespace should not be mapped to an NVMe subsystem. Additionally, the namespace should not have a block size other than 512 bytes.
The conversion process updates the metadata to the NVMe namespace, making it a LUN. The conversion is both time and space efficient. After conversion, the new LUN behaves as a regular LUN and may be mapped to an initiator group.

### Convert an NVMe namespace into a LUN

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

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

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

## Moving LUNs between volumes

You move a LUN between volumes by using a PATCH request to `/storage/luns/{uuid}`. Set the volume portion of the fully qualified LUN path `name` property, `path.volume.uuid`, or `path.volume.name` property to a different volume than the LUN's current volume. Moving a LUN between volumes is an asynchronous activity. A successful request returns a response of 200 synchronously, which indicates that the movement has been successfully queued. The LUN object can then be further polled with a GET request to `/storage/luns/{uuid}` to monitor the status of the movement.
The `movement` sub-object of the LUN object is populated while a LUN movement is in progress and for two minutes following completion of a movement.

### Starting a LUN movement

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Lun(uuid="7faf0a9e-0a47-4876-8318-3638d5da16bf")
        resource.name = "/vol/vol1/lun3"
        resource.patch()

### Checking on the status of the LUN movement

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Lun

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Lun(uuid="7faf0a9e-0a47-4876-8318-3638d5da16bf")
        resource.get(fields="movement")
        print(resource)

Try it out

    Lun(
        {
            "name": "/vol/vol1/lun3",
            "movement": {
                "progress": {
                    "percent_complete": 0,
                    "state": "preparing",
                    "volume_snapshot_blocked": False,
                    "elapsed": 1,
                },
                "paths": {"source": "/vol/vol2/lun3", "destination": "/vol/vol1/lun3"},
            },
            "_links": {
                "self": {"href": "/api/storage/luns/7faf0a9e-0a47-4876-8318-3638d5da16bf"}
            },
            "uuid": "7faf0a9e-0a47-4876-8318-3638d5da16bf",
        }
    )

## Classes

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

  A LUN is the logical representation of storage in a storage area network (SAN).
  A LUN must be mapped to an initiator group to grant access to the initiator group's initiators (client hosts). Initiators can then access the LUN and perform I/O over a Fibre Channel (FC) fabric using the FC Protocol or a TCP/IP network using iSCSI.
  See the LUN object model to learn more about each of the properties supported by the LUN REST API.
  A LUN is located within a volume. Optionally, it can be located within a qtree in a volume.
  LUN names are paths of the form "/vol/\[/\]/\" where the qtree name is optional.
  A LUN can be created to a specified size using thin or thick provisioning. A LUN can then be renamed, resized, cloned, moved to a different volume and copied. LUNs support the assignment of a QoS policy for performance management or a QoS policy can be assigned to a volume containing one or more LUNs. LUN names are simple names that share a namespace with NVMe namespaces within the same SVM. The name must begin with a letter or "_" and contain only "_" and alphanumeric characters. In specific cases, an optional snapshot-name can be used of the form "\[@\]". The snapshot name must not begin or end with whitespace.
  A LUN can be created to a specified size. A LUN can then be renamed, resized, or cloned. LUNs support the assignment of a QoS policy for performance management.
  Note: LUN related REST API examples use the Unified ONTAP form for LUN names. On ASA r2, the ASA r2 format must be used.

  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 Lun 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('Lun')] = 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 a LUN.

    ### Related ONTAP commands

    - `lun copy cancel`
    - `lun delete` DELETE is asynchronous.

    ### Learn more

    - `DOC /storage/luns`

    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 Lun 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 LUNs.

    ### 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. * `attributes.*` * `auto_delete` * `copy.*` * `lun_maps.*` * `movement.*` * `space.physical_used` * `space.physical_used_by_snapshots` * `space.efficiency_ratio` * `space.snapshot.*` * `statistics.*` * `vvol.bindings.*` * `metric.*`

    ### Related ONTAP commands

    - `lun bind show`
    - `lun copy show`
    - `lun mapping show`
    - `lun move show`
    - `lun show`
    - `volume file clone show-autodelete`

    ### Learn more

    - `DOC /storage/luns`

    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 LUNs.

    ### 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. * `attributes.*` * `auto_delete` * `copy.*` * `lun_maps.*` * `movement.*` * `space.physical_used` * `space.physical_used_by_snapshots` * `space.efficiency_ratio` * `space.snapshot.*` * `statistics.*` * `vvol.bindings.*` * `metric.*`

    ### Related ONTAP commands

    - `lun bind show`
    - `lun copy show`
    - `lun mapping show`
    - `lun move show`
    - `lun show`
    - `volume file clone show-autodelete`

    ### Learn more

    - `DOC /storage/luns`

    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('Lun')] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Updates an existing LUN in one of several ways: - Updates the properties of a LUN. - Writes data to a LUN. LUN data write requests are distinguished by the header entry `Content-Type: multipart/form-data`. When this header entry is provided, query parameter `data.offset` is required and used to specify the location within the LUN at which to write the data; no other query parameters are allowed. The request body must be `multipart/form-data` content with exactly one form entry containing the data to write. The content type entry of the form data is ignored and always treated as `application/octet-stream`. Writes are limited to one megabyte (1MB) per request. - Overwrites the contents of a LUN as a clone of another. - Begins the movement of a LUN between volumes. PATCH can also pause and resume the movement of a LUN between volumes that is already in active.

    ### Related ONTAP commands

    - `lun copy modify`
    - `lun copy pause`
    - `lun copy resume`
    - `lun modify`
    - `lun move-in-volume`
    - `lun move modify`
    - `lun move pause`
    - `lun move resume`
    - `lun move start`
    - `lun resize`
    - `volume file clone autodelete` PATCH is asynchronous when modifying `name` or `qos_policy`.

    ### Learn more

    - `DOC /storage/luns`

    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('Lun')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> Union[List[Lun], NetAppResponse]`

    Creates a LUN.

    ### Required properties

    - `svm.uuid` or `svm.name` - Existing SVM in which to create the LUN.
    - `name`, `location.volume.name` or `location.volume.uuid` - Existing volume in which to create the LUN.
    - `name` or `location.logical_unit` - Base name of the LUN.
    - `os_type` - Operating system from which the LUN will be accessed. Required when creating a non-clone LUN and disallowed when creating a clone of an existing LUN. A clone's `os_type` is taken from the source LUN.
    - `space.size` - Size of the LUN. Required when creating a non-clone LUN and disallowed when creating a clone of an existing LUN. A clone's size is taken from the source LUN.

    ### Recommended optional properties

    - `qos_policy.name` or `qos_policy.uuid` - Existing traditional or adaptive QoS policy to be applied to the LUN. All LUNs should be managed by a QoS policy at the volume or LUN level.

    ### Default property values

    If not specified in POST, the follow default property values are assigned. * `auto_delete` - false

    ### Related ONTAP commands

    - `lun create`
    - `lun convert-from-namespace`
    - `lun copy start`
    - `volume file clone autodelete`
    - `volume file clone create` The `name` property is required when creating a new LUN. The name must start with an alphabetic character (a to z or A to Z) or an underscore (_). The name must be 203 characters or less in length. The `location` properties are not supported. POST is asynchronous when creating a new LUN. It is synchronous when converting a namespace to a LUN via the `convert` property.

    ### Learn more

    - `DOC /storage/luns`

    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 a LUN.

    ### Related ONTAP commands

    - `lun copy cancel`
    - `lun delete` DELETE is asynchronous.

    ### Learn more

    - `DOC /storage/luns`

    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 a LUN's properties or a LUN's data.
    LUN data read requests are distinguished by the header entry `Accept: multipart/form-data`. When this header entry is provided, query parameters `data.offset` and `data.size` are required and used to specify the portion of the LUN's data to read; no other query parameters are allowed. Reads are limited to one megabyte (1MB) per request. Data is returned as `multipart/form-data` content with exactly one form entry containing the data. The form entry has content type `application/octet-stream`.

    ### 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. * `attributes.*` * `auto_delete` * `copy.*` * `lun_maps.*` * `movement.*` * `space.physical_used` * `space.physical_used_by_snapshots` * `space.efficiency_ratio` * `space.snapshot.*` * `statistics.*` * `vvol.bindings.*` * `metric.*`

    ### Related ONTAP commands

    - `lun bind show`
    - `lun copy show`
    - `lun mapping show`
    - `lun move show`
    - `lun show`
    - `volume file clone show-autodelete`

    ### Learn more

    - `DOC /storage/luns`

    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 or if not all of the keys required are present and config.STRICT_GET has been set to True.

  `def patch (self, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse`

    Updates an existing LUN in one of several ways: - Updates the properties of a LUN. - Writes data to a LUN. LUN data write requests are distinguished by the header entry `Content-Type: multipart/form-data`. When this header entry is provided, query parameter `data.offset` is required and used to specify the location within the LUN at which to write the data; no other query parameters are allowed. The request body must be `multipart/form-data` content with exactly one form entry containing the data to write. The content type entry of the form data is ignored and always treated as `application/octet-stream`. Writes are limited to one megabyte (1MB) per request. - Overwrites the contents of a LUN as a clone of another. - Begins the movement of a LUN between volumes. PATCH can also pause and resume the movement of a LUN between volumes that is already in active.

    ### Related ONTAP commands

    - `lun copy modify`
    - `lun copy pause`
    - `lun copy resume`
    - `lun modify`
    - `lun move-in-volume`
    - `lun move modify`
    - `lun move pause`
    - `lun move resume`
    - `lun move start`
    - `lun resize`
    - `volume file clone autodelete` PATCH is asynchronous when modifying `name` or `qos_policy`.

    ### Learn more

    - `DOC /storage/luns`

    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 a LUN.

    ### Required properties

    - `svm.uuid` or `svm.name` - Existing SVM in which to create the LUN.
    - `name`, `location.volume.name` or `location.volume.uuid` - Existing volume in which to create the LUN.
    - `name` or `location.logical_unit` - Base name of the LUN.
    - `os_type` - Operating system from which the LUN will be accessed. Required when creating a non-clone LUN and disallowed when creating a clone of an existing LUN. A clone's `os_type` is taken from the source LUN.
    - `space.size` - Size of the LUN. Required when creating a non-clone LUN and disallowed when creating a clone of an existing LUN. A clone's size is taken from the source LUN.

    ### Recommended optional properties

    - `qos_policy.name` or `qos_policy.uuid` - Existing traditional or adaptive QoS policy to be applied to the LUN. All LUNs should be managed by a QoS policy at the volume or LUN level.

    ### Default property values

    If not specified in POST, the follow default property values are assigned. * `auto_delete` - false

    ### Related ONTAP commands

    - `lun create`
    - `lun convert-from-namespace`
    - `lun copy start`
    - `volume file clone autodelete`
    - `volume file clone create` The `name` property is required when creating a new LUN. The name must start with an alphabetic character (a to z or A to Z) or an underscore (_). The name must be 203 characters or less in length. The `location` properties are not supported. POST is asynchronous when creating a new LUN. It is synchronous when converting a namespace to a LUN via the `convert` property.

    ### Learn more

    - `DOC /storage/luns`

    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`
    - `validate_schema`
`class LunSchema (*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)`

  The fields of the Lun object

  ### Ancestors

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

  ### Class variables

  `attributes: List[LunAttributes] GET POST`

    An array of name/value pairs optionally stored with the LUN. Attributes are available to callers to persist small amounts of application-specific metadata. They are in no way interpreted by ONTAP.
    Attribute names and values must be at least one byte and no more than 4091 bytes in length. The sum of the name and value lengths must be no more than 4092 bytes.
    Valid in POST except when creating a LUN clone. A cloned can already have attributes from its source. You can add, modify, and delete the attributes of a LUN clone in separate requests after creation of the LUN.
    Attributes can be added/modified/removed for an existing LUN using the /api/storage/luns/{lun.uuid}/attributes endpoint. For further information, see `DOC /storage/luns/{lun.uuid}/attributes`.
    There is an added computational cost to retrieving property values for `attributes`. They are not populated for a GET request unless explicitly requested using the `fields` query parameter. See `Requesting specific fields` to learn more.

  `auto_delete: bool GET POST PATCH`

    This property marks the LUN for auto deletion when the volume containing the LUN runs out of space. This is most commonly set on LUN clones.
    When set to true, the LUN becomes eligible for automatic deletion when the volume runs out of space. Auto deletion only occurs when the volume containing the LUN 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 LUN is false.
    There is an added computational cost to retrieving this property's value. It is not populated for a GET request unless it is explicitly requested using the `fields` query parameter. See `Requesting specific fields` to learn more. This property is not supported. It cannot be set in POST or PATCH and will not be returned by GET.

  `class_: str GET POST`

    The class of LUN.
    Optional in POST.
    When set to protocol_endpoint, most other properties are not supported in POST and the operation can be asynchronous. The LUN is provisioned with a generated name. Protocol endpoints are provisioned in a round robin pattern across all nodes in the cluster.
    The following properties are supported in POST:

    - `class`
    - `svm`
    - `provisioning_options.count`
    - `lun_maps`

    - `comment` POST is asynchronous in these cases:

    - There are nodes in the cluster not already hosting a protocol endpoint.

    - The request includes either the `lun_maps` or `provisioning_options.count` properties.
    - The `records` array is used for bulk provisioning.
      DELETE is asynchronous when calling DELETE on the last protocol endpoint on a node.
      Calling implementations should not attempt to track these conditions. Instead, check the HTTP status code. A 200 or 201 status code indicates the operation is already complete. A 202 status code indicates there is an asynchronous job that can be tracked. If asynchronous requests are always preferred, wrap individual POST and DELETE requests in a `records` array to force the operation to be asynchronous.
      For more details, see `Asynchronous operations`

    Valid choices:

    - regular
    - protocol_endpoint
    - vvol
  `clone: ConsistencyGroupConsistencyGroupsLunsClone POST PATCH`

    This sub-object is used in POST to create a new LUN as a clone of an existing LUN, or PATCH to overwrite an existing LUN as a clone of another. Setting a property in this sub-object indicates that a LUN clone is desired. Consider the following other properties when cloning a LUN: `auto_delete`, `qos_policy`, `space.guarantee.requested` and `space.scsi_thin_provisioning_support_enabled`.
    When used in a PATCH, the patched LUN's data is over-written as a clone of the source and the following properties are preserved from the patched LUN unless otherwise specified as part of the PATCH: `class`, `auto_delete`, `lun_maps`, `serial_number`, `status.state`, and `uuid`.
    Persistent reservations for the patched LUN are also preserved. This endpoint does not support clones. No properties in this sub-object can be set for POST or PATCH and none will be returned by GET.
    Cloning is supported through the /api/storage/storage-units endpoint. See the `POST /api/storage/storage-units` to learn more about cloning LUNs.

  `comment: str GET POST PATCH`

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

  `consistency_group: LunConsistencyGroup GET`

    The LUN's consistency group. This property is populated for LUNs that are members of a consistency group. If the LUN is a member of a child consistency group, the parent consistency group is reported. A LUN's consistency group is the consistency group of its containing volume. A LUN is optionally associated directly with a consistency group.

  `convert: LunConvert POST`

    This sub-object is used in POST to convert a valid in-place NVMe namespace to a LUN. Setting a property in this sub-object indicates that a conversion from the specified NVMe namespace to LUN is desired.

  `copy: LunCopy GET POST PATCH`

    This sub-object applies to LUN copy operations. A LUN can be copied with a POST request that supplies `copy.source` properties.
    Copying a LUN is an asynchronous activity begun by a POST request that specifies the source of the copy in the `copy.source` properties. The data for the LUN is then asynchronously copied from the source to the destination. The time required to complete the copy depends on the size of the LUN and the load on the cluster. The `copy` sub-object is populated while a LUN copy is in progress and for two (2) minutes following completion of a copy.
    While LUNs are being copied, the status of the LUN copy operations can be obtained using a GET of the source or destination LUN that requests the `copy` properties. If the LUN is the source LUN for one or more copy operations, the `copy.destinations` array is populated in GET. If the containing LUN is the destination LUN for a copy operation, the `copy.source` sub-object is populated in GET. The LUN copy operation can be further modified using a PATCH on the properties on the `copy.source` sub-object of the copy destination LUN.
    There is an added computational cost to retrieving property values for `copy`. They are not populated for a GET request unless explicitly requested using the `fields` query parameter. See `Requesting specific fields` to learn more. LUN copies are not supported. No properties in this sub-object can be set in POST or PATCH and none will be returned by GET.

  `create_time: ImpreciseDateTime GET`

    The time the LUN was created.

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

  `enabled: bool GET PATCH`

    The enabled state of the LUN. LUNs can be disabled to prevent access to the LUN. Certain error conditions also cause the LUN to become disabled. If the LUN is disabled, check the `status.state` property to determine if the LUN is administratively disabled (offline) or has become disabled as a result of an error. A LUN in an error condition can be brought online by setting the `enabled` property to true or brought administratively offline by setting the `enabled` property to false. Upon creation, a LUN is enabled by default. Valid in PATCH.

  `encryption: StorageUnitEncryption GET`

    The encryption field of the lun.

  `links: SelfLink GET`

    The links field of the lun.

  `location: LunLocation GET POST PATCH`

    The location of the LUN within the ONTAP cluster. LUNs support rename and move between volumes. Valid in POST and PATCH. The LUN name can be changed by PATCHing the `name` property. The `location` properties are read-only.

  `lun_maps: List[LunLunMaps] GET POST`

    The LUN maps with which the LUN is associated.
    There is an added computational cost to retrieving property values for `lun_maps`. They are not populated for a GET request unless explicitly requested using the `fields` query parameter. See `Requesting specific fields` to learn more. These properties are supported for GET and POST. During POST, it requires the `provisioning_options.auto` property to be set to true. See the `provisioning_options.auto` property for full details. These properties are supported for GET and POST. During POST, a new or existing initiator group can be referenced. When referencing an existing initiator group, only the `name` and `uuid` properties are supported.

  `metric: PerformanceMetric GET`

    Performance numbers, such as IOPS latency and throughput.

  `movement: LunMovement GET POST PATCH`

    This sub-object applies to LUN movement between volumes. A LUN can be moved to a new volume with a PATCH request that changes either the volume portion of property `name`, `location.volume.uuid`, or `location.volume.name`. If the volume is changed using more than one of these properties, the supplied properties used must refer to the same volume.
    Moving a LUN between volumes is an asynchronous activity begun by a PATCH request. The data for the LUN is then asynchronously copied from the source volume to the destination volume. The time required to complete the move depends on the size of the LUN and the load on the cluster. The `movement` sub-object is populated while a LUN movement is in progress and for two (2) minutes following completion of a movement.
    While the LUN is being moved, the status of the LUN movement operation can be obtained using a GET for the LUN that requests the `movement` properties. The LUN movement operation can be further modified using a PATCH on the properties on the `movement` sub-object.
    There is an added computational cost to retrieving property values for `movement`. They are not populated for a GET request unless explicitly requested using the `fields` query parameter. See `Requesting specific fields` to learn more. LUN movement is not supported. No properties in this sub-object can be set in POST or PATCH and none will be returned by GET.

  `name: str GET POST PATCH`

    The name of the LUN. Valid in POST and PATCH.
    A LUN is located within a volume. Optionally, it can be located within a qtree in a volume.
    LUN names are paths of the form "/vol/\[/\]/\" where the qtree name is optional.
    A PATCH that modifies the qtree and/or base name portion of the LUN path is considered a rename operation.
    A PATCH that modifies the volume portion of the LUN path begins an asynchronous LUN movement operation. LUN names are simple names that share a namespace with NVMe namespaces within the same SVM. The name must begin with a letter or "_" and contain only "_" and alphanumeric characters. In specific cases, an optional snapshot-name can be used of the form "\[@\]". The snapshot name must not begin or end with whitespace.
    A PATCH that modifies the name of the LUN is considered a rename operation.

    Example: /vol/volume1/qtree1/lun1

  `os_type: str GET POST`

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

    Valid choices:

    - aix
    - hpux
    - hyper_v
    - linux
    - netware
    - openvms
    - solaris
    - solaris_efi
    - vmware
    - windows
    - windows_2008
    - windows_gpt
    - xen
  `provisioning_options: LunProvisioningOptions POST`

    Options that are applied to the operation.

  `qos_policy: LunQosPolicy GET POST PATCH`

    The QoS policy for the LUN. Both traditional and adaptive QoS policies are supported. If both property `qos_policy.uuid` and `qos_policy.name` are specified in the same request, they must refer to the same QoS policy. To remove the QoS policy from a LUN, leaving it with no QoS policy, set the property `qos_policy.name` to an empty string ("") in a PATCH request. Valid in POST and PATCH. To remove the QoS policy, set it to `null` in a PATCH request.

  `serial_number: str GET`

    The LUN serial number. The serial number is generated by ONTAP when the LUN is created.

  `serial_number_hex: str GET`

    The LUN serial number encoded in hexadecimal format. The serial number is generated by ONTAP when the LUN is created.

  `space: LunSpace GET POST PATCH`

    The storage space related properties of the LUN.

  `statistics: PerformanceMetricRaw GET`

    The statistics field of the lun.

  `status: LunStatus GET`

    Status information about the LUN.

  `svm: Svm GET POST`

    The svm field of the lun.

  `uuid: str GET`

    The unique identifier of the LUN. The UUID is generated by ONTAP when the LUN is created.

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

  `vvol: LunVvol GET`

    A VMware virtual volume (vVol) binding is an association between a LUN of class `protocol_endpoint` and a LUN of class `vvol`. Class `protocol_endpoint` LUNs are mapped to igroups and granted access using the same configuration as class `regular` LUNs. When a class `vvol` LUN is bound to a mapped class `protocol_endpoint` LUN, VMware can access the class `vvol` LUN through the class `protocol_endpoint` LUN mapping.
    See `POST /protocols/san/vvol-bindings` to learn more about creating vVol bindings and `DELETE /protocols/san/vvol-bindings` to learn more about deleting vVol bindings.
    There is an added computational cost to retrieving property values for `vvol`. They are not populated for a GET request unless explicitly requested using the `fields` query parameter. See `Requesting specific fields` to learn more.