Resource URL: /platform/<<version=1>>/quota/quotas

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

     Methods: GET, POST, DELETE

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

Method GET: List all or matching quotas. Can also be used to retrieve quota
            state from existing reports. For any query argument not supplied,
            the default behavior is return all.

       URL: GET /platform/<<version=1>>/quota/quotas

Query arguments:
             enforced=<boolean> Only list quotas with this enforcement
                                (non-accounting).
               persona=<string> Only list user or group quotas matching this
                                persona (must be used with the corresponding
                                type argument).  Format is
                                <PERSONA_TYPE>:<string/integer>, where
                                PERSONA_TYPE is one of USER, GROUP, SID, ID, or
                                GID.
                  zone=<string> Optional named zone to use for user and group
                                resolution.
                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).
recurse_path_children=<boolean> If used with the path argument, match all
                                quotas at that path or any descendent
                                sub-directory.
        resolve_names=<boolean> If true, resolve group and user names in
                                personas.
 recurse_path_parents=<boolean> If used with the path argument, match all
                                quotas at that path or any parent directory.
    include_snapshots=<boolean> Only list quotas with this setting for
                                include_snapshots.
                limit=<integer> Return no more than this many results at once
                                (see resume).
             exceeded=<boolean> Set to true to only list quotas which have
                                exceeded one or more of their thresholds.
                  path=<string> Only list quotas matching this path (see also
                                recurse_path_*).
                    type=<enum> Where <enum> is one of directory, user, group,
                                default-user, default-group.  Only list quotas
                                matching this type.
             report_id=<string> Use the named report as a source rather than
                                the live quotas. See the /q/quota/reports
                                resource for a list of valid reports.

