Resource URL: /platform/<<version=4>>/event/alert-conditions

    Overview: This resource applies the standard collection pattern to alert
              conditions.

     Methods: GET, POST, DELETE

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

Method GET: List all alert conditions.

       URL: GET /platform/<<version=4>>/event/alert-conditions

Query arguments:
    sort=<string> The field that will be used for sorting.
channels=<string> Return only conditions for the specified channel:
  limit=<integer> Return no more than this many results at once (see resume).
       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": {
        "alert-conditions": {
          "minItems": 0, 
          "items": {
            "type": "object", 
            "description": "Specifies under what conditions and over which channel an alert should be sent", 
            "properties": {
              "name": {
                "type": "string", 
                "description": "Unique identifier."
              }, 
              "interval": {
                "minimum": 0, 
                "type": "integer", 
                "description": "Required with ONGOING condition only, period in seconds between alerts of ongoing conditions"
              }, 
              "eventgroup_ids": {
                "uniqueItems": true, 
                "items": {
                  "type": "string"
                }, 
                "type": "array", 
                "description": "Event Group IDs to be alerted"
              }, 
              "severities": {
                "uniqueItems": true, 
                "items": {
                  "enum": [
                    "emergency", 
                    "critical", 
                    "warning", 
                    "information"
                  ], 
                  "type": "string"
                }, 
                "type": "array", 
                "description": "Severities to be alerted"
              }, 
              "channels": {
                "items": {
                  "type": "string"
                }, 
                "minimum": 0, 
                "type": "array", 
                "description": "Channels for alert"
              }, 
              "transient": {
                "minimum": 0, 
                "type": "integer", 
                "description": "Any eventgroup lasting less than this many seconds is deemed transient and will not generate alerts under this condition."
              }, 
              "limit": {
                "minimum": 0, 
                "type": "integer", 
                "description": "Required with NEW EVENTS condition only, limits the number of alerts sent as events are added"
              }, 
              "categories": {
                "uniqueItems": true, 
                "items": {
                  "ignore_case": "true", 
                  "enum": [
                    "all", 
                    "SYS_DISK_EVENTS", 
                    "100000000", 
                    "NODE_STATUS_EVENTS", 
                    "200000000", 
                    "REBOOT_EVENTS", 
                    "300000000", 
                    "SW_EVENTS", 
                    "400000000", 
                    "QUOTA_EVENTS", 
                    "500000000", 
                    "SNAP_EVENTS", 
                    "600000000", 
                    "WINNET_EVENTS", 
                    "700000000", 
                    "FILESYS_EVENTS", 
                    "800000000", 
                    "HW_EVENTS", 
                    "900000000", 
                    "CPOOL_EVENTS", 
                    "1100000000"
                  ], 
                  "type": "string"
                }, 
                "type": "array", 
                "description": "Event Group categories to be alerted: all, 100000000 (SYS_DISK_EVENTS), 200000000 (NODE_STATUS_EVENTS), 300000000 (REBOOT_EVENTS), 400000000 (SW_EVENTS), 500000000 (QUOTA_EVENTS), 600000000 (SNAP_EVENTS), 700000000 (WINNET_EVENTS), 800000000 (FILESYS_EVENTS), 900000000 (HW_EVENTS), 1100000000 (CPOOL_EVENTS)"
              }, 
              "id": {
                "type": "string", 
                "description": "Unique identifier."
              }, 
              "condition": {
                "ignore_case": "true", 
                "enum": [
                  "NEW", 
                  "NEW EVENTS", 
                  "ONGOING", 
                  "SEVERITY INCREASE", 
                  "SEVERITY DECREASE", 
                  "RESOLVED"
                ], 
                "type": "string", 
                "description": "Trigger condition for alert"
              }
            }
          }, 
          "type": "array", 
          "maxItems": 4294967295
        }, 
        "total": {
          "minimum": 0, 
          "type": "integer", 
          "description": "Total number of items available.", 
          "maximum": 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 alert condition.

        URL: POST /platform/<<version=4>>/event/alert-conditions

There are no query arguments for this method.

Required POST request body fields:
name, channels, condition

POST request body schema:
{
  "type": "object", 
  "description": "Specifies under what conditions and over which channel an alert should be sent", 
  "properties": {
    "name": {
      "required": true, 
      "type": "string", 
      "description": "Unique identifier."
    }, 
    "interval": {
      "minimum": 0, 
      "type": "integer", 
      "description": "Required with ONGOING condition only, period in seconds between alerts of ongoing conditions"
    }, 
    "eventgroup_ids": {
      "uniqueItems": true, 
      "items": {
        "type": "string"
      }, 
      "type": "array", 
      "description": "Event Group IDs to be alerted"
    }, 
    "severities": {
      "uniqueItems": true, 
      "items": {
        "enum": [
          "emergency", 
          "critical", 
          "warning", 
          "information"
        ], 
        "type": "string"
      }, 
      "type": "array", 
      "description": "Severities to be alerted"
    }, 
    "channels": {
      "items": {
        "type": "string"
      }, 
      "minimum": 0, 
      "type": "array", 
      "description": "Channels for alert", 
      "required": true
    }, 
    "transient": {
      "minimum": 0, 
      "type": "integer", 
      "description": "Any eventgroup lasting less than this many seconds is deemed transient and will not generate alerts under this condition."
    }, 
    "limit": {
      "minimum": 0, 
      "type": "integer", 
      "description": "Required with NEW EVENTS condition only, limits the number of alerts sent as events are added"
    }, 
    "categories": {
      "uniqueItems": true, 
      "items": {
        "ignore_case": "true", 
        "enum": [
          "all", 
          "SYS_DISK_EVENTS", 
          "100000000", 
          "NODE_STATUS_EVENTS", 
          "200000000", 
          "REBOOT_EVENTS", 
          "300000000", 
          "SW_EVENTS", 
          "400000000", 
          "QUOTA_EVENTS", 
          "500000000", 
          "SNAP_EVENTS", 
          "600000000", 
          "WINNET_EVENTS", 
          "700000000", 
          "FILESYS_EVENTS", 
          "800000000", 
          "HW_EVENTS", 
          "900000000", 
          "CPOOL_EVENTS", 
          "1100000000"
        ], 
        "type": "string"
      }, 
      "type": "array", 
      "description": "Event Group categories to be alerted: all, 100000000 (SYS_DISK_EVENTS), 200000000 (NODE_STATUS_EVENTS), 300000000 (REBOOT_EVENTS), 400000000 (SW_EVENTS), 500000000 (QUOTA_EVENTS), 600000000 (SNAP_EVENTS), 700000000 (WINNET_EVENTS), 800000000 (FILESYS_EVENTS), 900000000 (HW_EVENTS), 1100000000 (CPOOL_EVENTS)"
    }, 
    "id": {
      "type": "string", 
      "description": "Unique identifier."
    }, 
    "condition": {
      "ignore_case": "true", 
      "enum": [
        "NEW", 
        "NEW EVENTS", 
        "ONGOING", 
        "SEVERITY INCREASE", 
        "SEVERITY DECREASE", 
        "RESOLVED"
      ], 
      "type": "string", 
      "description": "Trigger condition for alert", 
      "required": true
    }
  }
}

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: Bulk delete of alert conditions.

          URL: DELETE /platform/<<version=4>>/event/alert-conditions

Query arguments:
channel=<string> Delete only conditions for this channel

There is no JSON response body for this method.
