Module netapp_ontap.resources.flexcache
Copyright © 2019 NetApp Inc. All rights reserved.
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.
# The API:
/api/storage/flexcache/flexcaches
# The call:
curl -X POST "https://<mgmt-ip>/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\" } }"
# 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, aggregates, path, origins.ip_address, origins.size, origins.state are expensive to retrieve. The recommended method to use this API is to use filter and retrieve only the required fields.
# The API:
/api/storage/flexcache/flexcaches
# The call:
curl -X GET "https://<mgmt-ip>/api/storage/flexcache/flexcaches?" -H "accept: application/json"
# The response:
{
"records": [
{
"uuid": "04d5e07b-0ebe-11e9-8180-0050568e0b79",
"name": "fc_322",
"_links": {
"self": {
"href": "/api/storage/flexcache/flexcaches/04d5e07b-0ebe-11e9-8180-0050568e0b79"
}
}
},
{
"uuid": "47902654-0ea4-11e9-8180-0050568e0b79",
"name": "fc_321",
"_links": {
"self": {
"href": "/api/storage/flexcache/flexcaches/47902654-0ea4-11e9-8180-0050568e0b79"
}
}
},
{
"uuid": "77e911ff-0ebe-11e9-8180-0050568e0b79",
"name": "fc_323",
"_links": {
"self": {
"href": "/api/storage/flexcache/flexcaches/77e911ff-0ebe-11e9-8180-0050568e0b79"
}
}
},
{
"uuid": "ddb42bbc-0e95-11e9-8180-0050568e0b79",
"name": "fc_32",
"_links": {
"self": {
"href": "/api/storage/flexcache/flexcaches/ddb42bbc-0e95-11e9-8180-0050568e0b79"
}
}
},
{
"uuid": "ec774932-0f3c-11e9-8b2b-0050568e0b79",
"name": "fc_333",
"_links": {
"self": {
"href": "/api/storage/flexcache/flexcaches/ec774932-0f3c-11e9-8b2b-0050568e0b79"
}
}
}
],
"num_records": 5,
"_links": {
"self": {
"href": "/api/storage/flexcache/flexcaches?"
}
}
}
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, aggregates, path, origins.ip_address, origins.size, origins.state are expensive to retrieve. The recommended method to use this API is to use filter and retrieve only the required fields.
# The API:
/api/storage/flexcache/flexcaches/{uuid}
# The call:
curl -X GET "https://<mgmt-ip>/api/storage/flexcache/flexcaches/ec774932-0f3c-11e9-8b2b-0050568e0b79" -H "accept: application/json"
# The response:
{
"uuid": "ec774932-0f3c-11e9-8b2b-0050568e0b79",
"name": "fc_333",
"svm": {
"name": "vs_1",
"uuid": "e708fbe2-0e92-11e9-8180-0050568e0b79"
},
"size": 4294967296,
"aggregates": [
{
"name": "aggr_1",
"uuid": "26f34b76-88f8-4a47-b5e0-d8e901fb1114"
}
],
"origins": [
{
"ip_address": "10.140.103.175",
"size": 20971520,
"create_time": "2019-01-03T15:19:55+05:30",
"state": "online",
"volume": {
"name": "vol_o1",
"uuid": "2bc957dd-2617-4afb-8d2f-66ac6070d313"
},
"svm": {
"name": "vs_3",
"uuid": "8aa2cd28-0e92-11e9-b391-0050568e4115"
},
"cluster": {
"name": "node2",
"uuid": "50733f81-0e90-11e9-b391-0050568e4115"
}
}
],
"_links": {
"self": {
"href": "/api/storage/flexcache/flexcaches/ec774932-0f3c-11e9-8b2b-0050568e0b79"
}
}
}
Deleting a FlexCache
The DELETE request is used to delete a FlexCache. ```
The API:
/api/storage/flexcache/flexcaches
The call:
curl -X DELETE "https://
The response:
{ "job": { "uuid": "e17994f2-0f3e-11e9-8b2b-0050568e0b79", "_links": { "self": { "href": "/api/cluster/jobs/e17994f2-0f3e-11e9-8b2b-0050568e0b79" } } } } ```
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
Static methods
def delete_collection(*args, 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
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.
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 find(*args, connection: HostConnection = None, **kwargs) -> Resource
-
Retrieves FlexCaches in the cluster.
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. SeeDOC 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. *aggregates.name
oraggregates.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
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 or 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.Raises
NetAppRestError
: If the API call did not return exactly 1 matching resource. def get_collection(*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> typing.Iterable
-
Retrieves FlexCaches in the cluster.
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. SeeDOC 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. *aggregates.name
oraggregates.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
Fetch a list of all objects of this type from the host.
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
objectsRaises
NetAppRestError
: If there is no connection available to use either passed in or on the library.
Methods
def delete(self, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = 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
Send a deletion request to the host for this object.
Args
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 cost to retrieving values for these properties. They are included by default in GET. The recommended method to use this API is to use filter and retrieve only the required fields. See
DOC 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. *aggregates.name
oraggregates.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
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 post(self, hydrate: bool = False, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse
-
Creates a FlexCache in the cluster.
Required properties
name
- Name of FlexCache volume.origins.volume.name
ororigins.volume.uuid
- Name or UUID of origin volume.origins.svm.name
- Name of origin Vserver.svm.name
orsvm.uuid
- Name or UUID of Vserver where FlexCache will be created.
Recommended optional properties
path
- Path to mount 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. *constituents_per_aggregate
- 4 if aggregates.name or aggregates.uuid is used.Related ONTAP commands
volume flexcache 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 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
Inherited members
class FlexcacheSchema (only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)
-
The fields of the Flexcache object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.schema.BaseSchema
- marshmallow.base.SchemaABC
Class variables
var aggregates
-
The aggregates field of the flexcache.
var constituents_per_aggregate
-
Number of FlexCache constituents per aggregate when the 'aggregates' field is mentioned.
var links
-
The links field of the flexcache.
var name
-
FlexCache name
Example: vol1
var opts
var origins
-
The origins field of the flexcache.
var path
-
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
var size
-
Physical size of the FlexCache. The recommended size for a FlexCache is 10% of the origin volume. The minimum FlexCache constituent size is 1GB.
var svm
-
The svm field of the flexcache.
var uuid
-
FlexCache UUID. Unique identifier for the FlexCache.
Example: 1cd8a442-86d1-11e0-ae1c-123478563412