HTTP Action
HTTP action makes an HTTP request.
check-failure-webhook-alert.yaml
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
  name: check-failure-webhook-alert
spec:
  description: Notify check failures via webhook
  on:
    check:
      - event: failed
        filter: check.type == 'http'
  actions:
    - name: Notify webhook about check failure
      http:
        url: https://mywebhook
        thresholdMillis: 5000
        method: POST
        body: |
          {
            "check": {
              "name": "{{.check.name}}",
              "status": "{{.check.status}}"
            }
          }
        templateBody: true
        headers:
          - name: X-Token
            value: secret123
| Field | Description | Scheme | Required | Templatable | 
|---|---|---|---|---|
connection | Connection name. e.g. connection://http/google | string | ||
url | Url to make the request to | string | ||
username | Username to authenticate with | types.EnvVar | ||
password | Password to authenticate with | types.EnvVar | ||
method | HTTP method to use (default: GET) | string | ||
ntlm | NTLM when set to true will perform authentication using NTLM v1 protocol | bool | ||
ntlmv2 | NTLM when set to true will perform authentication using NTLM v2 protocol | bool | ||
headers | Header fields to be used in the request | []types.EnvVar | ||
body | Request Body Contents | string | true | |
templateBody | When set to true the request body is templated (default: false). Read more ... | bool | 
note
Either the connection or the url is required.
Templating
The body of the HTTP request is templatable. The script template receives a environment variable that contain details about the corresponding config, check or component and the parameter(if applicable).
| Field | Description | Schema | 
|---|---|---|
config | Config passed to the playbook | ConfigItem | 
component | Component passed to the playbook | Component | 
check | Canary Check passed to the playbook | Check | 
params | User provided parameters to the playbook | map[string]string |