-
Notifications
You must be signed in to change notification settings - Fork 3
Webhook Examples Slack
Create a Slack App and enable Incoming Webhooks: https://api.slack.com/messaging/webhooks
To create nicely formatted Slack messages, the following links may be helpful:
- Slack message formatting: https://api.slack.com/reference/surfaces/formatting
- Slack Block Kit Builder: https://app.slack.com/block-kit-builder/
For each example, the following details will be shared:
- Screenshot of example
- Variables used from Turbonomic's Action DTO
- User Variables you must supply
- Link to JSON Workflow DTO to add webhook to your Turbonomic instance
- Link to unescaped JSON for Slack Block Kit Builder in case you want to modify the template to your liking
Each example has been written for a specific Action. Please note the platform (On-Prem, Cloud, Container, etc), entity (VM, DB, Workload Controller, etc), and action (Move, Resize, etc) when implementing the webhooks. Webhooks may fail if implemented on the incorrect platform, entity, or action as certain Action DTO variables only exist for specific types of actions.
This Workflow DTO was written to accommodate On-Prem > VM > Move actions. It could work for other actions as long as the action DTO has the same variables.

-
Action DTO Variables
$action.target.className$action.actionType-
$action.actionState(using IF/ELSEIF/ELSE statement to evaluate if action isSUCCEEDED,READY,IN_PROGRESS,FAILED) $action.actionMode$action.userName$action.updateTime$action.target.displayName$action.currentEntity.displayName$action.newEntity.displayName$action.risk.subCategory$action.risk.description$action.target.uuid
-
User Variables:
- Add your Slack Webhook URL where it says
<YOUR SLACK WEBHOOK URL> - Add your Turbo URL where it says
<YOUR_TURBO_URL>
- Add your Slack Webhook URL where it says
-
Workflow DTO: On-Prem VM Move
-
Slack Block Builder JSON: On-Prem VM Move
This Workflow DTO was written to accommodate On-Prem > VM > Resize actions. It could work for other actions as long as the action DTO has the same variables.
-
Action DTO Variables
$action.target.className$action.actionType-
$action.actionState(using IF/ELSEIF/ELSE statement to evaluate if action isSUCCEEDED,READY,IN_PROGRESS,FAILED) $action.actionMode$action.userName$action.updateTime$action.target.displayName$action.details$action.risk.subCategory-
$action.risk.reasonCommodities(then using a #foreach loop, iterate through each commodity,$resizeRisk) $action.target.uuid
-
User Variables:
- Add your Slack Webhook URL where it says
<YOUR SLACK WEBHOOK URL> - Add your Turbo URL where it says
<YOUR_TURBO_URL>
- Add your Slack Webhook URL where it says
-
Workflow DTO: On-Prem VM Resize
-
Slack Block Builder JSON: On-Prem VM Resize
This Workflow DTO was written to accommodate On-Prem > VM > Resize actions that have a particular tag. It could work for other actions as long as the action DTO has the same variables.
-
Action DTO Variables
$action.target.className$action.actionType-
$action.actionState(using IF/ELSEIF/ELSE statement to evaluate if action isSUCCEEDED,READY,IN_PROGRESS,FAILED) $action.actionMode$action.userName$action.updateTime$action.target.displayName$action.details$action.risk.subCategory-
$action.risk.reasonCommodities(then using a #foreach loop, iterate through each commodity,$resizeRisk) $action.target.uuid-
$action.target.tags["<YOUR TAG KEY>"][0]- For example, if your tag was “Owner Email”, then the variable to use would be
$action.target.tags["Owner Email"][0]AND when you add to the template, be sure to also escape the quotes. So the final variable would look like$action.target.tags[\"Owner Email\"][0] - If your VM is missing the “Owner Email” tag then this webhook will fail to generate.
- For example, if your tag was “Owner Email”, then the variable to use would be
-
User Variables:
- Add your Slack Webhook URL where it says
<YOUR SLACK WEBHOOK URL> - Add your tag key where it says
<YOUR TAG KEY> - Add your Turbo URL where it says
<YOUR_TURBO_URL>
- Add your Slack Webhook URL where it says
-
Workflow DTO: On-Prem VM Resize with Tags
-
Slack Block Builder JSON: On-Prem VM Resize with Tags
This Workflow DTO was written to accommodate container resize actions - including compoundActions when more than one resource is being changed in a single action. It could work for other actions as long as the action DTO has the same variables.
-
Action DTO Variables
$action.target.className$action.actionType-
$action.actionState(using IF/ELSEIF/ELSE statement to evaluate if action is SUCCEEDED, READY, IN_PROGRESS, FAILED) $action.actionMode$action.userName$action.updateTime$action.target.displayName$action.target.aspects.containerPlatformContextAspect.namespace$action.target.aspects.containerPlatformContextAspect.containerPlatformCluster$action.details$action.risk.description$action.risk.subCategory-
$action.compoundActions(then using a #foreach loop, $containerAction)$containerAction.target.displayName-
$containerAction.risk.reasonCommodities(then using a #foreach loop, iterate through each commodity, $resizeRisk) $containerAction.currentValue$containerAction.newValue$containerAction.valueUnits
-
User Variables:
- Add your Slack Webhook URL where it says
<YOUR SLACK WEBHOOK URL> - Add your Turbo URL where it says
<YOUR_TURBO_URL>
- Add your Slack Webhook URL where it says
-
Workflow DTO: Container Workload Controller Resize
-
Slack Block Builder JSON: Container Workload Controller Resize
This Workflow DTO was written to accommodate container pod move actions. It could work for other actions as long as the action DTO has the same variables.
-
Action DTO Variables
$action.target.className$action.actionType-
$action.actionState(using IF/ELSEIF/ELSE statement to evaluate if action is SUCCEEDED, READY, IN_PROGRESS, FAILED) $action.actionMode$action.userName$!action.updateTime$action.target.displayName$action.currentEntity.displayName$action.newEntity.displayName$action.target.discoveredBy.displayName$action.risk.subCategory$action.risk.description$action.target.uuid
-
User Variables:
- Add your Slack Webhook URL where it says
<YOUR SLACK WEBHOOK URL> - Add your Turbo URL where it says
<YOUR_TURBO_URL>
- Add your Slack Webhook URL where it says
-
Workflow DTO: Container Pod Move
-
Slack Block Builder JSON: Container Pod Move