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

# Module `netapp_ontap.resources.flexcache`

Copyright © 2026 NetApp Inc. All rights reserved.

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

## Overview

FlexCache is a persistent cache of an origin volume. An origin volume can only be a FlexVol while a FlexCache is always a FlexGroup. The following relationship configurations are supported:

- Intra-Vserver where FlexCache and the corresponding origin volume reside in the same Vserver.
- Cross-Vserver but intra-cluster where FlexCache and the origin volume reside in the same cluster but belong to different Vservers.
- Cross-cluster where FlexCache and the origin volume reside in different clusters. FlexCache supports fan-out and more than one FlexCache can be created from one origin volume. This API retrieves and manages FlexCache configurations in the cache cluster.

## FlexCache APIs

The following APIs can be used to perform operations related with FlexCache:

- GET /api/storage/flexcache/flexcaches
- GET /api/storage/flexcache/flexcaches/{uuid}
- POST /api/storage/flexcache/flexcaches
- DELETE /api/storage/flexcache/flexcaches/{uuid}

## Examples

### Creating a FlexCache

The POST request is used to create a FlexCache.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache()
        resource.aggregates = [{"name": "aggr_1"}]
        resource.name = "fc_333"
        resource.origins = [{"svm": {"name": "vs_3"}, "volume": {"name": "vol_o1"}}]
        resource.svm = {"name": "vs_1"}
        resource.post(hydrate=True)
        print(resource)

Try it out

    Flexcache(
        {
            "origins": [{"volume": {"name": "vol_o1"}, "svm": {"name": "vs_3"}}],
            "name": "fc_333",
            "aggregates": [{"name": "aggr_1"}],
            "svm": {"name": "vs_1"},
        }
    )

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache()
        resource.aggregates = [{"name": "aggr_1"}]
        resource.name = "fc_333"
        resource.origins = [{"svm": {"name": "vs_3"}, "volume": {"name": "vol_o1"}}]
        resource.svm = {"name": "vs_1"}
        resource.path = "/fc_333"
        resource.prepopulate = {"dir_paths": ["/dir1"]}
        resource.post(hydrate=True)
        print(resource)

Try it out

    Flexcache(
        {
            "origins": [{"volume": {"name": "vol_o1"}, "svm": {"name": "vs_3"}}],
            "name": "fc_333",
            "aggregates": [{"name": "aggr_1"}],
            "path": "/fc_333",
            "prepopulate": {"dir_paths": ["/dir1"]},
            "svm": {"name": "vs_1"},
        }
    )

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache()
        resource.aggregates = [{"name": "aggr_1"}]
        resource.name = "fc_333"
        resource.origins = [{"svm": {"name": "vs_3"}, "volume": {"name": "vol_o1"}}]
        resource.svm = {"name": "vs_1"}
        resource.path = "/       fc_333"
        resource.prepopulate = {
            "dir_paths": ["/dir1"],
            "exclude_dir_paths": ["/dir1/dir11"],
        }
        resource.post(hydrate=True)
        print(resource)

Try it out

    Flexcache(
        {
            "origins": [{"volume": {"name": "vol_o1"}, "svm": {"name": "vs_3"}}],
            "name": "fc_333",
            "aggregates": [{"name": "aggr_1"}],
            "path": "/       fc_333",
            "prepopulate": {"dir_paths": ["/dir1"], "exclude_dir_paths": ["/dir1/dir11"]},
            "svm": {"name": "vs_1"},
        }
    )

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache()
        resource.aggregates = [{"name": "aggr_1"}]
        resource.name = "fc_333"
        resource.origins = [{"svm": {"name": "vs_3"}, "volume": {"name": "vol_o1"}}]
        resource.svm = {"name": "vs_1"}
        resource.dr_cache = True
        resource.path = "/fc_333"
        resource.prepopulate = {"dir_paths": ["/dir1"]}
        resource.post(hydrate=True)
        print(resource)

Try it out

    Flexcache(
        {
            "origins": [{"volume": {"name": "vol_o1"}, "svm": {"name": "vs_3"}}],
            "name": "fc_333",
            "aggregates": [{"name": "aggr_1"}],
            "path": "/fc_333",
            "dr_cache": True,
            "prepopulate": {"dir_paths": ["/dir1"]},
            "svm": {"name": "vs_1"},
        }
    )

