Resource URL: /platform/<<version=1>>/snapshot/snapshots

    Overview: This resource applies the standard collection pattern to OneFS
              snapshots.

     Methods: GET, POST, DELETE

********************************************************************************

Method GET: List all or matching snapshots.

       URL: GET /platform/<<version=1>>/snapshot/snapshots

Query arguments:
    sort=<string> The field that will be used for sorting.  Choices are id,
                  name, path, created, expires, size, has_locks, schedule,
                  alias_target, alias_target_name, pct_filesystem, pct_reserve,
                  and state.  Default is id.
  resume=<string> Continue returning results from previous call using this
                  token (token should come from the previous call, resume
                  cannot be used with other options).
schedule=<string> Only list snapshots created by this schedule.
     state=<enum> Where <enum> is one of all, active, deleting.  Only list
                  snapshots matching this state.
  limit=<integer> Return no more than this many results at once (see resume).
      type=<enum> Where <enum> is one of all, alias, real.  Only list snapshots
                  matching this type.
       dir=<enum> Where <enum> is one of ASC, DESC.  The direction of the sort.

GET response body schema:
{
  "type": "object", 
  "properties": {
    "total": {
      "type": "integer", 
      "description": "Total number of items available."
    }, 
    "snapshots": {
      "items": {
        "type": "object", 
        "properties": {
          "pct_reserve": {
            "required": true, 
            "type": "number", 
            "description": "Percentage of configured snapshot reserved used for storing this snapshot."
          }, 
          "shadow_bytes": {
            "required": true, 
            "type": "integer", 
            "description": "The amount of shadow bytes referred to by this snapshot."
          }, 
          "name": {
            "required": true, 
            "type": [
              "string", 
              "null"
            ], 
            "description": "The user or system supplied snapshot name. This will be null for snapshots pending delete."
          }, 
          "created": {
            "required": true, 
            "type": "integer", 
            "description": "The Unix Epoch time the snapshot was created."
          }, 
          "target_name": {
            "required": true, 
            "type": [
              "string", 
              "null"
            ], 
            "description": "The name of the snapshot pointed to if this is an alias."
          }, 
          "expires": {
            "required": true, 
            "type": [
              "integer", 
              "null"
            ], 
            "description": "The Unix Epoch time the snapshot will expire and be eligible for automatic deletion."
          }, 
          "target_id": {
            "required": true, 
            "type": [
              "integer", 
              "null"
            ], 
            "description": "The ID of the snapshot pointed to if this is an alias."
          }, 
          "schedule": {
            "required": true, 
            "type": [
              "string", 
              "null"
            ], 
            "description": "The name of the schedule used to create this snapshot, if applicable."
          }, 
          "alias": {
            "required": true, 
            "type": [
              "string", 
              "null"
            ], 
            "description": "Alias name to create for this snapshot. If null, remove any alias."
          }, 
          "state": {
            "enum": [
              "active", 
              "deleting"
            ], 
            "type": "string", 
            "description": "Snapshot state.", 
            "required": true
          }, 
          "has_locks": {
            "required": true, 
            "type": "boolean", 
            "description": "True if the snapshot has one or more locks present see, see the locks subresource of a snapshot for a list of locks."
          }, 
          "path": {
            "required": true, 
            "type": [
              "string", 
              "null"
            ], 
            "description": "The /ifs path snapshotted."
          }, 
          "pct_filesystem": {
            "required": true, 
            "type": "number", 
            "description": "Percentage of /ifs used for storing this snapshot."
          }, 
          "id": {
            "required": true, 
            "type": "integer", 
            "description": "The system ID given to the snapshot. This is useful for tracking the status of delete pending snapshots."
          }, 
          "size": {
            "required": true, 
            "type": "integer", 
            "description": "The amount of storage in bytes used to store this snapshot."
          }
        }
      }, 
      "type": "array"
    }, 
    "resume": {
      "type": [
        "string", 
        "null"
      ], 
      "description": "Continue returning results from previous call using this token (token should come from the previous call, resume cannot be used with other options)."
    }
  }
}

