Slack Command Extensions
Command extensions allow your team to add custom functionality to the FireHydrant Slack bot. This section provides information on how to use these extensions once they've been set up.
To execute a command extension, you need to enter it into the Slack message box in the following format:
/fh <command-name> <arg1> <arg2> ...
/fhis the prefix that invokes the FireHydrant bot.
<command-name>is the name of the command extension that you want to execute. This is defined when you set up the command extension.
<arg2>... are any arguments that your command extension requires.
For instance, if you have a command extension named
restart-deployment, you could use it to restart an nginx deployment in a default namespace using the following command:
/fh restart-deployment default nginx-deployment
This would request your internal application to restart the nginx deployment in the specified namespace. The command's response will depend on how you've configured the command extension and the status of the requested operation.
Remember that each command extension may require different arguments, so make sure to provide the correct arguments for each command extension you use.
FireHydrant command extensions rely on webhooks, you'll need to create a new webhook that is configured for your Slack extension. Follow the guide here, to create a new webhook.
Fields to configure and examples.
|Help Description||"This command allows you to perform action X."|
|Command Type||Reply, Webhook|
Once you've configured a Slack command extension, you can run the command in Slack by typing:
/fh command-name arg1 arg2
When using a webhook operation in command extensions, you'll receive a payload that looks like this:
"name": "Robert Ross",
The callback URL is a unique URL that you can use to reply with incident notes on your timeline. This is useful to reply with asynchronous tasks that your operation is running.
For example, you can add notes back to your incident with:
POST /integrations/slack/webhooks/eyJhbGNiJ9.eyJpc3MiOeHRlb4LWRiYjYtNDg0Yi1hMWVmLTRlYzgwNzVmZDBjOCIsImV4cCI6MTY5MDI0MTM3NH0.GVXKsHeYhVTg7kzT5Xnba46L-GWhE HTTP/1.1
"body": "Deployment has successfully restarted"