Module netapp_ontap.resources.volume

Copyright © 2021 NetApp Inc. All rights reserved.

Overview

FlexVol volumes are logical containers used by ONTAP to serve data to clients. They contain file systems in a NAS environment and LUNs in a SAN environment.
A FlexGroup volume is a scale-out NAS container that provides high performance along with automatic load distribution and scalability. A FlexGroup volume contains several constituents that automatically and transparently share the traffic.
FlexClone volumes are writable, point-in-time copies of a FlexVol volume. At this time, FlexClones of FlexGroups are not supported.
Volumes with SnapLock type Compliance or Enterprise, are referred to as SnapLock volumes. Volumes with SnapLock type cannot be of FlexGroup style. Once a SnapLock aggregate is created, by default, volumes created inside the aggregate inherit the "snaplock" property from the aggregate. It is possible to create a SnapLock volume by specifying SnapLock parameters. SnapLock parameters are only available at the "advanced" privilege level.
ONTAP storage APIs allow you to create, modify, and monitor volumes and aggregates.

Storage efficiency

Storage efficiency is used to remove duplicate blocks in the data and to compress the data. Efficiency has deduplication, compression, cross volume deduplication, and compaction options. On All Flash systems, all efficiencies are enabled by default on volume creation. Options such as "background/inline/both" are treated as both, which means both background and inline are enabled for any efficiency option. The option "none" disables both background and inline efficiency.
To enable any efficiency option on all-flash or FAS systems, background deduplication is always enabled.

Quotas

Quotas provide a way to restrict or track the files and space usage by a user, group, or qtree. Quotas are enabled for a specific FlexVol or a FlexGroup volume.
The following APIs can be used to enable or disable and obtain quota state for a FlexVol or a FlexGroup volume:

  • PATCH /api/storage/volumes/{uuid} -d '{"quota.enabled":"true"}'
  • PATCH /api/storage/volumes/{uuid} -d '{"quota.enabled":"false"}'
  • GET /api/storage/volumes/{uuid}/?fields=quota.state

File System Analytics

File system analytics provide a quick method for obtaining information summarizing properties of all files within any directory tree of a volume. For more information on file system analytics, see DOC /storage/volumes{volume.uuid}/files/{path}. Analytics can be enabled or disabled on individual volumes.
The following APIs can be used to enable or disable and obtain analytics state for a FlexVol volume or a FlexGroup volume:

  • PATCH /api/storage/volumes/{uuid} -d '{"analytics.state":"on"}'
  • PATCH /api/storage/volumes/{uuid} -d '{"analytics.state":"off"}'
  • GET /api/storage/volumes/{uuid}/?fields=analytics

QoS

QoS policy and settings enforce Service Level Objectives (SLO) on a volume. SLO can be set by specifying qos.max_throughput_iops and/or qos.max_throughput_mbps or qos.min_throughput_iops. Specifying min_throughput_iops is only supported on volumes hosted on a node that is flash optimized. A pre-created QoS policy can also be used by specifying qos.name or qos.uuid property.

Performance monitoring

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

Volume APIs

The following APIs are used to perform operations related with FlexVol volumes and FlexGroup volumes:

  • POST /api/storage/volumes
  • GET /api/storage/volumes
  • GET /api/storage/volumes/{uuid}
  • PATCH /api/storage/volumes/{uuid}
  • DELETE /api/storage/volumes/{uuid}

Examples

Creating a volume

The POST request is used to create a new volume and to specify its properties.

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume()
    resource.name = "vol1"
    resource.aggregates = [{"name": "aggr1"}]
    resource.svm.name = "vs1"
    resource.post(hydrate=True)
    print(resource)

Volume({"aggregates": [{"name": "aggr1"}], "name": "vol1", "svm": {"name": "vs1"}})

Creating a SnapLock volume and specifying its properties using POST

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume()
    resource.name = "vol1"
    resource.aggregates = [{"name": "aggr1"}]
    resource.svm.name = "vs1"
    resource.snaplock.retention.default = "P20Y"
    resource.post(hydrate=True)
    print(resource)

Volume(
    {
        "snaplock": {"retention": {"default": "P20Y"}},
        "aggregates": [{"name": "aggr1"}],
        "name": "vol1",
        "svm": {"name": "vs1"},
    }
)

Creating a FlexGroup volume and specifying its properties using POST

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume()
    resource.name = "vol1"
    resource.state = "online"
    resource.type = "RW"
    resource.aggregates = [{"name": "aggr1"}, {"name": "aggr2"}, {"name": "aggr3"}]
    resource.constituents_per_aggregate = "1"
    resource.svm.name = "vs1"
    resource.size = "240MB"
    resource.encryption.enabled = "False"
    resource.efficiency.compression = "both"
    resource.autosize.maximum = "500MB"
    resource.autosize.minimum = "240MB"
    resource.post(hydrate=True)
    print(resource)

Volume(
    {
        "autosize": {"maximum": 524288000, "minimum": 251658240},
        "encryption": {"enabled": False},
        "constituents_per_aggregate": 1,
        "state": "online",
        "size": 251658240,
        "efficiency": {"compression": "both"},
        "aggregates": [{"name": "aggr1"}, {"name": "aggr2"}, {"name": "aggr3"}],
        "name": "vol1",
        "type": "RW",
        "svm": {"name": "vs1"},
    }
)

