# Module `netapp_ontap.resources.flexcache`

Copyright © 2023 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(
        {
            "name": "fc_333",
            "aggregates": [{"name": "aggr_1"}],
            "svm": {"name": "vs_1"},
            "origins": [{"svm": {"name": "vs_3"}, "volume": {"name": "vol_o1"}}],
        }
    )

curl -X POST "https:///api/storage/flexcache/flexcaches" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "aggregates": [ { "name": "aggr_1" } ], "name": "fc_333", "origins": [ { "svm": { "name": "vs_3" }, "volume": { "name": "vol_o1" } } ], "svm": { "name": "vs_1" }, "path": "/fc_333", "prepopulate": { "dir_paths": [ "/dir1" ] } }"

# The response:

{ "job": { "uuid": "e751dd5d-0f3c-11e9-8b2b-0050568e0b79", "_links": { "self": { "href": "/api/cluster/jobs/e751dd5d-0f3c-11e9-8b2b-0050568e0b79" } } } }

    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(
        {
            "name": "fc_333",
            "aggregates": [{"name": "aggr_1"}],
            "svm": {"name": "vs_1"},
            "origins": [{"svm": {"name": "vs_3"}, "volume": {"name": "vol_o1"}}],
            "path": "/       fc_333",
            "prepopulate": {"dir_paths": ["/dir1"], "exclude_dir_paths": ["/dir1/dir11"]},
        }
    )

` curl -X POST "https:///api/storage/flexcache/flexcaches" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "aggregates": [ { "name": "aggr_1" } ], "name": "fc_333", "origins": [ { "svm": { "name": "vs_3" }, "volume": { "name": "vol_o1" } } ], "svm":{ "name": "vs_1" }, "dr_cache": true, "path": "/fc_333", "prepopulate": { "dir_paths": [ "/dir1" ] } }"

# The response:

{ "job": { "uuid": "e751dd5d-0f3c-11e9-8b2b-0050568e0b79", "_links": { "self": { "href": "/api/cluster/jobs/e751dd5d-0f3c-11e9-8b2b-0050568e0b79" } } } }

    ### 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.
    ```python
    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(
            {
                "_links": {
                    "self": {
                        "href": "/api/storage/flexcache/flexcaches/04d5e07b-0ebe-11e9-8180-0050568e0b79"
                    }
                },
                "name": "fc_322",
                "uuid": "04d5e07b-0ebe-11e9-8180-0050568e0b79",
            }
        ),
        Flexcache(
            {
                "_links": {
                    "self": {
                        "href": "/api/storage/flexcache/flexcaches/47902654-0ea4-11e9-8180-0050568e0b79"
                    }
                },
                "name": "fc_321",
                "uuid": "47902654-0ea4-11e9-8180-0050568e0b79",
            }
        ),
        Flexcache(
            {
                "_links": {
                    "self": {
                        "href": "/api/storage/flexcache/flexcaches/77e911ff-0ebe-11e9-8180-0050568e0b79"
                    }
                },
                "name": "fc_323",
                "uuid": "77e911ff-0ebe-11e9-8180-0050568e0b79",
            }
        ),
        Flexcache(
            {
                "_links": {
                    "self": {
                        "href": "/api/storage/flexcache/flexcaches/ddb42bbc-0e95-11e9-8180-0050568e0b79"
                    }
                },
                "name": "fc_32",
                "uuid": "ddb42bbc-0e95-11e9-8180-0050568e0b79",
            }
        ),
        Flexcache(
            {
                "_links": {
                    "self": {
                        "href": "/api/storage/flexcache/flexcaches/ec774932-0f3c-11e9-8b2b-0050568e0b79"
                    }
                },
                "name": "fc_333",
                "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(
        {
            "_links": {
                "self": {
                    "href": "/api/storage/flexcache/flexcaches/ec774932-0f3c-11e9-8b2b-0050568e0b79"
                }
            },
            "dr_cache": True,
            "name": "fc_333",
            "aggregates": [
                {"name": "aggr_1", "uuid": "26f34b76-88f8-4a47-b5e0-d8e901fb1114"}
            ],
            "size": 4294967296,
            "guarantee": {"type": "volume"},
            "svm": {"name": "vs_1", "uuid": "e708fbe2-0e92-11e9-8180-0050568e0b79"},
            "uuid": "ec774932-0f3c-11e9-8b2b-0050568e0b79",
            "origins": [
                {
                    "create_time": "2019-01-03T15:19:55+05:30",
                    "size": 20971520,
                    "cluster": {
                        "name": "node2",
                        "uuid": "50733f81-0e90-11e9-b391-0050568e4115",
                    },
                    "svm": {"name": "vs_3", "uuid": "8aa2cd28-0e92-11e9-b391-0050568e4115"},
                    "volume": {
                        "name": "vol_o1",
                        "uuid": "2bc957dd-2617-4afb-8d2f-66ac6070d313",
                    },
                    "ip_address": "10.140.103.175",
                    "state": "online",
                }
            ],
        }
    )

### 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()

# The call

curl -X PATCH "https:///api/storage/flexcache/flexcaches/ec774932-0f3c-11e9-8b2b-0050568e0b79" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "prepopulate": { "dir_paths": [ "/dir1" ], "exclude_dir_paths": [ "/dir1/dir11" ] } }"