### Retrieving FlexCache attributes

The GET request is used to retrieve FlexCache attributes. The object includes a large set of fields which can be expensive to retrieve. Most notably, the fields size, guarantee.type, aggregates, path, origins.ip_address, origins.size, and origins.state are expensive to retrieve. The recommended method to use this API is to filter and retrieve only the required fields.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

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

Try it out

    [
        Flexcache(
            {
                "name": "fc_322",
                "_links": {
                    "self": {
                        "href": "/api/storage/flexcache/flexcaches/04d5e07b-0ebe-11e9-8180-0050568e0b79"
                    }
                },
                "uuid": "04d5e07b-0ebe-11e9-8180-0050568e0b79",
            }
        ),
        Flexcache(
            {
                "name": "fc_321",
                "_links": {
                    "self": {
                        "href": "/api/storage/flexcache/flexcaches/47902654-0ea4-11e9-8180-0050568e0b79"
                    }
                },
                "uuid": "47902654-0ea4-11e9-8180-0050568e0b79",
            }
        ),
        Flexcache(
            {
                "name": "fc_323",
                "_links": {
                    "self": {
                        "href": "/api/storage/flexcache/flexcaches/77e911ff-0ebe-11e9-8180-0050568e0b79"
                    }
                },
                "uuid": "77e911ff-0ebe-11e9-8180-0050568e0b79",
            }
        ),
        Flexcache(
            {
                "name": "fc_32",
                "_links": {
                    "self": {
                        "href": "/api/storage/flexcache/flexcaches/ddb42bbc-0e95-11e9-8180-0050568e0b79"
                    }
                },
                "uuid": "ddb42bbc-0e95-11e9-8180-0050568e0b79",
            }
        ),
        Flexcache(
            {
                "name": "fc_333",
                "_links": {
                    "self": {
                        "href": "/api/storage/flexcache/flexcaches/ec774932-0f3c-11e9-8b2b-0050568e0b79"
                    }
                },
                "uuid": "ec774932-0f3c-11e9-8b2b-0050568e0b79",
            }
        ),
    ]

### Retrieving the attributes of a FlexCache

The GET request is used to retrieve the attributes of a FlexCache. The object includes a large set of fields which can be expensive to retrieve. Most notably, the fields size, guarantee.type, aggregates, path, origins.ip_address, origins.size, and origins.state are expensive to retrieve. The recommended method to use this API is to filter and retrieve only the required fields.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="ec774932-0f3c-11e9-8b2b-0050568e0b79")
        resource.get()
        print(resource)

Try it out

    Flexcache(
        {
            "origins": [
                {
                    "volume": {
                        "name": "vol_o1",
                        "uuid": "2bc957dd-2617-4afb-8d2f-66ac6070d313",
                    },
                    "state": "online",
                    "cluster": {
                        "name": "node2",
                        "uuid": "50733f81-0e90-11e9-b391-0050568e4115",
                    },
                    "size": 20971520,
                    "create_time": "2019-01-03T15:19:55+05:30",
                    "ip_address": "10.140.103.175",
                    "svm": {"name": "vs_3", "uuid": "8aa2cd28-0e92-11e9-b391-0050568e4115"},
                }
            ],
            "name": "fc_333",
            "guarantee": {"type": "volume"},
            "size": 4294967296,
            "aggregates": [
                {"name": "aggr_1", "uuid": "26f34b76-88f8-4a47-b5e0-d8e901fb1114"}
            ],
            "dr_cache": True,
            "_links": {
                "self": {
                    "href": "/api/storage/flexcache/flexcaches/ec774932-0f3c-11e9-8b2b-0050568e0b79"
                }
            },
            "uuid": "ec774932-0f3c-11e9-8b2b-0050568e0b79",
            "svm": {"name": "vs_1", "uuid": "e708fbe2-0e92-11e9-8180-0050568e0b79"},
        }
    )

### Deleting a FlexCache

The DELETE request is used to delete a FlexCache.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="ec774932-0f3c-11e9-8b2b-0050568e0b79")
        resource.delete()

### Modifying a FlexCache volume