Creating a FlexClone and specifying its properties using POST

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume()
    resource.name = "vol1_clone"
    resource.clone.parent_volume.name = "vol1"
    resource.clone.is_flexclone = True
    resource.svm.name = "vs0"
    resource.post(hydrate=True)
    print(resource)

Volume(
    {
        "clone": {"is_flexclone": True, "parent_volume": {"name": "vol1"}},
        "name": "vol1_clone",
        "svm": {"name": "vs0"},
    }
)

Volumes reported in the GET REST API

The following types of volumes are reported:

  • RW, DP and LS volumes
  • FlexGroup volume
  • FlexCache volume
  • FlexClone volume

The following volumes are not reported:

  • DEL and TMP type volume
  • Node Root volume
  • System Vserver volume
  • FlexGroup constituent
  • FlexCache constituent

Examples

Retrieving the list of volumes

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    print(list(Volume.get_collection()))

[
    Volume(
        {
            "uuid": "2d1167cc-c3f2-495a-a23f-8f50b071b9b8",
            "name": "vsdata_root",
            "_links": {
                "self": {
                    "href": "/api/storage/volumes/2d1167cc-c3f2-495a-a23f-8f50b071b9b8"
                }
            },
        }
    ),
    Volume(
        {
            "uuid": "3969be7e-78b4-4b4c-82a4-fa86331f03df",
            "name": "vsfg_root",
            "_links": {
                "self": {
                    "href": "/api/storage/volumes/3969be7e-78b4-4b4c-82a4-fa86331f03df"
                }
            },
        }
    ),
    Volume(
        {
            "uuid": "59c03ac5-e708-4ce8-a676-278dc249fda2",
            "name": "svm_root",
            "_links": {
                "self": {
                    "href": "/api/storage/volumes/59c03ac5-e708-4ce8-a676-278dc249fda2"
                }
            },
        }
    ),
    Volume(
        {
            "uuid": "6802635b-8036-11e8-aae5-0050569503ac",
            "name": "fgvol",
            "_links": {
                "self": {
                    "href": "/api/storage/volumes/6802635b-8036-11e8-aae5-0050569503ac"
                }
            },
        }
    ),
    Volume(
        {
            "uuid": "d0c3359c-5448-4a9b-a077-e3295a7e9057",
            "name": "datavol",
            "_links": {
                "self": {
                    "href": "/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057"
                }
            },
        }
    ),
]

Retrieving the attributes of a volume

The GET request is used to retrieve the attributes of a volume.

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume(uuid="d0c3359c-5448-4a9b-a077-e3295a7e9057")
    resource.get()
    print(resource)

Volume(
    {
        "nas": {
            "security_style": "unix",
            "gid": 2468,
            "uid": 1357,
            "junction_parent": {
                "_links": {
                    "self": {
                        "href": "/api/storage/volumes/a2564f80-25fb-41e8-9b49-44de2600991f"
                    }
                },
                "name": "vol1",
                "uuid": "a2564f80-25fb-41e8-9b49-44de2600991f",
            },
            "export_policy": {"id": 8589934593, "name": "default"},
            "unix_permissions": 4755,
        },
        "qos": {
            "policy": {"uuid": "228454af-5a8b-11e9-bd5b-005056ac6f1f", "name": "pg1"}
        },
        "statistics": {
            "flexcache_raw": {
                "client_requested_blocks": 0,
                "cache_miss_blocks": 0,
                "timestamp": "2019-04-09T05:50:15+00:00",
                "status": "ok",
            },
            "latency_raw": {"other": 38298, "read": 0, "write": 0, "total": 38298},
            "timestamp": "2019-04-09T05:50:42+00:00",
            "throughput_raw": {"other": 0, "read": 0, "write": 0, "total": 0},
            "cloud": {
                "latency_raw": {"other": 0, "read": 0, "write": 0, "total": 0},
                "timestamp": "2019-04-09T05:50:42+00:00",
                "iops_raw": {"other": 0, "read": 0, "write": 0, "total": 0},
                "status": "ok",
            },
            "iops_raw": {"other": 3, "read": 0, "write": 0, "total": 3},
            "status": "ok",
        },
        "snapshot_policy": {"name": "default"},
        "uuid": "d0c3359c-5448-4a9b-a077-e3295a7e9057",
        "encryption": {"type": "none", "state": "none", "key_id": "", "enabled": False},
        "snaplock": {
            "litigation_count": 0,
            "is_audit_log": False,
            "expiry_time": "2038-01-19T08:44:28+05:30",
            "type": "enterprise",
            "autocommit_period": "none",
            "compliance_clock_time": "2019-05-24T10:59:00+05:30",
            "retention": {"minimum": "P0Y", "default": "P0Y", "maximum": "P30Y"},
            "append_mode_enabled": False,
            "privileged_delete": "disabled",
        },
        "state": "online",
        "comment": "This is a data volume",
        "size": 20971520,
        "aggregates": [
            {
                "uuid": "aa742322-36bc-4d98-bbc4-0a827534c035",
                "_links": {"self": {"href": "/api/cluster/aggregates/data"}},
                "name": "data",
            }
        ],
        "error_state": {"has_bad_blocks": False, "is_inconsistent": False},
        "create_time": "2018-07-05T14:56:44+05:30",
        "metric": {
            "latency": {"other": 0, "read": 0, "write": 0, "total": 0},
            "throughput": {"other": 0, "read": 0, "write": 0, "total": 0},
            "timestamp": "2019-04-09T05:50:15+00:00",
            "duration": "PT15S",
            "cloud": {
                "timestamp": "2019-04-09T05:50:15+00:00",
                "duration": "PT15S",
                "status": "ok",
                "iops": {"other": 0, "read": 0, "write": 0, "total": 0},
                "latency": {"other": 0, "read": 0, "write": 0, "total": 0},
            },
            "status": "ok",
            "iops": {"other": 0, "read": 0, "write": 0, "total": 0},
            "flexcache": {
                "timestamp": "2019-04-09T05:50:15+00:00",
                "duration": "PT1D",
                "status": "ok",
                "bandwidth_savings": 0,
                "cache_miss_percent": 0,
            },
        },
        "name": "datavol",
        "style": "flexvol",
        "type": "rw",
        "language": "en_us",
        "_links": {
            "self": {
                "href": "/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057"
            }
        },
        "svm": {"uuid": "d61b69f5-7458-11e8-ad3f-0050569503ac", "name": "vsdata"},
        "files": {"maximum": 566, "used": 96},
    }
)

