Resource URL: /platform/<<version=3>>/upgrade/cluster/patch/patches

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

     Methods: GET, POST

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

Method GET: List all patches.

       URL: GET /platform/<<version=3>>/upgrade/cluster/patch/patches

Query arguments:
    sort=<string> The field that will be used for sorting.
  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).
  limit=<integer> Return no more than this many results at once (see resume).
location=<string> Path location of patch file.
  local=<boolean> Whether to view patches on the local node only.
       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
        }, 
        "patches": {
          "minItems": 0, 
          "items": {
            "type": "object", 
            "description": "A software patch that can be applied to OneFS.", 
            "properties": {
              "comment": {
                "type": "string", 
                "description": "A long comment about the patch."
              }, 
              "files": {
                "items": {
                  "type": "object", 
                  "properties": {
                    "path": {
                      "type": "string", 
                      "description": "The path of the file."
                    }, 
                    "md5": {
                      "type": "string", 
                      "description": "The md5 checksum of the file."
                    }
                  }
                }, 
                "type": "array", 
                "description": "The files contained in this patch."
              }, 
              "description": {
                "type": "string", 
                "description": "A short description of the patch."
              }, 
              "reboot": {
                "type": "string", 
                "description": "Describes the reboot requirements"
              }, 
              "services": {
                "items": {
                  "type": "object", 
                  "properties": {
                    "description": {
                      "type": "string", 
                      "description": "Description of the affected service"
                    }, 
                    "name": {
                      "type": "string", 
                      "description": "Name of the affected service"
                    }
                  }
                }, 
                "type": "array", 
                "description": "The services affected during the patch deployment"
              }, 
              "dependencies": {
                "items": {
                  "type": "string"
                }, 
                "type": "array", 
                "description": "Other patches that this patch depends on."
              }, 
              "status": {
                "type": "string", 
                "description": "The intallation status of this patch on the cluster."
              }, 
              "conflicts": {
                "items": {
                  "type": "string"
                }, 
                "type": "array", 
                "description": "Other patches that this patch conflicts with."
              }, 
              "nodes": {
                "items": {
                  "type": "integer"
                }, 
                "type": "array", 
                "description": "The nodes that this patch is installed on."
              }, 
              "id": {
                "type": "string", 
                "description": "A unique identifier for the patch."
              }, 
              "name": {
                "type": "string", 
                "description": "The name of the patch."
              }
            }
          }, 
          "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: Install a patch.

        URL: POST /platform/<<version=3>>/upgrade/cluster/patch/patches

Query arguments:
 rolling=<boolean> Whether to install the patch on one node at a time. Defaults
                   to true.
override=<boolean> Whether to ignore patch system validation and force the
                   installation.

Required POST request body fields:
patch

POST request body schema:
{
  "type": "object", 
  "description": "A software patch that can be applied to OneFS.", 
  "properties": {
    "location": {
      "type": "string", 
      "description": "The path location of the patch file."
    }, 
    "patch": {
      "required": true, 
      "type": "string", 
      "description": "The id or filename of the patch to install."
    }
  }
}

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
        }
      }
    }
  ]
}
