Resource URL: /platform/<<version=3>>/sync/rules

    Overview: This resource applies the standard collection pattern to OneFS
              SyncIQ performance rules.

     Methods: GET, POST, DELETE

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

Method GET: List all SyncIQ performance rules.

       URL: GET /platform/<<version=3>>/sync/rules

Query arguments:
  sort=<string> The field that will be used for sorting.
limit=<integer> Return no more than this many results at once (see resume).
    type=<enum> Where <enum> is one of bandwidth, file_count, cpu, worker.
                Filter the returned rules to include only those with this rule
                type.
     dir=<enum> Where <enum> is one of ASC, DESC.  The direction of the sort.
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).

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": {
        "rules": {
          "minItems": 0, 
          "items": {
            "type": "object", 
            "description": "A rule limiting the bandwidth, file operations, cpu usage, or worker count for all sync jobs on this cluster.", 
            "properties": {
              "description": {
                "type": "string", 
                "description": "User-entered description of this performance rule."
              }, 
              "schedule": {
                "type": [
                  "object", 
                  "null"
                ], 
                "description": "A schedule defining when during a week this performance rule is in effect.  If unspecified or null, the schedule will always be in effect.", 
                "properties": {
                  "begin": {
                    "required": false, 
                    "type": [
                      "string", 
                      "null"
                    ], 
                    "description": "Start time (inclusive) for this schedule, during its specified days.  Format is \"hh:mm\" (24h format hour, and minute).  A null value indicates the beginning of the day (\"00:00\")."
                  }, 
                  "end": {
                    "required": false, 
                    "type": [
                      "string", 
                      "null"
                    ], 
                    "description": "End time (inclusive) for this schedule, during its specified days.  Format is \"hh:mm\" (three-letter weekday name abbreviation, 24h format hour, and minute).  A null value indicates the end of the day (\"23:59\")."
                  }, 
                  "monday": {
                    "required": false, 
                    "type": "boolean", 
                    "description": "If true, this rule is in effect on Monday.  If false, or unspecified, it is not."
                  }, 
                  "tuesday": {
                    "required": false, 
                    "type": "boolean", 
                    "description": "If true, this rule is in effect on Tuesday.  If false, or unspecified, it is not."
                  }, 
                  "friday": {
                    "required": false, 
                    "type": "boolean", 
                    "description": "If true, this rule is in effect on Friday.  If false, or unspecified, it is not."
                  }, 
                  "wednesday": {
                    "required": false, 
                    "type": "boolean", 
                    "description": "If true, this rule is in effect on Wednesday.  If false, or unspecified, it is not."
                  }, 
                  "thursday": {
                    "required": false, 
                    "type": "boolean", 
                    "description": "If true, this rule is in effect on Thursday.  If false, or unspecified, it is not."
                  }, 
                  "sunday": {
                    "required": false, 
                    "type": "boolean", 
                    "description": "If true, this rule is in effect on Sunday.  If false, or unspecified, it is not."
                  }, 
                  "saturday": {
                    "required": false, 
                    "type": "boolean", 
                    "description": "If true, this rule is in effect on Saturday.  If false, or unspecified, it is not."
                  }
                }
              }, 
              "enabled": {
                "type": "boolean", 
                "description": "Whether this performance rule is currently in effect during its specified intervals."
              }, 
              "limit": {
                "type": "integer", 
                "description": "Amount the specified system resource type is limited by this rule.  Units are kb/s for bandwidth, files/s for file-count, processing percentage used for cpu, or percentage of maximum available workers."
              }, 
              "type": {
                "enum": [
                  "bandwidth", 
                  "file_count", 
                  "cpu", 
                  "worker"
                ], 
                "type": "string", 
                "description": "The type of system resource this rule limits."
              }, 
              "id": {
                "type": "string", 
                "description": "The system ID given to this performance rule."
              }
            }
          }, 
          "required": true, 
          "type": "array", 
          "maxItems": 4294967295
        }, 
        "total": {
          "required": true, 
          "minimum": 0, 
          "type": "integer", 
          "description": "Total number of items available.", 
          "maximum": 4294967295
        }, 
        "resume": {
          "minLength": 0, 
          "required": true, 
          "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 SyncIQ performance rule.

        URL: POST /platform/<<version=3>>/sync/rules

There are no query arguments for this method.

Required POST request body fields:
limit, type

POST request body schema:
{
  "type": "object", 
  "description": "A rule limiting the bandwidth, file operations, cpu usage, or worker count for all sync jobs on this cluster.", 
  "properties": {
    "limit": {
      "required": true, 
      "type": "integer", 
      "description": "Amount the specified system resource type is limited by this rule.  Units are kb/s for bandwidth, files/s for file-count, processing percentage used for cpu, or percentage of maximum available workers."
    }, 
    "type": {
      "enum": [
        "bandwidth", 
        "file_count", 
        "cpu", 
        "worker"
      ], 
      "type": "string", 
      "description": "The type of system resource this rule limits.", 
      "required": true
    }, 
    "enabled": {
      "type": "boolean", 
      "description": "Whether this performance rule is currently in effect during its specified intervals."
    }, 
    "description": {
      "type": "string", 
      "description": "User-entered description of this performance rule."
    }, 
    "schedule": {
      "type": [
        "object", 
        "null"
      ], 
      "description": "A schedule defining when during a week this performance rule is in effect.  If unspecified or null, the schedule will always be in effect.", 
      "properties": {
        "begin": {
          "required": false, 
          "type": [
            "string", 
            "null"
          ], 
          "description": "Start time (inclusive) for this schedule, during its specified days.  Format is \"hh:mm\" (24h format hour, and minute).  A null value indicates the beginning of the day (\"00:00\")."
        }, 
        "end": {
          "required": false, 
          "type": [
            "string", 
            "null"
          ], 
          "description": "End time (inclusive) for this schedule, during its specified days.  Format is \"hh:mm\" (three-letter weekday name abbreviation, 24h format hour, and minute).  A null value indicates the end of the day (\"23:59\")."
        }, 
        "monday": {
          "required": false, 
          "type": "boolean", 
          "description": "If true, this rule is in effect on Monday.  If false, or unspecified, it is not."
        }, 
        "tuesday": {
          "required": false, 
          "type": "boolean", 
          "description": "If true, this rule is in effect on Tuesday.  If false, or unspecified, it is not."
        }, 
        "friday": {
          "required": false, 
          "type": "boolean", 
          "description": "If true, this rule is in effect on Friday.  If false, or unspecified, it is not."
        }, 
        "wednesday": {
          "required": false, 
          "type": "boolean", 
          "description": "If true, this rule is in effect on Wednesday.  If false, or unspecified, it is not."
        }, 
        "thursday": {
          "required": false, 
          "type": "boolean", 
          "description": "If true, this rule is in effect on Thursday.  If false, or unspecified, it is not."
        }, 
        "sunday": {
          "required": false, 
          "type": "boolean", 
          "description": "If true, this rule is in effect on Sunday.  If false, or unspecified, it is not."
        }, 
        "saturday": {
          "required": false, 
          "type": "boolean", 
          "description": "If true, this rule is in effect on Saturday.  If false, or unspecified, it is not."
        }
      }
    }
  }
}

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": {
        "id": {
          "minLength": 0, 
          "required": true, 
          "type": "string", 
          "description": "ID of created item that can be used to refer to item in the collection-item resource path.", 
          "maxLength": 255
        }
      }
    }
  ]
}

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

Method DELETE: Delete all SyncIQ performance rules or all rules of a specified
               type.

          URL: DELETE /platform/<<version=3>>/sync/rules

Query arguments:
type=<enum> Where <enum> is one of bandwidth, file_count, cpu, worker.  Delete
            all rules of the specified rule type only.

There is no JSON response body for this method.