Use the PATCH request to update a FlexCache volume.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="ec774932-0f3c-11e9-8b2b-0050568e0b79")
        resource.prepopulate = {"dir_paths": ["/dir1"]}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="ec774932-0f3c-11e9-8b2b-0050568e0b79")
        resource.prepopulate = {
            "dir_paths": ["/dir1"],
            "exclude_dir_paths": ["/dir1/dir11"],
        }
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="28f9734a-2fc2-11ed-a5d5-005056bb2b7")
        resource.nfsv4 = {"enabled": True}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="28f9734a-2fc2-11ed-a5d5-005056bb2b7")
        resource.nfsv4 = {"enabled": False}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="28f9734a-2fc2-11ed-a5d5-005056bb2b7")
        resource.cifs = {"enabled": True}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="28f9734a-2fc2-11ed-a5d5-005056bb2b7")
        resource.cifs = {"enabled": False}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="28f9734a-2fc2-11ed-a5d5-005056bb2b7")
        resource.s3 = {"enabled": True}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="28f9734a-2fc2-11ed-a5d5-005056bb2b7")
        resource.s3 = {"enabled": False}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="28f9734a-2fc2-11ed-a5d5-005056bb2b7")
        resource.writeback = {"enabled": True}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="28f9734a-2fc2-11ed-a5d5-005056bb2b7")
        resource.writeback = {"enabled": False}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="885dfd0f-ac37-11ed-a2ca-005056bb5573")
        resource.relative_size = {"enabled": True, "percentage": 50}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="885dfd0f-ac37-11ed-a2ca-005056bb5573")
        resource.relative_size = {"enabled": False}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="885dfd0f-ac37-11ed-a2ca-005056bb5573")
        resource.atime_scrub = {"enabled": True, "period": 30}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="885dfd0f-ac37-11ed-a2ca-005056bb5573")
        resource.atime_scrub = {"enabled": False}
        resource.patch()

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Flexcache

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Flexcache(uuid="885dfd0f-ac37-11ed-a2ca-005056bb5573")
        resource.cifs_change_notify = {"enabled": True}
        resource.patch()

