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": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "additionalProperties": false, 
      "type": "object", 
      "properties": {
        "total": {
          "minimum": 0, 
          "type": "integer", 
          "description": "Total number of items available.", 
          "maximum": 4294967295
        }, 
        "snapshots": {
          "minItems": 0, 
          "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.", 
                "maximum": 4294967295
              }, 
              "name": {
                "minLength": 0, 
                "required": true, 
                "type": [
                  "string", 
                  "null"
                ], 
                "description": "The user or system supplied snapshot name. This will be null for snapshots pending delete."
              }, 
              "created": {
                "required": true, 
                "minimum": 0, 
                "type": "integer", 
                "description": "The Unix Epoch time the snapshot was created.", 
                "maximum": 18446744073709551615
              }, 
              "target_name": {
                "minLength": 0, 
                "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.", 
                "maximum": 4294967295
              }, 
              "target_id": {
                "required": true, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "The ID of the snapshot pointed to if this is an alias. 18446744073709551615 (max uint64) is returned for an alias to the live filesystem.", 
                "maximum": 18446744073709551615
              }, 
              "schedule": {
                "minLength": 0, 
                "required": true, 
                "type": [
                  "string", 
                  "null"
                ], 
                "description": "The name of the schedule used to create this snapshot, if applicable."
              }, 
              "alias": {
                "minLength": 0, 
                "required": false, 
                "type": [
                  "string", 
                  "null"
                ], 
                "description": "Alias name to create for this snapshot. If null, remove any alias."
              }, 
              "state": {
                "minLength": 0, 
                "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": {
                "description": "The /ifs path snapshotted.", 
                "minLength": 4, 
                "required": true, 
                "pattern": "^\\/ifs", 
                "maxLength": 1024, 
                "type": [
                  "string", 
                  "null"
                ]
              }, 
              "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.", 
                "maximum": 4294967295
              }, 
              "size": {
                "required": true, 
                "minimum": 0, 
                "type": "integer", 
                "description": "The amount of storage in bytes used to store this snapshot.", 
                "maximum": 18446744073709551615
              }
            }
          }, 
          "type": "array", 
          "maxItems": 4294967295
        }, 
        "resume": {
          "minLength": 0, 
          "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": {
      "minLength": 0, 
      "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.", 
      "maximum": 4294967295
    }, 
    "name": {
      "minLength": 0, 
      "type": [
        "string", 
        "null"
      ], 
      "description": "The user or system supplied snapshot name. This will be null for snapshots pending delete."
    }, 
    "path": {
      "description": "The /ifs path snapshotted.", 
      "minLength": 4, 
      "required": true, 
      "pattern": "^\\/ifs", 
      "maxLength": 1024, 
      "type": [
        "string", 
        "null"
      ]
    }
  }
}

POST response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "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.", 
          "maximum": 4294967295
        }, 
        "name": {
          "minLength": 0, 
          "required": true, 
          "type": [
            "string", 
            "null"
          ], 
          "description": "The user or system supplied snapshot name. This will be null for snapshots pending delete."
        }, 
        "created": {
          "required": true, 
          "minimum": 0, 
          "type": "integer", 
          "description": "The Unix Epoch time the snapshot was created.", 
          "maximum": 18446744073709551615
        }, 
        "target_name": {
          "minLength": 0, 
          "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.", 
          "maximum": 4294967295
        }, 
        "target_id": {
          "required": true, 
          "type": [
            "integer", 
            "null"
          ], 
          "description": "The ID of the snapshot pointed to if this is an alias. 18446744073709551615 (max uint64) is returned for an alias to the live filesystem.", 
          "maximum": 18446744073709551615
        }, 
        "schedule": {
          "minLength": 0, 
          "required": true, 
          "type": [
            "string", 
            "null"
          ], 
          "description": "The name of the schedule used to create this snapshot, if applicable."
        }, 
        "alias": {
          "minLength": 0, 
          "required": false, 
          "type": [
            "string", 
            "null"
          ], 
          "description": "Alias name to create for this snapshot. If null, remove any alias."
        }, 
        "state": {
          "minLength": 0, 
          "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": {
          "description": "The /ifs path snapshotted.", 
          "minLength": 4, 
          "required": true, 
          "pattern": "^\\/ifs", 
          "maxLength": 1024, 
          "type": [
            "string", 
            "null"
          ]
        }, 
        "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.", 
          "maximum": 4294967295
        }, 
        "size": {
          "required": true, 
          "minimum": 0, 
          "type": "integer", 
          "description": "The amount of storage in bytes used to store this snapshot.", 
          "maximum": 18446744073709551615
        }
      }
    }
  ]
}

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

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 JSON response body for this method.
