Switcher Slash Webhook
A Slash Add-on App for Slack
A Slash Add-on App for Slack
- Ruby (Sinatra) 1.3 (Release 2.2.x)
- Slash add-on for Slack
- Coffee =D
Switcher Slash Webhook is a API wrapper used to check both Switcher Load Balance and Switcher API from the Slack app using Slash Command add-on.
Changes on config/development.yaml file.
slack_hook_endpoint: [SLACK_HOOK_URL]
slack_hook_token: [SLACK_API_KEY]
switcher_load_balance: https://switcher-load-balance.herokuapp.com
switcher_api_key: [SWITCHER_COMPONENT_KEY]
switcher_api_domain: [SWITCHER_DOMAIN_NAME]
bundle install rackup -p 4567
rspec
{{url}}/cmd?token=SLASH_CMD_TOKEN&text=status
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Switcher Load Balance\n\n*Message:* All good\n*Code:* 200\n"
},
"accessory": {
"type": "image",
"image_url": "https://raw.githubusercontent.com/s/switcherapi-assets/master/logo/switcher_mark_grey.png",
"alt_text": "Switcher API"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Node:* SNODE1 :sunny:\n*Endpoint:* https://switcher-api.herokuapp.com\n*Status:* online"
}
}
]
}
{{url}}/cmd?token=SLASH_CMD_TOKEN&text=check-prd+FEATURE01+-v+Roger
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Switcher API\n\n*Result:* Passed\n*Reason:* Success\n"
},
"accessory": {
"type": "image",
"image_url": "https://raw.githubusercontent.com/switcherapi/switcherapi-assets/master/logo/switcher_mark_grey.png",
"alt_text": "Switcher API"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Command:* /cmd check-prd FEATURE01 -v Roger"
}
}
]
}
Please do open an issue or PR if you feel you have something cool to add.