Retrieving the quota state of a FlexVol or a FlexGroup volume

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume(uuid="cb20da45-4f6b-11e9-9a71-005056a7f717")
    resource.get(fields="quota.state")
    print(resource)

Volume(
    {
        "uuid": "cb20da45-4f6b-11e9-9a71-005056a7f717",
        "quota": {"state": "on"},
        "name": "fv",
        "_links": {
            "self": {
                "href": "/api/storage/volumes/cb20da45-4f6b-11e9-9a71-005056a7f717/"
            }
        },
    }
)

Retrieving the constituents of a FlexGroup volume

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume(uuid="d0c3359c-5448-4a9b-a077-e3295a7e9057")
    resource.get(fields="constituents")
    print(resource)

Volume(
    {
        "constituents": [
            {
                "space": {
                    "local_tier_footprint": 540958720,
                    "footprint": 389120,
                    "over_provisioned": 0,
                    "available": 479756288,
                    "metadata": 4087808,
                    "snapshot": {"autodelete_enabled": False, "reserve_percent": 5},
                    "used": 30273536,
                    "logical_space": {
                        "used_by_afs": 30273536,
                        "reporting": False,
                        "enforcement": False,
                    },
                    "total_footprint": 540958720,
                    "size": 536870912,
                },
                "name": "fg__0001",
                "aggregates": {
                    "name": "vs_aggr",
                    "uuid": "2e00716c-eb54-45a9-8ca5-be50ccd40708",
                },
            },
            {
                "space": {
                    "local_tier_footprint": 540958720,
                    "footprint": 389120,
                    "over_provisioned": 0,
                    "available": 479756288,
                    "metadata": 4087808,
                    "snapshot": {"autodelete_enabled": False, "reserve_percent": 5},
                    "used": 30273536,
                    "logical_space": {
                        "used_by_afs": 30273536,
                        "reporting": False,
                        "enforcement": False,
                    },
                    "total_footprint": 540958720,
                    "size": 536870912,
                },
                "name": "fg__0002",
                "aggregates": {
                    "name": "aggr1",
                    "uuid": "f655cf4f-8208-4fc8-bfc8-4f238d434402",
                },
            },
            {
                "space": {
                    "local_tier_footprint": 540958720,
                    "footprint": 389120,
                    "over_provisioned": 0,
                    "available": 479756288,
                    "metadata": 4087808,
                    "snapshot": {"autodelete_enabled": False, "reserve_percent": 5},
                    "used": 30273536,
                    "logical_space": {
                        "used_by_afs": 30273536,
                        "reporting": False,
                        "enforcement": False,
                    },
                    "total_footprint": 540958720,
                    "size": 536870912,
                },
                "name": "fg__0003",
                "aggregates": {
                    "name": "aggr2",
                    "uuid": "c7239f14-b861-46fc-b406-70fe13c1a4fb",
                },
            },
            {
                "space": {
                    "local_tier_footprint": 540958720,
                    "footprint": 389120,
                    "over_provisioned": 0,
                    "available": 479756288,
                    "metadata": 4087808,
                    "snapshot": {"autodelete_enabled": False, "reserve_percent": 5},
                    "used": 30273536,
                    "logical_space": {
                        "used_by_afs": 30273536,
                        "reporting": False,
                        "enforcement": False,
                    },
                    "total_footprint": 540958720,
                    "size": 536870912,
                },
                "name": "fg__0004",
                "aggregates": {
                    "name": "aggr3",
                    "uuid": "4c86137a-06af-482d-a41c-d64acc5dcea4",
                },
            },
        ],
        "uuid": "d0c3359c-5448-4a9b-a077-e3295a7e9057",
        "name": "fg",
        "_links": {
            "self": {
                "href": "/api/storage/volumes/d0c3359c-5448-4a9b-a077-e3295a7e9057"
            }
        },
    }
)