********************************************************************************

Method POST: Create a new snapshot.

        URL: POST /platform/<<version=1>>/snapshot/snapshots

There are no query arguments for this method.

Required POST request body fields:
path

POST request body schema:
{
  "type": "object", 
  "properties": {
    "alias": {
      "type": [
        "string", 
        "null"
      ], 
      "description": "Alias name to create for this snapshot. If null, remove any alias."
    }, 
    "expires": {
      "type": [
        "integer", 
        "null"
      ], 
      "description": "The Unix Epoch time the snapshot will expire and be eligible for automatic deletion."
    }, 
    "name": {
      "type": [
        "string", 
        "null"
      ], 
      "description": "The user or system supplied snapshot name. This will be null for snapshots pending delete."
    }, 
    "path": {
      "required": true, 
      "type": [
        "string", 
        "null"
      ], 
      "description": "The /ifs path snapshotted."
    }
  }
}

POST response body schema:
{
  "type": "object", 
  "properties": {
    "pct_reserve": {
      "required": true, 
      "type": "number", 
      "description": "Percentage of configured snapshot reserved used for storing this snapshot."
    }, 
    "shadow_bytes": {
      "required": true, 
      "type": "integer", 
      "description": "The amount of shadow bytes referred to by this snapshot."
    }, 
    "name": {
      "required": true, 
      "type": [
        "string", 
        "null"
      ], 
      "description": "The user or system supplied snapshot name. This will be null for snapshots pending delete."
    }, 
    "created": {
      "required": true, 
      "type": "integer", 
      "description": "The Unix Epoch time the snapshot was created."
    }, 
    "target_name": {
      "required": true, 
      "type": [
        "string", 
        "null"
      ], 
      "description": "The name of the snapshot pointed to if this is an alias."
    }, 
    "expires": {
      "required": true, 
      "type": [
        "integer", 
        "null"
      ], 
      "description": "The Unix Epoch time the snapshot will expire and be eligible for automatic deletion."
    }, 
    "target_id": {
      "required": true, 
      "type": [
        "integer", 
        "null"
      ], 
      "description": "The ID of the snapshot pointed to if this is an alias."
    }, 
    "schedule": {
      "required": true, 
      "type": [
        "string", 
        "null"
      ], 
      "description": "The name of the schedule used to create this snapshot, if applicable."
    }, 
    "alias": {
      "required": true, 
      "type": [
        "string", 
        "null"
      ], 
      "description": "Alias name to create for this snapshot. If null, remove any alias."
    }, 
    "state": {
      "enum": [
        "active", 
        "deleting"
      ], 
      "type": "string", 
      "description": "Snapshot state.", 
      "required": true
    }, 
    "has_locks": {
      "required": true, 
      "type": "boolean", 
      "description": "True if the snapshot has one or more locks present see, see the locks subresource of a snapshot for a list of locks."
    }, 
    "path": {
      "required": true, 
      "type": [
        "string", 
        "null"
      ], 
      "description": "The /ifs path snapshotted."
    }, 
    "pct_filesystem": {
      "required": true, 
      "type": "number", 
      "description": "Percentage of /ifs used for storing this snapshot."
    }, 
    "id": {
      "required": true, 
      "type": "integer", 
      "description": "The system ID given to the snapshot. This is useful for tracking the status of delete pending snapshots."
    }, 
    "size": {
      "required": true, 
      "type": "integer", 
      "description": "The amount of storage in bytes used to store this snapshot."
    }
  }
}

********************************************************************************

Method DELETE: Delete all or matching snapshots.

          URL: DELETE /platform/<<version=1>>/snapshot/snapshots

Query arguments:
      type=<enum> Where <enum> is one of all, alias, real.  Only list snapshots
                  matching this type.
schedule=<string> Only list snapshots created by this schedule.

There is no response body for this method.
