Skip to main content
A newer release of this product is available.

Storage flexcache flexcaches endpoint overview

Contributors

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://<mgmt-ip>/api/storage/flexcache/flexcaches/ec774932-0f3c-11e9-8b2b-0050568e0b79" -H  "accept: application/json"

# The response:
{
  "job": {
    "uuid": "e17994f2-0f3e-11e9-8b2b-0050568e0b79",
    "_links": {
      "self": {
        "href": "/api/cluster/jobs/e17994f2-0f3e-11e9-8b2b-0050568e0b79"
      }
    }
  }
}