Updating the attributes of a volume

Examples

Updating the attributes of a volume

The PATCH request is used to update the attributes of a volume.

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume(uuid="d0c3359c-5448-4a9b-a077-e3295a7e9057")
    resource.size = 26214400
    resource.nas.security_style = "mixed"
    resource.comment = "This is a data volume"
    resource.patch()

Updating the attributes of a FlexClone using PATCH

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume(uuid="d0c3359c-5448-4a9b-a077-e3295a7e9057")
    resource.clone.split_initiated = True
    resource.patch()

Enabling quotas for a FlexVol or a FlexGroup volume using PATCH

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume(uuid="d0c3359c-5448-4a9b-a077-e3295a7e9057")
    resource.quota.enabled = True
    resource.patch()

Disabling quotas for a FlexVol or a FlexGroup volume using PATCH

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume(uuid="d0c3359c-5448-4a9b-a077-e3295a7e9057")
    resource.quota.enabled = False
    resource.patch()

Add tiering object tags for a FlexVol using PATCH

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume(uuid="d0c3359c-5448-4a9b-a077-e3295a7e9057")
    resource.tiering.object_tags = ["key1=val1", "key2=val2"]
    resource.patch()

Remove tiering object tags for a FlexVol using PATCH

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume(uuid="d0c3359c-5448-4a9b-a077-e3295a7e9057")
    resource.tiering.object_tags = []
    resource.patch()

Deleting a volume

Example

Deleting a volume

The DELETE request is used to delete a volume.

from netapp_ontap import HostConnection
from netapp_ontap.resources import Volume

with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
    resource = Volume(uuid="{uuid}")
    resource.delete()

Classes

class Volume (*args, **kwargs)

Allows interaction with Volume objects on the host

Initialize the instance of the resource.

Any keyword arguments are set on the instance as properties. For example, if the class was named 'MyResource', then this statement would be true:

MyResource(name='foo').name == 'foo'

Args

*args
Each positional argument represents a parent key as used in the URL of the object. That is, each value will be used to fill in a segment of the URL which refers to some parent object. The order of these arguments must match the order they are specified in the URL, from left to right.
**kwargs
each entry will have its key set as an attribute name on the instance and its value will be the value of that attribute.

Ancestors

Static methods

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

Retrieves volumes.

Expensive properties