## Classes

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

  Defines the cache endpoint of FlexCache.

  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 Flexcache 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('Flexcache')] = 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 FlexCache. If a FlexCache volume is online, it is offlined before deletion.

    ### Related ONTAP commands

    - `volume flexcache delete`

    ### Learn more

    - `DOC /storage/flexcache/flexcaches`

    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 Flexcache 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 FlexCache in the cluster.

    ### 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. * `origins.ip_address` - IP address of origin. * `origins.size` - Physical size of origin. * `origins.state` - State of origin. * `size` - Physical size of FlexCache. * `guarantee.type` - Space guarantee style of FlexCache. * `aggregates.name` or `aggregates.uuid` - Name or UUID of aggregate of FlexCache volume. * `path` - Fully-qualified path of the owning SVM's namespace where the FlexCache is mounted.

    ### Related ONTAP commands

    - `volume flexcache show`

    ### Learn more

    - `DOC /storage/flexcache/flexcaches`

    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 FlexCache in the cluster.

    ### 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. * `origins.ip_address` - IP address of origin. * `origins.size` - Physical size of origin. * `origins.state` - State of origin. * `size` - Physical size of FlexCache. * `guarantee.type` - Space guarantee style of FlexCache. * `aggregates.name` or `aggregates.uuid` - Name or UUID of aggregate of FlexCache volume. * `path` - Fully-qualified path of the owning SVM's namespace where the FlexCache is mounted.

    ### Related ONTAP commands

    - `volume flexcache show`

    ### Learn more

    - `DOC /storage/flexcache/flexcaches`

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

    Prepopulates a FlexCache volume in the cluster, or modifies configuration of the FlexCache volume.

    ### Recommended optional properties

    - `uuid` - FlexCache volume UUID.
    - `prepopulate.exclude_dir_paths` - List of directory-paths to be excluded from prepopulation for the FlexCache volume.
    - `prepopulate.dir_paths` - List of directory-paths to be prepopulated for the FlexCache volume.
    - `writeback.enabled` - false. This property specifies whether writeback is enabled for the FlexCache volume.
    - `relative_size.enabled` - This property specifies whether the relative sizing is enabled for the FlexCache volume.
    - `relative_size.percentage` - This property specifies the percent size FlexCache volume should have relative to the total size of the origin volume.
    - `atime_scrub.enabled` - This property specifies whether the atime based scrub is enabled for the FlexCache volume.
    - `atime_scrub.period` - This property specifies the duration in days after which inactive files can be scrubbed from FlexCache volume.
    - `cifs_change_notify.enabled` - This property specifies whether a CIFS change notification is enabled for the FlexCache volume.
    - `nfsv4.enabled` - This property specifies whether NFSv4 is enabled for the FlexCache volume.
    - `cifs.enabled` - This property specifies whether CIFS is enabled for the FlexCache volume.
    - `s3.enabled` - This property specifies whether S3 is enabled for the FlexCache volume.

    ### Default property values

    If not specified in PATCH, the following default property value is assigned: * `prepopulate.recurse` - Default value is "true".

    ### Related ONTAP commands

    - `volume flexcache prepopulate start`
    - `volume flexcache config modify`

    ### Learn more

    - `DOC /storage/flexcache/flexcaches`

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

    Creates a FlexCache in the cluster.

    ### Required properties

    - `name` - Name of FlexCache volume.
    - `origins.volume.name` - Name of the origin volume. This volume can only be identified by its name, not by its UUID.
    - `origins.svm.name` - Name of origin Vserver.
    - `svm.name` or `svm.uuid` - Name or UUID of Vserver where FlexCache will be created.

    ### Recommended optional properties

    - `path` - Path to mount the FlexCache volume
    - `prepopulate.dir_paths` - List of directory-paths to be prepopulated for the FlexCache volume.
    - `prepopulate.exclude_dir_paths` - List of directory-paths to be excluded from prepopulation for the FlexCache volume.

    ### Default property values

    If not specified in POST, the following default property values are assigned: * `size` - 10% of origin volume size or 1GB per constituent, whichever is greater. * `guarantee.type` - none. FlexCache is thin provisioned by default. * `constituents_per_aggregate` - 4 if aggregates.name or aggregates.uuid is used. * `use_tiered_aggregate` - false if aggr-list is not used. This property is only used when auto-provisioning a FlexCache volume. * `is_disconnected_mode_off_for_locks` - false. This property specifies if the origin will honor the cache side locks when doing the lock checks in the disconnected mode. * `dr_cache` - false if FlexCache is not a DR cache. This property is used to create a DR FlexCache. * `global_file_locking_enabled` - false. This property specifies whether global file locking is enabled on the FlexCache volume. * `writeback.enabled` - false. This property specifies whether writeback is enabled for the FlexCache volume. * `relative_size.enabled` - false. This property specifies whether the relative sizing is enabled for the FlexCache volume. * `relative_size.percentage` - 10. This property specifies the percent size FlexCache volume should have relative to the total size of the origin volume. * `override_encryption` - false. If true, this property is used to create a plaintext FlexCache volume for an encrypted origin volume. * `atime_scrub.enabled` - false. This property specifies whether scrubbing of inactive files based on atime is enabled for the FlexCache volume. * `atime_scrub.period` - 30. This property specifies the atime duration in days after which the file can be scrubbed from the FlexCache volume if it stays unused beyond the duration. * `nfsv4.enabled` - false. This property specifies whether NFSv4 is enabled for the FlexCache volume. * `cifs.enabled` - false. This property specifies whether CIFS is enabled for the FlexCache volume. * `s3.enabled` - false. This property specifies whether S3 is enabled for the FlexCache volume. * `cifs_change_notify.enabled` - false. This property specifies whether a CIFS change notification is enabled for the FlexCache volume. * `constituent_count` - 1. This property specifies the number of constituents in the FlexGroup volume upon Flexcache create.

    ### Related ONTAP commands

    - `volume flexcache create`
    - `volume flexcache prepopulate start`

    ### Learn more

    - `DOC /storage/flexcache/flexcaches`

    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 FlexCache. If a FlexCache volume is online, it is offlined before deletion.

    ### Related ONTAP commands

    - `volume flexcache delete`

    ### Learn more

    - `DOC /storage/flexcache/flexcaches`

    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 attributes of the FlexCache in the cluster.

    ### Expensive properties

    There is an added computational cost to retrieving values for these properties. They are included by default in GET. The recommended method to use this API is to filter and retrieve only the required fields. See `Requesting specific fields` to learn more. * `origins.ip_address` - IP address of origin. * `origins.size` - Physical size of origin. * `origins.state` - State of origin. * `size` - Physical size of FlexCache. * `guarantee.type` - Space guarantee style of FlexCache. * `aggregates.name` or `aggregates.uuid` - Name or UUID of aggregate of FlexCache volume. * `path` - Fully-qualified path of the owning SVM's namespace where the FlexCache is mounted.

    ### Related ONTAP commands

    - `volume flexcache show`

    ### Learn more

    - `DOC /storage/flexcache/flexcaches`

    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`

    Prepopulates a FlexCache volume in the cluster, or modifies configuration of the FlexCache volume.

    ### Recommended optional properties

    - `uuid` - FlexCache volume UUID.
    - `prepopulate.exclude_dir_paths` - List of directory-paths to be excluded from prepopulation for the FlexCache volume.
    - `prepopulate.dir_paths` - List of directory-paths to be prepopulated for the FlexCache volume.
    - `writeback.enabled` - false. This property specifies whether writeback is enabled for the FlexCache volume.
    - `relative_size.enabled` - This property specifies whether the relative sizing is enabled for the FlexCache volume.
    - `relative_size.percentage` - This property specifies the percent size FlexCache volume should have relative to the total size of the origin volume.
    - `atime_scrub.enabled` - This property specifies whether the atime based scrub is enabled for the FlexCache volume.
    - `atime_scrub.period` - This property specifies the duration in days after which inactive files can be scrubbed from FlexCache volume.
    - `cifs_change_notify.enabled` - This property specifies whether a CIFS change notification is enabled for the FlexCache volume.
    - `nfsv4.enabled` - This property specifies whether NFSv4 is enabled for the FlexCache volume.
    - `cifs.enabled` - This property specifies whether CIFS is enabled for the FlexCache volume.
    - `s3.enabled` - This property specifies whether S3 is enabled for the FlexCache volume.

    ### Default property values

    If not specified in PATCH, the following default property value is assigned: * `prepopulate.recurse` - Default value is "true".

    ### Related ONTAP commands

    - `volume flexcache prepopulate start`
    - `volume flexcache config modify`

    ### Learn more

    - `DOC /storage/flexcache/flexcaches`

    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 FlexCache in the cluster.

    ### Required properties

    - `name` - Name of FlexCache volume.
    - `origins.volume.name` - Name of the origin volume. This volume can only be identified by its name, not by its UUID.
    - `origins.svm.name` - Name of origin Vserver.
    - `svm.name` or `svm.uuid` - Name or UUID of Vserver where FlexCache will be created.

    ### Recommended optional properties

    - `path` - Path to mount the FlexCache volume
    - `prepopulate.dir_paths` - List of directory-paths to be prepopulated for the FlexCache volume.
    - `prepopulate.exclude_dir_paths` - List of directory-paths to be excluded from prepopulation for the FlexCache volume.

    ### Default property values

    If not specified in POST, the following default property values are assigned: * `size` - 10% of origin volume size or 1GB per constituent, whichever is greater. * `guarantee.type` - none. FlexCache is thin provisioned by default. * `constituents_per_aggregate` - 4 if aggregates.name or aggregates.uuid is used. * `use_tiered_aggregate` - false if aggr-list is not used. This property is only used when auto-provisioning a FlexCache volume. * `is_disconnected_mode_off_for_locks` - false. This property specifies if the origin will honor the cache side locks when doing the lock checks in the disconnected mode. * `dr_cache` - false if FlexCache is not a DR cache. This property is used to create a DR FlexCache. * `global_file_locking_enabled` - false. This property specifies whether global file locking is enabled on the FlexCache volume. * `writeback.enabled` - false. This property specifies whether writeback is enabled for the FlexCache volume. * `relative_size.enabled` - false. This property specifies whether the relative sizing is enabled for the FlexCache volume. * `relative_size.percentage` - 10. This property specifies the percent size FlexCache volume should have relative to the total size of the origin volume. * `override_encryption` - false. If true, this property is used to create a plaintext FlexCache volume for an encrypted origin volume. * `atime_scrub.enabled` - false. This property specifies whether scrubbing of inactive files based on atime is enabled for the FlexCache volume. * `atime_scrub.period` - 30. This property specifies the atime duration in days after which the file can be scrubbed from the FlexCache volume if it stays unused beyond the duration. * `nfsv4.enabled` - false. This property specifies whether NFSv4 is enabled for the FlexCache volume. * `cifs.enabled` - false. This property specifies whether CIFS is enabled for the FlexCache volume. * `s3.enabled` - false. This property specifies whether S3 is enabled for the FlexCache volume. * `cifs_change_notify.enabled` - false. This property specifies whether a CIFS change notification is enabled for the FlexCache volume. * `constituent_count` - 1. This property specifies the number of constituents in the FlexGroup volume upon Flexcache create.

    ### Related ONTAP commands

    - `volume flexcache create`
    - `volume flexcache prepopulate start`

    ### Learn more

    - `DOC /storage/flexcache/flexcaches`

    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 FlexcacheSchema (*, 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 Flexcache object

  ### Ancestors

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

  ### Class variables

  `aggregates: List[DiskAggregates] GET POST`

    Aggregate

  `atime_scrub: FlexcacheAtimeScrub GET POST PATCH`

    The atime_scrub field of the flexcache.

  `cifs: FlexcacheCifs GET POST PATCH`

    The cifs field of the flexcache.

  `cifs_change_notify: FlexcacheCifsChangeNotify GET POST PATCH`

    The cifs_change_notify field of the flexcache.

  `constituent_count: Size GET POST`

    Specifies the number of constituents in the FlexGroup volume upon FlexCache create (POST).

    Example: 8

  `constituents_per_aggregate: Size GET POST`

    Number of FlexCache constituents per aggregate when the 'aggregates' field is mentioned.

    Example: 1

  `dr_cache: bool GET POST`

    If set to true, a DR cache is created.

  `global_file_locking_enabled: bool GET POST`

    Specifies whether or not a FlexCache volume has global file locking mode enabled. Global file locking mode is a mode where protocol read locking semantics are enforced across all FlexCaches and origins of a FlexCache volume. When global file locking mode is enabled, the "is_disconnected_mode_off_for_locks" flag is always set to "true".

  `guarantee: FlexcacheGuarantee GET POST`

    The guarantee field of the flexcache.

  `links: SelfLink GET`

    The links field of the flexcache.

  `name: str GET POST`

    FlexCache name

    Example: vol1

  `nfsv4: FlexcacheNfsv4 GET POST PATCH`

    The nfsv4 field of the flexcache.

  `origins: List[FlexcacheRelationship] GET POST`

    The origins field of the flexcache.

  `override_encryption: bool GET POST`

    If set to true, a plaintext FlexCache volume for an encrypted origin volume is created.

  `path: str GET POST`

    The fully-qualified path in the owning SVM's namespace at which the FlexCache is mounted. The path is case insensitive and must be unique within a SVM's namespace. Path must begin with '/' and must not end with '/'. Only one FlexCache be mounted at any given junction path.

    Example: /user/my_fc

  `prepopulate: FlexcachePrepopulate POST PATCH`

    The prepopulate field of the flexcache.

  `relative_size: FlexcacheRelativeSize GET POST PATCH`

    The relative_size field of the flexcache.

  `s3: FlexcacheS3 GET POST PATCH`

    The s3 field of the flexcache.

  `size: Size GET POST`

    Physical size of the FlexCache. The recommended size for a FlexCache is 10% of the origin volume. The minimum FlexCache constituent size is 1GB.

  `svm: Svm GET POST`

    The svm field of the flexcache.

  `use_tiered_aggregate: bool GET POST`

    Specifies whether or not a Fabricpool-enabled aggregate can be used in FlexCache creation. The use_tiered_aggregate is only used when auto-provisioning a FlexCache volume.

  `uuid: str GET`

    FlexCache UUID. Unique identifier for the FlexCache.

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

  `writeback: FlexcacheWriteback GET POST PATCH`

    The writeback field of the flexcache.