Skip to main content

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
FieldDescriptionSchemeRequired
connectionConnection name. e.g. connection://http/googlestring
urlUrl to make the request tostring
usernameUsername to authenticate withtypes.EnvVar
passwordPassword to authenticate withtypes.EnvVar
methodHTTP method to use (default: GET)string
ntlmNTLM when set to true will perform authentication using NTLM v1 protocolbool
ntlmv2NTLM when set to true will perform authentication using NTLM v2 protocolbool
headersHeader fields to be used in the request[]types.EnvVar
bodyRequest Body Contentsstring
templateBodyWhen 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).

FieldDescriptionSchema
configConfig passed to the playbookConfigItem
componentComponent passed to the playbookComponent
checkCanary Check passed to the playbookCheck
paramsUser provided parameters to the playbookmap[string]string