There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the fields query parameter. See Requesting specific fields to learn more. * is_svm_root * analytics.* * application.* * encryption.* * queue_for_encryption * clone.parent_snapshot.name * clone.parent_snapshot.uuid * clone.parent_svm.name * clone.parent_svm.uuid * clone.parent_volume.name * clone.parent_volume.uuid * clone.split_complete_percent * clone.split_estimate * clone.split_initiated * efficiency.* * error_state.* * files.* * nas.export_policy.id * nas.gid * nas.path * nas.security_style * nas.uid * nas.unix_permissions * nas.junction_parent.name * nas.junction_parent.uuid * snaplock.* * restore_to.* * snapshot_policy.uuid * quota.* * qos.* * flexcache_endpoint_type * space.block_storage_inactive_user_data * space.capacity_tier_footprint * space.performance_tier_footprint * space.local_tier_footprint * space.footprint * space.over_provisioned * space.metadata * space.total_footprint * space.logical_space.* * space.snapshot.* * space.used_by_afs * space.afs_total * space.available_percent * space.full_threshold_percent * space.nearly_full_threshold_percent * space.overwrite_reserve * space.overwrite_reserve_used * space.size_available_for_snapshots * space.percent_used * space.fractional_reserve * space.block_storage_inactive_user_data_percent * guarantee.* * autosize.* * movement.* * statistics.* * constituents.name *constituents.space.size * constituents.space.available *constituents.space.used * constituents.space.block_storage_inactive_user_data *constituents.space.capacity_tier_footprint * constituents.space.performance_tier_footprint *constituents.space.local_tier_footprint * constituents.space.footprint *constituents.space.over_provisioned * constituents.space.metadata *constituents.space.total_footprint * constituents.space.logical_space.reporting *constituents.space.logical_space.enforcement * constituents.space.logical_space.used_by_afs *constituents.space.logical_space.available * constituents.space.snapshot.used *constituents.space.snapshot.reserve_percent * constituents.space.snapshot.autodelete_enabled *constituents.aggregates.name * constituents.aggregates.uuid *constituents.movement.destination_aggregate.name * constituents.movement.destination_aggregate.uuid *constituents.movement.state * constituents.movement.percent_complete *constituents.movement.cutover_window * `constituents.movement.tiering_policy

  • volume show
  • volume clone show
  • volume efficiency show
  • volume encryption show
  • volume flexcache show
  • volume flexgroup show
  • volume move show
  • volume quota show
  • volume show-space
  • volume snaplock show

Learn more


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

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, body: typing.Union = None, connection: HostConnection = None, **kwargs) -> NetAppResponse

Deletes a volume. If the UUID belongs to a volume, all of its blocks are freed and returned to its containing aggregate. If a volume is online, it is offlined before deletion. If a volume is mounted, unmount the volume by specifying the nas.path as empty before deleting it using the DELETE operation.

  • volume delete
  • volume clone delete

Learn more


Delete all objects in a collection which match the given query.

All records on the host which match the query will be deleted.

Args

*args
Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to delete the collection of bars for a particular foo, the foo.name value should be passed.
body
The body of the delete request. This could be a Resource instance or a dictionary object.
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 find(*args, connection: HostConnection = None, **kwargs) -> Resource

Retrieves volumes.

Expensive properties

There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the fields query parameter. See Requesting specific fields to learn more. * is_svm_root * analytics.* * application.* * encryption.* * queue_for_encryption * clone.parent_snapshot.name * clone.parent_snapshot.uuid * clone.parent_svm.name * clone.parent_svm.uuid * clone.parent_volume.name * clone.parent_volume.uuid * clone.split_complete_percent * clone.split_estimate * clone.split_initiated * efficiency.* * error_state.* * files.* * nas.export_policy.id * nas.gid * nas.path * nas.security_style * nas.uid * nas.unix_permissions * nas.junction_parent.name * nas.junction_parent.uuid * snaplock.* * restore_to.* * snapshot_policy.uuid * quota.* * qos.* * flexcache_endpoint_type * space.block_storage_inactive_user_data * space.capacity_tier_footprint * space.performance_tier_footprint * space.local_tier_footprint * space.footprint * space.over_provisioned * space.metadata * space.total_footprint * space.logical_space.* * space.snapshot.* * space.used_by_afs * space.afs_total * space.available_percent * space.full_threshold_percent * space.nearly_full_threshold_percent * space.overwrite_reserve * space.overwrite_reserve_used * space.size_available_for_snapshots * space.percent_used * space.fractional_reserve * space.block_storage_inactive_user_data_percent * guarantee.* * autosize.* * movement.* * statistics.* * constituents.name *constituents.space.size * constituents.space.available *constituents.space.used * constituents.space.block_storage_inactive_user_data *constituents.space.capacity_tier_footprint * constituents.space.performance_tier_footprint *constituents.space.local_tier_footprint * constituents.space.footprint *constituents.space.over_provisioned * constituents.space.metadata *constituents.space.total_footprint * constituents.space.logical_space.reporting *constituents.space.logical_space.enforcement * constituents.space.logical_space.used_by_afs *constituents.space.logical_space.available * constituents.space.snapshot.used *constituents.space.snapshot.reserve_percent * constituents.space.snapshot.autodelete_enabled *constituents.aggregates.name * constituents.aggregates.uuid *constituents.movement.destination_aggregate.name * constituents.movement.destination_aggregate.uuid *constituents.movement.state * constituents.movement.percent_complete *constituents.movement.cutover_window * `constituents.movement.tiering_policy

  • volume show
  • volume clone show
  • volume efficiency show
  • volume encryption show
  • volume flexcache show
  • volume flexgroup show
  • volume move show
  • volume quota show
  • volume show-space
  • volume snaplock show

Learn more


Find an instance of an object on the host given a query.

The host will be queried with the provided key/value pairs to find a matching resource. If 0 are found, 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) -> typing.Iterable

Retrieves volumes.

Expensive properties

