SQL Action
SQL action makes a SQL query on the provided database.
delete-check-statuses.yaml
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
  name: delete-check-statuses
spec:
  description: Deletes all the check statuses of a given check
  checks:
    - type: http
  actions:
    - name: Delete check statuses
      sql:
        connection: connection://Postgres/incident-commander
        database: incident_commander
        driver: postgres
        query: DELETE FROM check_statuses WHERE check_id = {{.check.id}}
| Field | Description | Scheme | Required | Templatable | 
|---|---|---|---|---|
connection | Connection identifier e.g. connection://postgres/flanksource. | string | ||
url | URL is the database connection url. | string | ||
query | Query is the sql query to run. It can also be templated. Read more ... | string | true | true | 
driver | Driver is the name of the underlying database to connect to. Example: postgres, mysql, ... | string | true | 
note
Either the connection or the url is required.
Templating
The 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 |