GET response body schema:
{
  "type": "object", 
  "properties": {
    "quotas": {
      "items": {
        "type": "object", 
        "properties": {
          "enforced": {
            "required": true, 
            "type": "boolean", 
            "description": "True if the quota provides enforcement, otherwise a accounting quota."
          }, 
          "include_snapshots": {
            "required": true, 
            "type": "boolean", 
            "description": "If true, quota governs snapshot data as well as head data."
          }, 
          "container": {
            "required": true, 
            "type": "boolean", 
            "description": "If true, SMB shares using the quota directory see the quota thresholds as share size."
          }, 
          "usage": {
            "required": true, 
            "type": "object", 
            "properties": {
              "logical": {
                "required": true, 
                "type": "integer", 
                "description": "Apparent bytes used by governed data."
              }, 
              "inodes": {
                "required": true, 
                "type": "integer", 
                "description": "Number of inodes (filesystem entities) used by governed data."
              }, 
              "physical": {
                "required": true, 
                "type": "integer", 
                "description": "Bytes used for governed data and filesystem overhead."
              }
            }
          }, 
          "thresholds": {
            "required": true, 
            "type": "object", 
            "properties": {
              "advisory": {
                "minimum": 1, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "Usage bytes at which notifications will be sent but writes will not be denied.", 
                "required": true
              }, 
              "soft_last_exceeded": {
                "required": true, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "Time at which soft threshold was hit"
              }, 
              "hard_last_exceeded": {
                "required": true, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "Time at which hard threshold was hit."
              }, 
              "soft_exceeded": {
                "required": true, 
                "type": [
                  "boolean", 
                  "null"
                ], 
                "description": "True if the soft threshold has been hit."
              }, 
              "hard_exceeded": {
                "required": true, 
                "type": [
                  "boolean", 
                  "null"
                ], 
                "description": "True if the hard threshold has been hit."
              }, 
              "hard": {
                "minimum": 1, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "Usage bytes at which further writes will be denied.", 
                "required": true
              }, 
              "advisory_last_exceeded": {
                "required": true, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "Time at which advisory threshold was hit."
              }, 
              "advisory_exceeded": {
                "required": true, 
                "type": [
                  "boolean", 
                  "null"
                ], 
                "description": "True if the advisory threshold has been hit."
              }, 
              "soft_grace": {
                "minimum": 1, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "Time in seconds after which the soft threshold has been hit before writes will be denied.", 
                "required": true
              }, 
              "soft": {
                "minimum": 1, 
                "type": [
                  "integer", 
                  "null"
                ], 
                "description": "Usage bytes at which notifications will be sent and soft grace time will be started.", 
                "required": true
              }
            }
          }, 
          "linked": {
            "required": true, 
            "type": [
              "boolean", 
              "null"
            ], 
            "description": "For user and group quotas, true if the quota is linked and controlled by a parent default-* quota. Linked quotas cannot be modified until they are unlinked."
          }, 
          "notifications": {
            "enum": [
              "custom", 
              "default", 
              "disabled"
            ], 
            "type": "string", 
            "description": "Summary of notifications: 'custom' indicates one or more notification rules available from the notifications sub-resource; 'default' indicates system default rules are used; 'disabled' indicates that no notifications will be used for this quota.", 
            "required": true
          }, 
          "persona": {
            "required": true, 
            "type": [
              {
                "type": "object", 
                "description": "Specifies properties for a persona, which consists of either a 'type' and a 'name' or an 'ID'.", 
                "properties": {
                  "type": {
                    "enum": [
                      "user", 
                      "group", 
                      "wellknown"
                    ], 
                    "type": "string", 
                    "description": "Specifies the type of persona, which must be combined with a name."
                  }, 
                  "id": {
                    "type": "string", 
                    "description": "Specifies the serialized form of a persona, which can be 'UID:0', 'USER:name', 'GID:0', 'GROUP:wheel', or 'SID:S-1-1'."
                  }, 
                  "name": {
                    "type": "string", 
                    "description": "Specifies the persona name, which must be combined with a type."
                  }
                }
              }, 
              {
                "type": "null"
              }
            ]
          }, 
          "thresholds_include_overhead": {
            "required": true, 
            "type": "boolean", 
            "description": "If true, thresholds apply to data plus filesystem overhead required to store the data (i.e. 'physical' usage)."
          }, 
          "ready": {
            "required": true, 
            "type": "boolean", 
            "description": "True if the accounting is accurate on the quota.  If false, this quota is waiting on completion of a QuotaScan job."
          }, 
          "path": {
            "required": true, 
            "type": "string", 
            "description": "The /ifs path governed."
          }, 
          "type": {
            "enum": [
              "directory", 
              "user", 
              "group", 
              "default-user", 
              "default-group"
            ], 
            "type": "string", 
            "description": "The type of quota.", 
            "required": true
          }, 
          "id": {
            "required": true, 
            "type": "string", 
            "description": "The system ID given to the quota."
          }
        }
      }, 
      "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 quota.

        URL: POST /platform/<<version=1>>/quota/quotas

Query arguments:
zone=<string> Optional named zone to use for user and group resolution.

Required POST request body fields:
enforced, include_snapshots, thresholds_include_overhead, path, type

POST request body schema:
{
  "type": "object", 
  "properties": {
    "enforced": {
      "required": true, 
      "type": "boolean", 
      "description": "True if the quota provides enforcement, otherwise a accounting quota."
    }, 
    "include_snapshots": {
      "required": true, 
      "type": "boolean", 
      "description": "If true, quota governs snapshot data as well as head data."
    }, 
    "force": {
      "required": false, 
      "type": "boolean", 
      "description": "Force creation of quotas on the root of /ifs."
    }, 
    "thresholds": {
      "type": "object", 
      "properties": {
        "advisory": {
          "minimum": 1, 
          "type": [
            "integer", 
            "null"
          ], 
          "description": "Usage bytes at which notifications will be sent but writes will not be denied."
        }, 
        "soft_grace": {
          "minimum": 1, 
          "type": [
            "integer", 
            "null"
          ], 
          "description": "Time in seconds after which the soft threshold has been hit before writes will be denied."
        }, 
        "hard": {
          "minimum": 1, 
          "type": [
            "integer", 
            "null"
          ], 
          "description": "Usage bytes at which further writes will be denied."
        }, 
        "soft": {
          "minimum": 1, 
          "type": [
            "integer", 
            "null"
          ], 
          "description": "Usage bytes at which notifications will be sent and soft grace time will be started."
        }
      }
    }, 
    "thresholds_include_overhead": {
      "required": true, 
      "type": "boolean", 
      "description": "If true, thresholds apply to data plus filesystem overhead required to store the data (i.e. 'physical' usage)."
    }, 
    "persona": {
      "type": [
        {
          "type": "object", 
          "description": "Specifies properties for a persona, which consists of either a 'type' and a 'name' or an 'ID'.", 
          "properties": {
            "type": {
              "enum": [
                "user", 
                "group", 
                "wellknown"
              ], 
              "type": "string", 
              "description": "Specifies the type of persona, which must be combined with a name."
            }, 
            "id": {
              "type": "string", 
              "description": "Specifies the serialized form of a persona, which can be 'UID:0', 'USER:name', 'GID:0', 'GROUP:wheel', or 'SID:S-1-1'."
            }, 
            "name": {
              "type": "string", 
              "description": "Specifies the persona name, which must be combined with a type."
            }
          }
        }, 
        {
          "type": "null"
        }
      ]
    }, 
    "path": {
      "required": true, 
      "type": "string", 
      "description": "The /ifs path governed."
    }, 
    "container": {
      "type": "boolean", 
      "description": "If true, SMB shares using the quota directory see the quota thresholds as share size."
    }, 
    "type": {
      "enum": [
        "directory", 
        "user", 
        "group", 
        "default-user", 
        "default-group"
      ], 
      "type": "string", 
      "description": "The type of quota.", 
      "required": true
    }
  }
}

POST response body schema:
{
  "type": "object", 
  "properties": {
    "id": {
      "required": true, 
      "type": "string", 
      "description": "ID of created item that can be used to refer to item in the collection-item resource path."
    }
  }
}

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

Method DELETE: Delete all or matching quotas.

          URL: DELETE /platform/<<version=1>>/quota/quotas

Query arguments:
             enforced=<boolean> Only delete quotas with this enforcement
                                (non-accounting).
               persona=<string> Only delete user or group quotas matching this
                                persona (must be used with the corresponding
                                type argument).  Format is
                                <PERSONA_TYPE>:<string/integer>, where
                                PERSONA_TYPE is one of USER, GROUP, SID, ID, or
                                GID.
recurse_path_children=<boolean> If used with the path argument, delete all
                                quotas at that path or any descendent
                                sub-directory.
 recurse_path_parents=<boolean> If used with the path argument, delete all
                                quotas at that path or any parent directory.
    include_snapshots=<boolean> Only delete quotas with this setting for
                                include_snapshots.
                  path=<string> Only delete quotas matching this path (see also
                                recurse_path_*).
                    type=<enum> Where <enum> is one of directory, user, group,
                                default-user, default-group.  Only delete
                                quotas matching this type.

There is no response body for this method.
