Resource URL: /platform/<<version=3>>/event/channels

    Overview: This resource applies the standard collection pattern to channels.

     Methods: GET, POST

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

Method GET: List all channels.

       URL: GET /platform/<<version=3>>/event/channels

Query arguments:
limit=<integer> Return no more than this many results at once (see resume).
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": "object", 
  "properties": {
    "channels": {
      "items": {
        "type": "object", 
        "description": "Named channel through which alerts can be delivered.", 
        "properties": {
          "name": {
            "type": "string", 
            "description": "Channel name,  may not contain /, max length 254."
          }, 
          "parameters": {
            "type": [
              {
                "type": "object", 
                "description": "Parameters to be used for an smtp channel", 
                "properties": {
                  "smtp_use_auth": {
                    "type": "boolean", 
                    "description": "Use SMTP authentication - optional defaulst to false."
                  }, 
                  "smtp_password": {
                    "type": "string", 
                    "description": "Password for SMTP authentication - only if smtp_use_auth true."
                  }, 
                  "smtp_port": {
                    "type": "integer", 
                    "description": "SMTP relay port - optional defaults to 25."
                  }, 
                  "smtp_host": {
                    "type": "string", 
                    "description": "SMTP relay host."
                  }, 
                  "custom_template": {
                    "type": "string", 
                    "description": "Path to custom notification template."
                  }, 
                  "batch": {
                    "enum": [
                      "NONE", 
                      "ALL", 
                      "CATEGORY", 
                      "SEVERITY"
                    ], 
                    "type": "string", 
                    "description": "Batching criterion."
                  }, 
                  "batch_period": {
                    "type": "integer", 
                    "description": "Period over which batching is to be performed."
                  }, 
                  "send_as": {
                    "type": "string", 
                    "description": "Email address to use as from."
                  }, 
                  "smtp_security": {
                    "enum": [
                      "NONE", 
                      "STARTTLS"
                    ], 
                    "type": "string", 
                    "description": "Encryption protocol to use for SMTP."
                  }, 
                  "address": {
                    "items": {
                      "type": "string"
                    }, 
                    "type": "array", 
                    "description": "Email addresses to send to."
                  }, 
                  "smtp_username": {
                    "type": "string", 
                    "description": "Username for SMTP authentication - only if smtp_use_auth true."
                  }, 
                  "subject": {
                    "type": "string", 
                    "description": "Subject for emails."
                  }
                }
              }, 
              {
                "type": "object", 
                "description": "Parameters to be used for an snmp channel", 
                "properties": {
                  "host": {
                    "type": "string", 
                    "description": "Destination for SNMP trap."
                  }, 
                  "community": {
                    "type": "string", 
                    "description": "Optional defaults to 'public'."
                  }, 
                  "use_snmp_trap": {
                    "type": "boolean", 
                    "description": "Use snmptrap instead of snmpinform."
                  }
                }
              }
            ], 
            "description": "A collection of parameters dependent on the channel type"
          }, 
          "allowed_nodes": {
            "items": {
              "type": "integer"
            }, 
            "type": "array", 
            "description": "Nodes that can be masters for this channel"
          }, 
          "enabled": {
            "type": "boolean", 
            "description": "Channel is to be used or not"
          }, 
          "system": {
            "type": "boolean", 
            "description": "Channel is a pre-defined system channel"
          }, 
          "excluded_nodes": {
            "items": {
              "type": "integer"
            }, 
            "type": "array", 
            "description": "Nodes that can be masters for this channel"
          }, 
          "type": {
            "enum": [
              "connectemc", 
              "smtp", 
              "snmp"
            ], 
            "type": "string", 
            "description": "The mechanism used by the channel"
          }, 
          "id": {
            "type": "integer", 
            "description": "Unique identifier."
          }
        }
      }, 
      "type": "array"
    }, 
    "total": {
      "type": "integer", 
      "description": "Total number of items available."
    }, 
    "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 channel.

        URL: POST /platform/<<version=3>>/event/channels

There are no query arguments for this method.

Required POST request body fields:
name, type

POST request body schema:
{
  "type": "object", 
  "description": "Named channel through which alerts can be delivered.", 
  "properties": {
    "name": {
      "required": true, 
      "type": "string", 
      "description": "Channel name,  may not contain /, max length 254."
    }, 
    "parameters": {
      "type": [
        {
          "type": "object", 
          "description": "Parameters to be used for an smtp channel", 
          "properties": {
            "smtp_use_auth": {
              "type": "boolean", 
              "description": "Use SMTP authentication - optional defaulst to false."
            }, 
            "smtp_password": {
              "type": "string", 
              "description": "Password for SMTP authentication - only if smtp_use_auth true."
            }, 
            "smtp_port": {
              "type": "integer", 
              "description": "SMTP relay port - optional defaults to 25."
            }, 
            "smtp_host": {
              "type": "string", 
              "description": "SMTP relay host."
            }, 
            "custom_template": {
              "type": "string", 
              "description": "Path to custom notification template."
            }, 
            "batch": {
              "enum": [
                "NONE", 
                "ALL", 
                "CATEGORY", 
                "SEVERITY"
              ], 
              "type": "string", 
              "description": "Batching criterion."
            }, 
            "batch_period": {
              "type": "integer", 
              "description": "Period over which batching is to be performed."
            }, 
            "send_as": {
              "type": "string", 
              "description": "Email address to use as from."
            }, 
            "smtp_security": {
              "enum": [
                "NONE", 
                "STARTTLS"
              ], 
              "type": "string", 
              "description": "Encryption protocol to use for SMTP."
            }, 
            "address": {
              "items": {
                "type": "string"
              }, 
              "type": "array", 
              "description": "Email addresses to send to."
            }, 
            "smtp_username": {
              "type": "string", 
              "description": "Username for SMTP authentication - only if smtp_use_auth true."
            }, 
            "subject": {
              "type": "string", 
              "description": "Subject for emails."
            }
          }
        }, 
        {
          "type": "object", 
          "description": "Parameters to be used for an snmp channel", 
          "properties": {
            "host": {
              "type": "string", 
              "description": "Destination for SNMP trap."
            }, 
            "community": {
              "type": "string", 
              "description": "Optional defaults to 'public'."
            }, 
            "use_snmp_trap": {
              "type": "boolean", 
              "description": "Use snmptrap instead of snmpinform."
            }
          }
        }
      ], 
      "description": "A collection of parameters dependent on the channel type"
    }, 
    "allowed_nodes": {
      "items": {
        "type": "integer"
      }, 
      "type": "array", 
      "description": "Nodes that can be masters for this channel"
    }, 
    "enabled": {
      "type": "boolean", 
      "description": "Channel is to be used or not"
    }, 
    "system": {
      "type": "boolean", 
      "description": "Channel is a pre-defined system channel"
    }, 
    "excluded_nodes": {
      "items": {
        "type": "integer"
      }, 
      "type": "array", 
      "description": "Nodes that can be masters for this channel"
    }, 
    "type": {
      "enum": [
        "connectemc", 
        "smtp", 
        "snmp"
      ], 
      "type": "string", 
      "description": "The mechanism used by the channel", 
      "required": true
    }, 
    "id": {
      "type": "integer", 
      "description": "Unique identifier."
    }
  }
}

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."
    }
  }
}