There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the fields query parameter. See Requesting specific fields to learn more. * is_svm_root * analytics.* * application.* * encryption.* * queue_for_encryption * clone.parent_snapshot.name * clone.parent_snapshot.uuid * clone.parent_svm.name * clone.parent_svm.uuid * clone.parent_volume.name * clone.parent_volume.uuid * clone.split_complete_percent * clone.split_estimate * clone.split_initiated * efficiency.* * error_state.* * files.* * nas.export_policy.id * nas.gid * nas.path * nas.security_style * nas.uid * nas.unix_permissions * nas.junction_parent.name * nas.junction_parent.uuid * snaplock.* * restore_to.* * snapshot_policy.uuid * quota.* * qos.* * flexcache_endpoint_type * space.block_storage_inactive_user_data * space.capacity_tier_footprint * space.performance_tier_footprint * space.local_tier_footprint * space.footprint * space.over_provisioned * space.metadata * space.total_footprint * space.logical_space.* * space.snapshot.* * space.used_by_afs * space.afs_total * space.available_percent * space.full_threshold_percent * space.nearly_full_threshold_percent * space.overwrite_reserve * space.overwrite_reserve_used * space.size_available_for_snapshots * space.percent_used * space.fractional_reserve * space.block_storage_inactive_user_data_percent * guarantee.* * autosize.* * movement.* * statistics.* * constituents.name *constituents.space.size * constituents.space.available *constituents.space.used * constituents.space.block_storage_inactive_user_data *constituents.space.capacity_tier_footprint * constituents.space.performance_tier_footprint *constituents.space.local_tier_footprint * constituents.space.footprint *constituents.space.over_provisioned * constituents.space.metadata *constituents.space.total_footprint * constituents.space.logical_space.reporting *constituents.space.logical_space.enforcement * constituents.space.logical_space.used_by_afs *constituents.space.logical_space.available * constituents.space.snapshot.used *constituents.space.snapshot.reserve_percent * constituents.space.snapshot.autodelete_enabled *constituents.aggregates.name * constituents.aggregates.uuid *constituents.movement.destination_aggregate.name * constituents.movement.destination_aggregate.uuid *constituents.movement.state * constituents.movement.percent_complete *constituents.movement.cutover_window * `constituents.movement.tiering_policy

  • volume show
  • volume clone show
  • volume efficiency show
  • volume encryption show
  • volume flexcache show
  • volume flexgroup show
  • volume move show
  • volume quota show
  • volume show-space
  • volume snaplock show

Learn more


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
**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, connection: HostConnection = None, **kwargs) -> NetAppResponse

Updates the attributes of a volume. For movement, use the "validate_only" field on the request to validate but not perform the operation. The PATCH API can be used to enable or disable quotas for a FlexVol or a FlexGroup volume. An empty path in PATCH deactivates and unmounts the volume. Taking a volume offline removes its junction path.
A PATCH request for volume encryption performs conversion/rekey operations asynchronously. You can retrieve the conversion/rekey progress details by calling a GET request on the corresponding volume endpoint.

Optional properties

  • queue_for_encryption - Queue volumes for encryption when encryption.enabled=true. If this option is not provided or is false, conversion of volumes starts immediately. When there are volumes in the queue and less than four encryptions are running, volumes are encrypted in the order in which they are queued.
  • encryption.action - You can pause an ongoing rekey/conversion operation or resume a paused rekey/conversion operation using this field. The following actions are supported for this field: ‐ conversion_pause - Pause an encryption conversion operation currently in progress ‐ conversion_resume - Resume a paused encryption conversion operation ‐ rekey_pause - Pause an encryption rekey operation currently in progress ‐ rekey_resume - Resume a paused encryption rekey operation
  • volume unmount
  • volume mount
  • volume online
  • volume offline
  • volume modify
  • volume clone modify
  • volume efficiency modify
  • volume quota on
  • volume quota off
  • volume snaplock modify
  • volume encryption conversion start
  • volume encryption rekey start

Learn more


Patch all objects in a collection which match the given query.

All records on the host which match the query will be patched with the provided body.

Args

body
A dictionary of name/value pairs to set on all matching members of the collection.
*args
Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to patch the collection of bars for a particular foo, the foo.name value should be passed.
connection
The HostConnection object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
**kwargs
Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.

Returns

A NetAppResponse object containing the details of the HTTP response.

Raises

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

Methods

def delete(self, body: typing.Union = None, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse

Deletes a volume. If the UUID belongs to a volume, all of its blocks are freed and returned to its containing aggregate. If a volume is online, it is offlined before deletion. If a volume is mounted, unmount the volume by specifying the nas.path as empty before deleting it using the DELETE operation.

  • volume delete
  • volume clone delete

Learn more


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.
**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 volume. The GET API can be used to retrieve the quota state for a FlexVol or a FlexGroup volume.

Expensive properties

There is an added cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the fields query parameter. See Requesting specific fields to learn more. * is_svm_root * analytics.* * application.* * encryption.* * clone.parent_snapshot.name * clone.parent_snapshot.uuid * clone.parent_svm.name * clone.parent_svm.uuid * clone.parent_volume.name * clone.parent_volume.uuid * clone.split_complete_percent * clone.split_estimate * clone.split_initiated * efficiency.* * error_state.* * files.* * nas.export_policy.id * nas.gid * nas.path * nas.security_style * nas.uid * nas.unix_permissions * nas.junction_parent.name * nas.junction_parent.uuid * snaplock.* * restore_to.* * snapshot_policy.uuid * quota.* * qos.* * flexcache_endpoint_type * space.block_storage_inactive_user_data * space.capacity_tier_footprint * space.performance_tier_footprint * space.local_tier_footprint * space.footprint * space.over_provisioned * space.metadata * space.total_footprint * space.logical_space.* * space.snapshot.* * space.used_by_afs * space.afs_total * space.available_percent * space.full_threshold_percent * space.nearly_full_threshold_percent * space.overwrite_reserve * space.overwrite_reserve_used * space.size_available_for_snapshots * space.percent_used * space.fractional_reserve * space.block_storage_inactive_user_data_percent * guarantee.* * autosize.* * movement.* * statistics.*

  • volume show
  • volume clone show
  • volume efficiency show
  • volume encryption show
  • volume flexcache show
  • volume flexgroup show
  • volume move show
  • volume quota show
  • volume show-space
  • volume snaplock show

Learn more


Fetch the details of the object from the host.

Requires the keys to be set (if any). After returning, new or changed properties from the host will be set on the instance.

Returns

A NetAppResponse object containing the details of the HTTP response.

Raises

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

def patch(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse

Updates the attributes of a volume. For movement, use the "validate_only" field on the request to validate but not perform the operation. The PATCH API can be used to enable or disable quotas for a FlexVol or a FlexGroup volume. An empty path in PATCH deactivates and unmounts the volume. Taking a volume offline removes its junction path.
A PATCH request for volume encryption performs conversion/rekey operations asynchronously. You can retrieve the conversion/rekey progress details by calling a GET request on the corresponding volume endpoint.

Optional properties

  • queue_for_encryption - Queue volumes for encryption when encryption.enabled=true. If this option is not provided or is false, conversion of volumes starts immediately. When there are volumes in the queue and less than four encryptions are running, volumes are encrypted in the order in which they are queued.
  • encryption.action - You can pause an ongoing rekey/conversion operation or resume a paused rekey/conversion operation using this field. The following actions are supported for this field: ‐ conversion_pause - Pause an encryption conversion operation currently in progress ‐ conversion_resume - Resume a paused encryption conversion operation ‐ rekey_pause - Pause an encryption rekey operation currently in progress ‐ rekey_resume - Resume a paused encryption rekey operation
  • volume unmount
  • volume mount
  • volume online
  • volume offline
  • volume modify
  • volume clone modify
  • volume efficiency modify
  • volume quota on
  • volume quota off
  • volume snaplock modify
  • volume encryption conversion start
  • volume encryption rekey start

Learn more


Send the difference in the object's state to the host as a modification request.

Calculates the difference in the object's state since the last time we interacted with the host and sends this in the request body.

Args

hydrate
If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
poll
If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
Any key/value pairs passed will 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: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse

Creates a volume on a specified SVM and storage aggregates.

Required properties

  • svm.uuid or svm.name - Existing SVM in which to create the volume.
  • name - Name of the volume.
  • aggregates.name or aggregates.uuid - Existing aggregates in which to create the volume.

Default property values

  • state - online
  • size - 20MB
  • style - flexvol
  • type - rw
  • encryption.enabled - false
  • snapshot_policy.name - default
  • gaurantee.type - volume
  • volume create
  • volume clone create

Learn more


Send this object to the host as a creation request.

Args

hydrate
If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
poll
If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
poll_interval
If the operation returns a job, this specifies how often to query the job for updates.
poll_timeout
If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
**kwargs
Any key/value pairs passed will 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

class VolumeSchema (*, only: typing.Union = None, exclude: typing.Union = (), many: bool = False, context: typing.Dict = None, load_only: typing.Union = (), dump_only: typing.Union = (), partial: typing.Union = False, unknown: str = None)

The fields of the Volume object

Ancestors

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

Class variables

access_time_enabled GET PATCH

Indicates whether or not access time updates are enabled on the volume.

aggregates GET POST PATCH

Aggregate hosting the volume. Required on POST.

analytics GET POST PATCH

The analytics field of the volume.

application GET POST PATCH

The application field of the volume.

autosize GET POST PATCH

The autosize field of the volume.

clone GET POST PATCH

The clone field of the volume.

cloud_retrieval_policy GET POST PATCH

This parameter specifies the cloud retrieval policy for the volume. This policy determines which tiered out blocks to retrieve from the capacity tier to the performance tier. The available cloud retrieval policies are "default" policy retrieves tiered data based on the underlying tiering policy. If the tiering policy is 'auto', tiered data is retrieved only for random client driven data reads. If the tiering policy is 'none' or 'snapshot_only', tiered data is retrieved for random and sequential client driven data reads. If the tiering policy is 'all', tiered data is not retrieved. "on_read" policy retrieves tiered data for all client driven data reads. "never" policy never retrieves tiered data. "promote" policy retrieves all eligible tiered data automatically during the next scheduled scan. It is only supported when the tiering policy is 'none' or 'snapshot_only'. If the tiering policy is 'snapshot_only', the only data brought back is the data in the AFS. Data that is only in a snapshot copy stays in the cloud and if tiering policy is 'none' then all data is retrieved.

Valid choices:

  • default
  • on_read
  • never
  • promote
comment GET POST PATCH

A comment for the volume. Valid in POST or PATCH.

consistency_group GET POST PATCH

The consistency_group field of the volume.

constituents GET POST PATCH

The constituents field of the volume.

constituents_per_aggregate POST PATCH

Specifies the number of times to iterate over the aggregates listed with the "aggregates.name" or "aggregates.uuid" when creating or expanding a FlexGroup. If a volume is being created on a single aggregate, the system will create a flexible volume if the "constituents_per_aggregate" field is not specified, and a FlexGroup if it is specified. If a volume is being created on multiple aggregates, the system will always create a FlexGroup.

create_time GET

Creation time of the volume. This field is generated when the volume is created.

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

efficiency GET POST PATCH

The efficiency field of the volume.

encryption GET POST PATCH

The encryption field of the volume.

error_state GET POST PATCH

The error_state field of the volume.

files GET POST PATCH

The files field of the volume.

flexcache_endpoint_type GET

FlexCache endpoint type.
none ‐ The volume is neither a FlexCache nor origin of any FlexCache.
cache ‐ The volume is a FlexCache volume.
origin ‐ The volume is origin of a FlexCache volume.

Valid choices:

  • none
  • cache
  • origin
guarantee GET POST PATCH

The guarantee field of the volume.

is_object_store GET

Specifies whether the volume is provisioned for an object store server.

is_svm_root GET

Specifies whether the volume is a root volume of the SVM it belongs to.

language GET POST

Language encoding setting for volume. If no language is specified, the volume inherits its SVM language encoding setting.

Valid choices:

  • ar
  • ar.utf_8
  • c
  • c.utf_8
  • cs
  • cs.utf_8
  • da
  • da.utf_8
  • de
  • de.utf_8
  • en
  • en.utf_8
  • en_us
  • en_us.utf_8
  • es
  • es.utf_8
  • fi
  • fi.utf_8
  • fr
  • fr.utf_8
  • he
  • he.utf_8
  • hr
  • hr.utf_8
  • hu
  • hu.utf_8
  • it
  • it.utf_8
  • ja
  • ja.utf_8
  • ja_jp.932
  • ja_jp.932.utf_8
  • ja_jp.pck
  • ja_jp.pck.utf_8
  • ja_jp.pck_v2
  • ja_jp.pck_v2.utf_8
  • ja_v1
  • ja_v1.utf_8
  • ko
  • ko.utf_8
  • nl
  • nl.utf_8
  • no
  • no.utf_8
  • pl
  • pl.utf_8
  • pt
  • pt.utf_8
  • ro
  • ro.utf_8
  • ru
  • ru.utf_8
  • sk
  • sk.utf_8
  • sl
  • sl.utf_8
  • sv
  • sv.utf_8
  • tr
  • tr.utf_8
  • utf8mb4
  • zh
  • zh.gbk
  • zh.gbk.utf_8
  • zh.utf_8
  • zh_tw
  • zh_tw.big5
  • zh_tw.big5.utf_8
  • zh_tw.utf_8

The links field of the volume.

metric GET

The metric field of the volume.

movement GET POST PATCH

The movement field of the volume.

name GET POST PATCH

Volume name. The name of volume must start with an alphabetic character (a to z or A to Z) or an underscore (_). The name must be 197 or fewer characters in length for FlexGroups, and 203 or fewer characters in length for all other types of volumes. Volume names must be unique within an SVM. Required on POST.

Example: vol_cs_dept

nas GET POST PATCH

The nas field of the volume.

qos GET POST PATCH

The qos field of the volume.

queue_for_encryption GET PATCH

Specifies whether the volume is queued for encryption.

quota GET POST PATCH

The quota field of the volume.

size GET POST PATCH

Physical size of the volume, in bytes. The minimum size for a FlexVol volume is 20MB and the minimum size for a FlexGroup volume is 200MB per constituent. The recommended size for a FlexGroup volume is a minimum of 100GB per constituent. For all volumes, the default size is equal to the minimum size.

snaplock GET POST PATCH

The snaplock field of the volume.

snapmirror GET POST PATCH

The snapmirror field of the volume.

snapshot_policy GET POST PATCH

The snapshot_policy field of the volume.

space GET POST PATCH

The space field of the volume.

state GET POST PATCH

Volume state. A volume can only be brought online if it is offline. Taking a volume offline removes its junction path. The 'mixed' state applies to FlexGroup volumes only and cannot be specified as a target state. An 'error' state implies that the volume is not in a state to serve data.

Valid choices:

  • error
  • mixed
  • offline
  • online
statistics GET

The statistics field of the volume.

status GET

Describes the current status of a volume.

style GET POST

The style of the volume. If "style" is not specified, the volume type is determined based on the specified aggregates. Specifying a single aggregate, without "constituents_per_aggregate", creates a flexible volume. Specifying multiple aggregates, or a single aggregate with "constituents_per_aggregate", creates a FlexGroup. Specifying a volume "style" creates a volume of that type. For example, if the style is "flexvol" you must specify a single aggregate. If the style is "flexgroup", the system either uses the specified aggregates or automatically provisions aggregates if there are no specified aggregates.
flexvol ‐ flexible volumes and FlexClone volumes
flexgroup ‐ FlexGroups.

Valid choices:

  • flexvol
  • flexgroup
svm GET POST PATCH

The svm field of the volume.

tiering GET POST PATCH

The tiering field of the volume.

type GET POST

Type of the volume.
rw ‐ read-write volume.
dp ‐ data-protection volume.
ls ‐ load-sharing dp volume. Valid in GET.

Valid choices:

  • rw
  • dp
  • ls
use_mirrored_aggregates POST

Specifies whether mirrored aggregates are selected when provisioning a FlexGroup without specifying "aggregates.name" or "aggregates.uuid". Only mirrored aggregates are used if this parameter is set to 'true' and only unmirrored aggregates are used if this parameter is set to 'false'. Aggregate level mirroring for a FlexGroup can be changed by moving all of the constituents to the required aggregates. The default value is 'true' for a MetroCluster configuration and is 'false' for a non-MetroCluster configuration.

uuid GET

Unique identifier for the volume. This corresponds to the instance-uuid that is exposed in the CLI and ONTAPI. It does not change due to a volume move.

Example: 028baa66-41bd-11e9-81d5-00a0986138f7