# The response:

{ "job": { "uuid": "b574c48c-1da7-11eb-b006-005056ac6a93", "_links": { "self": { "href": "/api/cluster/jobs/b574c48c-1da7-11eb-b006-005056ac6a93" } } } }

    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,
            "per_inode_dirty_limit": 4500,
            "transfer_limit": 160,
            "scrub_threshold": 25004,
        }
        resource.patch()

    ```
    `
    # The call
    curl -X PATCH "https://10.63.0.52/api/storage/flexcache/flexcaches/28f9734a-2fc2-11ed-a5d5-005056bb2b7" -H "accept: application/json" -H "Content-Type: application/json" -d '{ \"writeback\" : { \"enabled\": false } }'
    # The response:
    {
      "job": {
        "uuid": "17e193f3-304b-11ed-a5d5-005056bbb2b7",
        "_links": {
          "self": {
            "href": "/api/cluster/jobs/17e193f3-304b-11ed-a5d5-005056bbb2b7"
          }
        }
      }
    }

## 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 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 aggregrate 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 aggregrate 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
    `**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.

    ### Required properties

    - `uuid` - FlexCache volume UUID.
    - `prepopulate.dir_paths` - List of directory-paths to be prepopulated for the FlexCache volume.

    ### Recommended optional properties

    - `prepopulate.exclude_dir_paths` - List of directory-paths to be excluded from prepopulation 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`

    ### 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` or `origins.volume.uuid` - Name or UUID of origin volume.
    - `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 he 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. * `writeback.per_inode_dirty_limit` - 2500. This property specifies the amount of data in 4KB blocks that the system can write per inode in a FlexCache volume before a writeback is initiated for that inode. * `writeback.transfer_limit` - 200. This property specifies the maximum number of 4KB data blocks the system can transfer, at one time, from the cache to the origin. This process will keep on recurring until all the dirty blocks for the inode are transferred to the origin volume. * `writeback.scrub_threshold` - 2000000. This property specifies the threshold value in 4KB data blocks which when hit will trigger a scrub that will initiate writeback for all dirty inodes on the FlexCache volume.

    ### 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.
    `**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 aggregrate 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

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

    ### Required properties

    - `uuid` - FlexCache volume UUID.
    - `prepopulate.dir_paths` - List of directory-paths to be prepopulated for the FlexCache volume.

    ### Recommended optional properties

    - `prepopulate.exclude_dir_paths` - List of directory-paths to be excluded from prepopulation 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`

    ### 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.
    `**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` or `origins.volume.uuid` - Name or UUID of origin volume.
    - `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 he 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. * `writeback.per_inode_dirty_limit` - 2500. This property specifies the amount of data in 4KB blocks that the system can write per inode in a FlexCache volume before a writeback is initiated for that inode. * `writeback.transfer_limit` - 200. This property specifies the maximum number of 4KB data blocks the system can transfer, at one time, from the cache to the origin. This process will keep on recurring until all the dirty blocks for the inode are transferred to the origin volume. * `writeback.scrub_threshold` - 2000000. This property specifies the threshold value in 4KB data blocks which when hit will trigger a scrub that will initiate writeback for all dirty inodes on the FlexCache volume.

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

    ## Returns

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

    ## Raises

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

  ### Inherited members

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

  The fields of the Flexcache object

  ### Ancestors

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

  ### Class variables

  `aggregates: List[Aggregate] GET POST`

    The aggregates field of the flexcache.

  `constituents_per_aggregate: Size GET POST`

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

  `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

  `origins: List[FlexcacheRelationship] GET POST`

    The origins field of the flexcache.

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

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