{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://github.com/flanksource/incident-commander/api/v1/playbook-spec", "$ref": "#/$defs/PlaybookSpec", "$defs": { "AIAction": { "properties": { "connection": { "type": "string", "description": "Connection to setup the llm backend connection" }, "apiKey": { "$ref": "#/$defs/EnvVar", "description": "API Key" }, "backend": { "type": "string", "description": "Optionally specify the LLM backend.\nSupported: anthropic (default), ollama, openai." }, "model": { "type": "string", "description": "Model name based on the backend chosen.\nExample: gpt-4o for openai, claude-3-5-sonnet-latest for Anthropic, llama3.1:8b for Ollama" }, "apiURL": { "type": "string", "description": "BaseURL or API url.\nExample: server URL for ollama or custom url for Anthropic if using a proxy" }, "config": { "type": "string" }, "changes": { "$ref": "#/$defs/TimeMetadata" }, "analysis": { "$ref": "#/$defs/TimeMetadata" }, "relationships": { "items": { "$ref": "#/$defs/LLMContextRequestRelationship" }, "type": "array" }, "playbooks": { "items": { "$ref": "#/$defs/LLMContextRequestPlaybook" }, "type": "array" }, "dryRun": { "type": "boolean", "description": "When enabled, the prompt is simply saved without passing it on to the LLM." }, "recommendPlaybooks": { "items": { "$ref": "#/$defs/ResourceSelector" }, "type": "array", "description": "Specify selectors for playbooks. The LLM will recommend the best suited playbooks\nin response to the prompt." }, "systemPrompt": { "type": "string", "description": "system prompt is a way to provide context, instructions, and guidelines to the LLM before presenting it\nwith a question or task.\nBy using a system prompt, you can set the stage for the conversation, specifying LLM's role, personality,\ntone, or any other relevant information that will help it better understand and respond to the user's input." }, "prompt": { "type": "string", "description": "Prompt is the human prompt" }, "formats": { "items": { "type": "string" }, "type": "array", "description": "Output format of the prompt.\nSupported: markdown (default), slack, recommendPlaybook" } }, "additionalProperties": false, "type": "object", "required": [ "systemPrompt", "prompt" ] }, "AWSConnection": { "properties": { "connection": { "type": "string" }, "accessKey": { "$ref": "#/$defs/EnvVar" }, "secretKey": { "$ref": "#/$defs/EnvVar" }, "sessionToken": { "$ref": "#/$defs/EnvVar" }, "assumeRole": { "type": "string" }, "region": { "type": "string" }, "endpoint": { "type": "string" }, "skipTLSVerify": { "type": "boolean" } }, "additionalProperties": false, "type": "object" }, "AWSSigV4": { "properties": { "connection": { "type": "string" }, "accessKey": { "$ref": "#/$defs/EnvVar" }, "secretKey": { "$ref": "#/$defs/EnvVar" }, "sessionToken": { "$ref": "#/$defs/EnvVar" }, "assumeRole": { "type": "string" }, "region": { "type": "string" }, "endpoint": { "type": "string" }, "skipTLSVerify": { "type": "boolean" }, "service": { "type": "string" } }, "additionalProperties": false, "type": "object" }, "Artifact": { "properties": { "path": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "path" ] }, "AutoMerge": { "properties": { "enabled": { "type": "boolean" }, "rebase": { "type": "boolean" } }, "additionalProperties": false, "type": "object" }, "AzureConnection": { "properties": { "connection": { "type": "string" }, "clientID": { "$ref": "#/$defs/EnvVar" }, "clientSecret": { "$ref": "#/$defs/EnvVar" }, "tenantID": { "type": "string" } }, "additionalProperties": false, "type": "object" }, "AzureDevopsPipeline": { "properties": { "id": { "type": "string", "description": "ID is the pipeline ID" }, "version": { "type": "string", "description": "Version is the pipeline version" } }, "additionalProperties": false, "type": "object", "required": [ "id" ] }, "AzureDevopsPipelineAction": { "properties": { "org": { "type": "string", "description": "Org is the name of the Azure DevOps organization" }, "project": { "type": "string", "description": "Project ID or project name" }, "token": { "$ref": "#/$defs/EnvVar", "description": "Token is the personal access token" }, "pipeline": { "$ref": "#/$defs/AzureDevopsPipeline", "description": "Pipeline is the azure pipeline to invoke" }, "parameters": { "$ref": "#/$defs/AzureDevopsPipelineParameters", "description": "Parameteres are the settings that influence the pipeline run" } }, "additionalProperties": false, "type": "object", "required": [ "org", "project", "token", "pipeline" ] }, "AzureDevopsPipelineParameters": { "properties": { "resources": { "description": "The resources the run requires." }, "templateParameters": true, "variables": true, "stagesToSkip": { "items": { "type": "string" }, "type": "array" } }, "additionalProperties": false, "type": "object", "description": "Ref: https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/run-pipeline?view=azure-devops-rest-7.1#request-body" }, "CNRMConnection": { "properties": { "gke": { "$ref": "#/$defs/GKEConnection" }, "clusterResource": { "type": "string" }, "clusterResourceNamespace": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "gke", "clusterResource", "clusterResourceNamespace" ] }, "ConfigMapKeySelector": { "properties": { "name": { "type": "string" }, "key": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "key" ] }, "EKSConnection": { "properties": { "connection": { "type": "string" }, "accessKey": { "$ref": "#/$defs/EnvVar" }, "secretKey": { "$ref": "#/$defs/EnvVar" }, "sessionToken": { "$ref": "#/$defs/EnvVar" }, "assumeRole": { "type": "string" }, "region": { "type": "string" }, "endpoint": { "type": "string" }, "skipTLSVerify": { "type": "boolean" }, "cluster": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "cluster" ] }, "EnvVar": { "properties": { "name": { "type": "string" }, "value": { "type": "string" }, "valueFrom": { "$ref": "#/$defs/EnvVarSource" } }, "additionalProperties": false, "type": "object" }, "EnvVarSource": { "properties": { "serviceAccount": { "type": "string" }, "helmRef": { "$ref": "#/$defs/HelmRefKeySelector" }, "configMapKeyRef": { "$ref": "#/$defs/ConfigMapKeySelector" }, "secretKeyRef": { "$ref": "#/$defs/SecretKeySelector" } }, "additionalProperties": false, "type": "object" }, "ExecAction": { "properties": { "script": { "type": "string", "description": "Script can be an inline script or a path to a script that needs to be executed\nOn windows executed via powershell and in darwin and linux executed using bash" }, "connections": { "$ref": "#/$defs/ExecConnections" }, "artifacts": { "items": { "$ref": "#/$defs/Artifact" }, "type": "array", "description": "Artifacts to save" }, "env": { "items": { "$ref": "#/$defs/EnvVar" }, "type": "array", "description": "EnvVars are the environment variables that are accessible to exec processes" }, "checkout": { "$ref": "#/$defs/GitConnection", "description": "Checkout details the git repository that should be mounted to the process" }, "setup": { "$ref": "#/$defs/ExecSetup", "description": "Setup binaries" } }, "additionalProperties": false, "type": "object", "required": [ "script" ] }, "ExecConnections": { "properties": { "fromConfigItem": { "type": "string" }, "eksPodIdentity": { "type": "boolean" }, "serviceAccount": { "type": "boolean" }, "kubernetes": { "$ref": "#/$defs/KubernetesConnection" }, "aws": { "$ref": "#/$defs/AWSConnection" }, "gcp": { "$ref": "#/$defs/GCPConnection" }, "azure": { "$ref": "#/$defs/AzureConnection" } }, "additionalProperties": false, "type": "object" }, "ExecSetup": { "properties": { "bun": { "$ref": "#/$defs/RuntimeSetup" }, "python": { "$ref": "#/$defs/RuntimeSetup" }, "powershell": { "$ref": "#/$defs/RuntimeSetup" } }, "additionalProperties": false, "type": "object" }, "FacetOptions": { "properties": { "connection": { "type": "string" }, "url": { "type": "string" }, "pdfOptions": { "$ref": "#/$defs/FacetPDFOptions" }, "header": { "type": "string" }, "footer": { "type": "string" }, "timestampUrl": { "type": "string" } }, "additionalProperties": false, "type": "object" }, "FacetPDFMargins": { "properties": { "top": { "type": "integer" }, "bottom": { "type": "integer" }, "left": { "type": "integer" }, "right": { "type": "integer" } }, "additionalProperties": false, "type": "object" }, "FacetPDFOptions": { "properties": { "pageSize": { "type": "string" }, "landscape": { "type": "boolean" }, "margins": { "$ref": "#/$defs/FacetPDFMargins" } }, "additionalProperties": false, "type": "object" }, "FieldMappingConfig": { "properties": { "id": { "items": { "type": "string" }, "type": "array" }, "message": { "items": { "type": "string" }, "type": "array" }, "timestamp": { "items": { "type": "string" }, "type": "array" }, "host": { "items": { "type": "string" }, "type": "array" }, "severity": { "items": { "type": "string" }, "type": "array" }, "source": { "items": { "type": "string" }, "type": "array" }, "ignore": { "items": { "type": "string" }, "type": "array" }, "groupBy": { "items": { "type": "string" }, "type": "array" }, "dedupBy": { "items": { "type": "string" }, "type": "array" } }, "additionalProperties": false, "type": "object" }, "GCPConnection": { "properties": { "connection": { "type": "string" }, "endpoint": { "type": "string" }, "credentials": { "$ref": "#/$defs/EnvVar" }, "skipTLSVerify": { "type": "boolean" }, "project": { "type": "string" } }, "additionalProperties": false, "type": "object" }, "GKEConnection": { "properties": { "connection": { "type": "string" }, "endpoint": { "type": "string" }, "credentials": { "$ref": "#/$defs/EnvVar" }, "skipTLSVerify": { "type": "boolean" }, "project": { "type": "string" }, "projectID": { "type": "string" }, "zone": { "type": "string" }, "cluster": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "projectID", "zone", "cluster" ] }, "GitConnection": { "properties": { "url": { "type": "string" }, "connection": { "type": "string" }, "username": { "$ref": "#/$defs/EnvVar" }, "password": { "$ref": "#/$defs/EnvVar" }, "certificate": { "$ref": "#/$defs/EnvVar" }, "type": { "type": "string" }, "branch": { "type": "string" }, "depth": { "type": "integer" }, "destination": { "type": "string" } }, "additionalProperties": false, "type": "object" }, "GitOpsAction": { "properties": { "repo": { "$ref": "#/$defs/GitOpsActionRepo" }, "commit": { "$ref": "#/$defs/GitOpsActionCommit" }, "pr": { "$ref": "#/$defs/GitOpsActionPR", "description": "PullRequest specifies the details for the PR to be created.\nOnly if connection type is github or azuredevops then a new PR is created." }, "patches": { "items": { "$ref": "#/$defs/GitOpsActionPatch" }, "type": "array" }, "files": { "items": { "$ref": "#/$defs/GitOpsActionFile" }, "type": "array", "description": "Files to create/delete.\nUse the special \"$delete\" directive to delete an existing file." } }, "additionalProperties": false, "type": "object", "required": [ "repo", "commit" ] }, "GitOpsActionCommit": { "properties": { "author": { "type": "string" }, "email": { "type": "string" }, "message": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "author", "email", "message" ] }, "GitOpsActionFile": { "properties": { "path": { "type": "string" }, "content": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "path", "content" ] }, "GitOpsActionPR": { "properties": { "title": { "type": "string", "description": "Title of the Pull request" }, "tags": { "items": { "type": "string" }, "type": "array", "description": "Tags to add to the PR" }, "autoMerge": { "$ref": "#/$defs/AutoMerge", "description": "AutoMerge pull request when supported" } }, "additionalProperties": false, "type": "object", "required": [ "title" ] }, "GitOpsActionPatch": { "properties": { "path": { "type": "string" }, "yq": { "type": "string" }, "jq": { "type": "string" }, "if": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "path" ] }, "GitOpsActionRepo": { "properties": { "url": { "type": "string", "description": "URL of the git repository" }, "username": { "$ref": "#/$defs/EnvVar" }, "password": { "$ref": "#/$defs/EnvVar" }, "base": { "type": "string", "description": "Branch to clone. Defaults to \"main\"." }, "branch": { "type": "string", "description": "Branch is the new branch to create. Defaults to Base." }, "skipExisting": { "type": "boolean", "description": "Do not push to existing branches" }, "force": { "type": "boolean", "description": "Overwrite history when pushing" }, "connection": { "type": "string" }, "type": { "type": "string", "description": "Type specifies the service the repository is hosted on (eg: github, gitlab, etc)\nIt is deduced from the repo URL however for private repository you can\nexplicitly specify the type manually." } }, "additionalProperties": false, "type": "object", "required": [ "url" ] }, "GithubAction": { "properties": { "repo": { "type": "string", "description": "Repo is the name of the repository without the .git extension" }, "username": { "type": "string", "description": "Username is the account owner of the repository. The name is not case sensitive" }, "token": { "$ref": "#/$defs/EnvVar", "description": "Token is the personal access token" }, "workflows": { "items": { "$ref": "#/$defs/GithubWorkflow" }, "type": "array", "description": "Workflows is the list of github workflows to invoke" } }, "additionalProperties": false, "type": "object", "required": [ "repo", "username", "token" ] }, "GithubWorkflow": { "properties": { "id": { "type": "string", "description": "Id is the workflow id or the workflow file name (eg: main.yaml)" }, "ref": { "type": "string", "description": "Ref is the git reference for the workflow.\nThe reference can be a branch or tag name.\n\tDefaults to \"main\"." }, "input": { "type": "string", "description": "Input is the optional input keys and values, in JSON format, configured in the workflow file." } }, "additionalProperties": false, "type": "object", "required": [ "id" ] }, "HTTPAction": { "properties": { "connection": { "type": "string" }, "username": { "$ref": "#/$defs/EnvVar" }, "password": { "$ref": "#/$defs/EnvVar" }, "ntlm": { "type": "boolean" }, "ntlmv2": { "type": "boolean" }, "digest": { "type": "boolean" }, "url": { "type": "string" }, "bearer": { "$ref": "#/$defs/EnvVar" }, "oauth": { "$ref": "#/$defs/OAuth" }, "tls": { "$ref": "#/$defs/TLSConfig" }, "headers": { "items": { "$ref": "#/$defs/EnvVar" }, "type": "array" }, "awsSigV4": { "$ref": "#/$defs/AWSSigV4" }, "method": { "type": "string", "description": "Method to use - defaults to GET" }, "body": { "type": "string", "description": "Request Body Contents" }, "templateBody": { "type": "boolean", "description": "TemplateBody controls whether the body of the request needs to be templated" } }, "additionalProperties": false, "type": "object" }, "HelmRefKeySelector": { "properties": { "name": { "type": "string" }, "key": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "key" ] }, "Items": { "items": { "type": "string" }, "type": "array" }, "KubernetesConnection": { "properties": { "connection": { "type": "string" }, "kubeconfig": { "$ref": "#/$defs/EnvVar" }, "eks": { "$ref": "#/$defs/EKSConnection" }, "gke": { "$ref": "#/$defs/GKEConnection" }, "cnrm": { "$ref": "#/$defs/CNRMConnection" } }, "additionalProperties": false, "type": "object" }, "LLMContextRequestPlaybook": { "properties": { "namespace": { "type": "string" }, "name": { "type": "string" }, "if": { "type": "string" }, "params": { "additionalProperties": { "type": "string" }, "type": "object" } }, "additionalProperties": false, "type": "object", "required": [ "namespace", "name" ] }, "LLMContextRequestRelationship": { "properties": { "depth": { "type": "integer" }, "direction": { "type": "string" }, "changes": { "$ref": "#/$defs/TimeMetadata" }, "analysis": { "$ref": "#/$defs/TimeMetadata" } }, "additionalProperties": false, "type": "object" }, "LogDedupe": { "properties": { "window": { "type": "string" }, "fields": { "items": { "type": "string" }, "type": "array" } }, "additionalProperties": false, "type": "object", "required": [ "fields" ] }, "LogsAction": { "properties": { "loki": { "$ref": "#/$defs/LogsActionLoki" }, "cloudwatch": { "$ref": "#/$defs/LogsActionCloudWatch" }, "opensearch": { "$ref": "#/$defs/LogsActionOpenSearch" }, "kubernetes": { "$ref": "#/$defs/LogsKubernetes" } }, "additionalProperties": false, "type": "object" }, "LogsActionCloudWatch": { "properties": { "dedupe": { "$ref": "#/$defs/LogDedupe", "description": "Dedupe is a list of fields to dedupe on.\nFor two logs to be deduped, they should match on all the fields.\n\nIf two logs have empty value for the field, they are still deduped." }, "match": { "items": { "type": "string" }, "type": "array", "description": "Match is a list of CEL expressions that decide if the log should be included.\nIf even one of the expressions match, the log will be included." }, "mapping": { "$ref": "#/$defs/FieldMappingConfig", "description": "Map labels to fields" }, "parse": { "type": "string", "description": "Parse specifies the log format to parse.\nSupported: \"logfmt\", \"klogfmt\", \"json\", \"syslog\", \"autodetect\"" }, "connection": { "type": "string" }, "accessKey": { "$ref": "#/$defs/EnvVar" }, "secretKey": { "$ref": "#/$defs/EnvVar" }, "sessionToken": { "$ref": "#/$defs/EnvVar" }, "assumeRole": { "type": "string" }, "region": { "type": "string" }, "endpoint": { "type": "string" }, "skipTLSVerify": { "type": "boolean" }, "start": { "type": "string" }, "end": { "type": "string" }, "limit": { "type": "string" }, "logGroup": { "type": "string" }, "query": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "logGroup", "query" ] }, "LogsActionLoki": { "properties": { "dedupe": { "$ref": "#/$defs/LogDedupe", "description": "Dedupe is a list of fields to dedupe on.\nFor two logs to be deduped, they should match on all the fields.\n\nIf two logs have empty value for the field, they are still deduped." }, "match": { "items": { "type": "string" }, "type": "array", "description": "Match is a list of CEL expressions that decide if the log should be included.\nIf even one of the expressions match, the log will be included." }, "mapping": { "$ref": "#/$defs/FieldMappingConfig", "description": "Map labels to fields" }, "parse": { "type": "string", "description": "Parse specifies the log format to parse.\nSupported: \"logfmt\", \"klogfmt\", \"json\", \"syslog\", \"autodetect\"" }, "start": { "type": "string" }, "end": { "type": "string" }, "limit": { "type": "string" }, "query": { "type": "string" }, "since": { "type": "string" }, "step": { "type": "string" }, "interval": { "type": "string" }, "direction": { "type": "string" }, "connection": { "type": "string" }, "url": { "type": "string" }, "username": { "$ref": "#/$defs/EnvVar" }, "password": { "$ref": "#/$defs/EnvVar" } }, "additionalProperties": false, "type": "object" }, "LogsActionOpenSearch": { "properties": { "dedupe": { "$ref": "#/$defs/LogDedupe", "description": "Dedupe is a list of fields to dedupe on.\nFor two logs to be deduped, they should match on all the fields.\n\nIf two logs have empty value for the field, they are still deduped." }, "match": { "items": { "type": "string" }, "type": "array", "description": "Match is a list of CEL expressions that decide if the log should be included.\nIf even one of the expressions match, the log will be included." }, "mapping": { "$ref": "#/$defs/FieldMappingConfig", "description": "Map labels to fields" }, "parse": { "type": "string", "description": "Parse specifies the log format to parse.\nSupported: \"logfmt\", \"klogfmt\", \"json\", \"syslog\", \"autodetect\"" }, "connection": { "type": "string" }, "address": { "type": "string" }, "username": { "$ref": "#/$defs/EnvVar" }, "password": { "$ref": "#/$defs/EnvVar" }, "index": { "type": "string" }, "query": { "type": "string" }, "limit": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "index", "query" ] }, "LogsKubernetes": { "properties": { "dedupe": { "$ref": "#/$defs/LogDedupe", "description": "Dedupe is a list of fields to dedupe on.\nFor two logs to be deduped, they should match on all the fields.\n\nIf two logs have empty value for the field, they are still deduped." }, "match": { "items": { "type": "string" }, "type": "array", "description": "Match is a list of CEL expressions that decide if the log should be included.\nIf even one of the expressions match, the log will be included." }, "mapping": { "$ref": "#/$defs/FieldMappingConfig", "description": "Map labels to fields" }, "parse": { "type": "string", "description": "Parse specifies the log format to parse.\nSupported: \"logfmt\", \"klogfmt\", \"json\", \"syslog\", \"autodetect\"" }, "connection": { "type": "string" }, "kubeconfig": { "$ref": "#/$defs/EnvVar" }, "eks": { "$ref": "#/$defs/EKSConnection" }, "gke": { "$ref": "#/$defs/GKEConnection" }, "cnrm": { "$ref": "#/$defs/CNRMConnection" }, "start": { "type": "string" }, "end": { "type": "string" }, "limit": { "type": "string" }, "kind": { "type": "string" }, "apiVersion": { "type": "string" }, "namespace": { "type": "string" }, "name": { "type": "string" }, "pods": { "$ref": "#/$defs/ResourceSelectors" }, "containers": { "$ref": "#/$defs/MatchExpressions" } }, "additionalProperties": false, "type": "object", "required": [ "kind", "apiVersion", "namespace", "name" ] }, "MatchExpressions": { "items": { "type": "string" }, "type": "array" }, "NotificationAction": { "properties": { "url": { "type": "string", "description": "URL for the shoutrrr connection string" }, "connection": { "type": "string", "description": "Connection to use to send the notification" }, "title": { "type": "string", "description": "Title of the notification" }, "message": { "type": "string", "description": "Message is the body of the notification" }, "properties": { "additionalProperties": { "type": "string" }, "type": "object", "description": "Properties for shoutrrr" }, "attachments": { "items": { "$ref": "#/$defs/NotificationAttachment" }, "type": "array", "description": "Attachments for the notification (only supported for SMTP)" } }, "additionalProperties": false, "type": "object", "required": [ "title", "message" ] }, "NotificationAttachment": { "properties": { "filename": { "type": "string", "description": "Filename for the attachment" }, "content": { "type": "string", "description": "Content is the body of the attachment (supports template expressions)" }, "contentType": { "type": "string", "description": "ContentType is the MIME type of the attachment (e.g. application/pdf)" } }, "additionalProperties": false, "type": "object", "required": [ "filename", "content" ] }, "OAuth": { "properties": { "clientID": { "$ref": "#/$defs/EnvVar" }, "clientSecret": { "$ref": "#/$defs/EnvVar" }, "scope": { "items": { "type": "string" }, "type": "array" }, "tokenURL": { "type": "string" }, "params": { "additionalProperties": { "type": "string" }, "type": "object" } }, "additionalProperties": false, "type": "object" }, "PlaybookAction": { "properties": { "name": { "type": "string", "description": "Name of the action" }, "delay": { "type": "string", "description": "Delay is a CEL expression that returns the duration to delay the execution of this action.\nValid time units are \"s\", \"m\", \"h\", \"d\", \"w\", \"y\".\nIt's only sensitive to the minute. i.e. if you delay by 20s it can take upto a minute to execute." }, "retry": { "$ref": "#/$defs/PlaybookActionRetry", "description": "Retry specifies the retry policy for the action." }, "timeout": { "type": "string", "description": "Timeout is the maximum duration to let an action run before it's cancelled." }, "if": { "type": "string", "description": "Filter is a cel-expression that decides if this action should run or not.\nThe expressions should either return a boolean value ('true' indicating run the action \u0026 vice versa)\nor any of these special functions.\nExamples:\n\t- filter: config.deleted_at ? true: false\n\t- filter: always()\nalways(): run no matter what; even if the playbook is cancelled/fails\nfailure(): run if any of the previous actions failed\nsuccess(): run only if all previous actions succeeded (default)\ntimeout(): run only if any of the previous actions timed out\nskip(): skip running this action" }, "runsOn": { "items": { "type": "string" }, "type": "array", "description": "RunsOn specifies the agents that can run this action.\nWhen left empty, the action will run on the main instance itself." }, "templatesOn": { "type": "string", "description": "TemplatesOn specifies where the templating happens.\nAvailable options:\n - host\n - agent\nWhen left empty, the templating is done on the main instance(host) itself." }, "contentType": { "type": "string", "description": "ContentType declares how the primary output should be rendered in the UI." }, "ai": { "$ref": "#/$defs/AIAction" }, "exec": { "$ref": "#/$defs/ExecAction" }, "gitops": { "$ref": "#/$defs/GitOpsAction" }, "github": { "$ref": "#/$defs/GithubAction" }, "azureDevopsPipeline": { "$ref": "#/$defs/AzureDevopsPipelineAction" }, "http": { "$ref": "#/$defs/HTTPAction" }, "sql": { "$ref": "#/$defs/SQLAction" }, "prometheus": { "$ref": "#/$defs/PrometheusQuery" }, "pod": { "$ref": "#/$defs/PodAction" }, "notification": { "$ref": "#/$defs/NotificationAction" }, "logs": { "$ref": "#/$defs/LogsAction" }, "report": { "$ref": "#/$defs/ReportAction" } }, "additionalProperties": false, "type": "object", "required": [ "name" ] }, "PlaybookActionRetry": { "properties": { "limit": { "type": "integer", "description": "Limit is the number of times to retry the action.\nWith limit = 3, there will be a max of 4 attempts for the action (initial attempt + 3 retries)." }, "duration": { "type": "string", "description": "Duration is the duration to wait before retrying the action." }, "jitter": { "type": "integer", "description": "Jitter is the random factor to apply to the duration.\nRanges from 0 to 100." }, "exponent": { "$ref": "#/$defs/RetryExponent", "description": "Exponent is the exponential backoff configuration." } }, "additionalProperties": false, "type": "object", "required": [ "limit", "duration", "exponent" ] }, "PlaybookApproval": { "properties": { "type": { "type": "string" }, "approvers": { "$ref": "#/$defs/PlaybookApprovers" } }, "additionalProperties": false, "type": "object" }, "PlaybookApprovers": { "properties": { "people": { "items": { "type": "string" }, "type": "array", "description": "Emails of the approvers" }, "teams": { "items": { "type": "string" }, "type": "array", "description": "Names of the teams" } }, "additionalProperties": false, "type": "object" }, "PlaybookEventWebhookAuth": { "properties": { "basic": { "$ref": "#/$defs/PlaybookEventWebhookAuthBasic" }, "github": { "$ref": "#/$defs/PlaybookEventWebhookAuthGithub" }, "svix": { "$ref": "#/$defs/PlaybookEventWebhookAuthSVIX" }, "jwt": { "$ref": "#/$defs/PlaybookEventWebhookAuthJWT" } }, "additionalProperties": false, "type": "object" }, "PlaybookEventWebhookAuthBasic": { "properties": { "username": { "$ref": "#/$defs/EnvVar" }, "password": { "$ref": "#/$defs/EnvVar" } }, "additionalProperties": false, "type": "object", "required": [ "username", "password" ] }, "PlaybookEventWebhookAuthGithub": { "properties": { "token": { "$ref": "#/$defs/EnvVar", "description": "Token is the secret token for the webhook.\n Doc: https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries" } }, "additionalProperties": false, "type": "object", "required": [ "token" ] }, "PlaybookEventWebhookAuthJWT": { "properties": { "jwksUri": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "jwksUri" ] }, "PlaybookEventWebhookAuthSVIX": { "properties": { "secret": { "$ref": "#/$defs/EnvVar", "description": "Secret is the webhook signing secret" }, "verifyTimestamp": { "type": "string", "description": "TimestampTolerance specifies the tolerance for the timestamp verification.\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\", \"d\", \"w\", \"y\"." } }, "additionalProperties": false, "type": "object", "required": [ "secret" ] }, "PlaybookParameter": { "properties": { "name": { "type": "string", "description": "Name is the key for this parameter.\nIt's used to address the parameter on templates." }, "default": { "type": "string", "description": "Specify the default value of the parameter." }, "label": { "type": "string", "description": "Label shown on the UI" }, "required": { "type": "boolean" }, "icon": { "type": "string" }, "description": { "type": "string" }, "type": { "type": "string" }, "properties": true, "dependsOn": { "items": { "type": "string" }, "type": "array", "description": "DependsOn lists the parameters that influence this parameter's default values." } }, "additionalProperties": false, "type": "object", "required": [ "name" ], "description": "PlaybookParameter defines a parameter that a playbook needs to run." }, "PlaybookPermission": { "properties": { "role": { "type": "string" }, "team": { "type": "string" }, "ref": { "type": "string" } }, "additionalProperties": false, "type": "object" }, "PlaybookSpec": { "properties": { "title": { "type": "string" }, "description": { "type": "string", "description": "Short description of the playbook." }, "category": { "type": "string" }, "icon": { "type": "string" }, "timeout": { "type": "string", "description": "Timeout is the maximum duration to let the playbook run before it's cancelled.\nValid time units are \"s\", \"m\", \"h\", \"d\", \"w\", \"y\"." }, "on": { "$ref": "#/$defs/PlaybookTrigger", "description": "`On` defines triggers that will automatically trigger the playbook.\nIf multiple events are defined, only one of those events needs to occur to trigger the playbook.\nIf multiple triggering events occur at the same time, multiple playbook runs will be triggered." }, "runsOn": { "items": { "type": "string" }, "type": "array", "description": "RunsOn specifies the agents that can run this playbook.\nWhen left empty, the playbook will run on the main instance itself." }, "env": { "items": { "$ref": "#/$defs/EnvVar" }, "type": "array", "description": "Env is a list of env vars that are templatable and accessible in templates.\nEnv vars are similar to playbook parameters except they do not get\npersisted and are meant to be used for confidential information." }, "templatesOn": { "type": "string", "description": "TemplatesOn specifies where the templating happens.\nAvailable options:\n - host\n - agent\nWhen left empty, the templating is done on the main instance(host) itself." }, "permissions": { "items": { "$ref": "#/$defs/PlaybookPermission" }, "type": "array", "description": "Permissions ..." }, "configs": { "$ref": "#/$defs/ResourceSelectors", "description": "Configs filters what config items can run on this playbook." }, "checks": { "$ref": "#/$defs/ResourceSelectors", "description": "Checks filters what checks can run on this playbook." }, "components": { "$ref": "#/$defs/ResourceSelectors", "description": "Components what components can run on this playbook." }, "parameters": { "items": { "$ref": "#/$defs/PlaybookParameter" }, "type": "array", "description": "Define and document what parameters are required to run this playbook." }, "actions": { "items": { "$ref": "#/$defs/PlaybookAction" }, "type": "array", "description": "List of actions that need to be executed by this playbook." }, "filters": { "items": { "type": "string" }, "type": "array", "description": "CEL Expressions that check if a playbook should be executed" }, "approval": { "$ref": "#/$defs/PlaybookApproval", "description": "Approval defines the individuals and teams authorized to approve runs of this playbook." }, "jsonSchema": { "type": "string", "description": "JSON Schema or URL to use instead of playbook parameters" }, "ui": { "description": "Properties that are applied to the UI form" } }, "additionalProperties": false, "type": "object", "required": [ "actions" ] }, "PlaybookTrigger": { "properties": { "canary": { "items": { "$ref": "#/$defs/PlaybookTriggerEvent" }, "type": "array" }, "config": { "items": { "$ref": "#/$defs/PlaybookTriggerEvent" }, "type": "array" }, "component": { "items": { "$ref": "#/$defs/PlaybookTriggerEvent" }, "type": "array" }, "webhook": { "$ref": "#/$defs/PlaybookTriggerWebhook", "description": "Webhook creates a new endpoint that triggers this playbook" }, "schedule": { "items": { "$ref": "#/$defs/PlaybookTriggerSchedule" }, "type": "array", "description": "Schedule triggers the playbook on a recurring cron schedule" } }, "additionalProperties": false, "type": "object", "description": "PlaybookTrigger defines the list of supported events \u0026 to trigger a playbook." }, "PlaybookTriggerEvent": { "properties": { "event": { "type": "string", "description": "Event to listen for." }, "labels": { "additionalProperties": { "type": "string" }, "type": "object", "description": "Labels specifies the key-value pairs that the associated event's resource must match." }, "filter": { "type": "string", "description": "CEL expression for additional event filtering." } }, "additionalProperties": false, "type": "object", "required": [ "event" ] }, "PlaybookTriggerSchedule": { "properties": { "schedule": { "type": "string", "description": "Cron expression: \"0 9 * * MON\", \"@every 1h\", etc.\nEvaluated in UTC by default. Use the CRON_TZ prefix to override, e.g. \"CRON_TZ=America/New_York 0 9 * * MON\"." }, "parameters": { "additionalProperties": { "type": "string" }, "type": "object", "description": "Parameters passed to each run (supports template expressions evaluated at run time)" } }, "additionalProperties": false, "type": "object", "required": [ "schedule" ] }, "PlaybookTriggerWebhook": { "properties": { "path": { "type": "string" }, "authentication": { "$ref": "#/$defs/PlaybookEventWebhookAuth" } }, "additionalProperties": false, "type": "object", "required": [ "path" ] }, "PodAction": { "properties": { "name": { "type": "string", "description": "Name is name of the pod that'll be created" }, "maxLength": { "type": "integer", "description": "MaxLength is the maximum length of the logs to show\n Default: 3000 characters" }, "spec": { "description": "Spec is the container spec" }, "artifacts": { "items": { "$ref": "#/$defs/Artifact" }, "type": "array", "description": "Artifacts to save" } }, "additionalProperties": false, "type": "object", "required": [ "name", "spec" ] }, "PrometheusQuery": { "properties": { "connection": { "type": "string" }, "username": { "$ref": "#/$defs/EnvVar" }, "password": { "$ref": "#/$defs/EnvVar" }, "ntlm": { "type": "boolean" }, "ntlmv2": { "type": "boolean" }, "digest": { "type": "boolean" }, "url": { "type": "string" }, "bearer": { "$ref": "#/$defs/EnvVar" }, "oauth": { "$ref": "#/$defs/OAuth" }, "tls": { "$ref": "#/$defs/TLSConfig" }, "headers": { "items": { "$ref": "#/$defs/EnvVar" }, "type": "array" }, "awsSigV4": { "$ref": "#/$defs/AWSSigV4" }, "query": { "type": "string" }, "range": { "$ref": "#/$defs/PrometheusRange" }, "matchLabels": { "items": { "type": "string" }, "type": "array" }, "selectLabels": { "items": { "type": "string" }, "type": "array" } }, "additionalProperties": false, "type": "object", "required": [ "query" ] }, "PrometheusRange": { "properties": { "start": { "type": "string" }, "end": { "type": "string" }, "step": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "start", "end", "step" ] }, "ReportAction": { "properties": { "view": { "type": "string", "description": "Reference an existing View by namespace/name or just name" }, "configs": { "$ref": "#/$defs/ResourceSelector", "description": "Inline catalog query (alternative to View)" }, "format": { "type": "string", "description": "Output format: json, csv, facet-html, facet-pdf, markdown, slack, html, pdf" }, "variables": { "additionalProperties": { "type": "string" }, "type": "object", "description": "Variables passed to the view queries" }, "facet": { "$ref": "#/$defs/FacetOptions", "description": "Facet rendering options for facet-html and facet-pdf formats" } }, "additionalProperties": false, "type": "object" }, "ResourceSelector": { "properties": { "agent": { "type": "string" }, "scope": { "type": "string" }, "cache": { "type": "string" }, "search": { "type": "string" }, "limit": { "type": "integer" }, "includeDeleted": { "type": "boolean" }, "id": { "type": "string" }, "name": { "type": "string" }, "namespace": { "type": "string" }, "tagSelector": { "type": "string" }, "labelSelector": { "type": "string" }, "fieldSelector": { "type": "string" }, "health": { "type": "string" }, "types": { "$ref": "#/$defs/Items" }, "statuses": { "$ref": "#/$defs/Items" } }, "additionalProperties": false, "type": "object" }, "ResourceSelectors": { "items": { "$ref": "#/$defs/ResourceSelector" }, "type": "array" }, "RetryExponent": { "properties": { "multiplier": { "type": "integer" } }, "additionalProperties": false, "type": "object", "required": [ "multiplier" ] }, "RuntimeSetup": { "properties": { "version": { "type": "string" } }, "additionalProperties": false, "type": "object" }, "SQLAction": { "properties": { "connection": { "type": "string", "description": "Connection identifier e.g. connection://Postgres/flanksource" }, "url": { "type": "string", "description": "URL is the database connection url" }, "query": { "type": "string", "description": "Query is the sql query to run" }, "driver": { "type": "string", "description": "Driver is the name of the underlying database to connect to.\nExample: postgres, mysql, ..." } }, "additionalProperties": false, "type": "object", "required": [ "query" ] }, "SecretKeySelector": { "properties": { "name": { "type": "string" }, "key": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "key" ] }, "TLSConfig": { "properties": { "insecureSkipVerify": { "type": "boolean" }, "handshakeTimeout": { "type": "integer" }, "ca": { "$ref": "#/$defs/EnvVar" }, "cert": { "$ref": "#/$defs/EnvVar" }, "key": { "$ref": "#/$defs/EnvVar" } }, "additionalProperties": false, "type": "object" }, "TimeMetadata": { "properties": { "since": { "type": "string" } }, "additionalProperties": false, "type": "object", "required": [ "since" ] } } }