Slack slash command using Cisco Prime API to find people.
Built with the Serverless Framework, using AWS Lambda and API Gateway.
-
Clone the WhereIs repository and enter the directory.
git clone https://github.com/LewisLebentz/WhereIs.git && cd WhereIs
-
If you haven't already, install the Serverless Framework.
npm install serverless -g
- You will need AWS credentials setup on your machine before being able to run Serverless commands. Follow the guide here.
-
Install the dependencies.
npm install --save pip install pipenv
-
Update serverless.yml changing the region, securityGroupIds and subnetIds where applicable.
-
Update handler.py changing the url variable with your Cisco Prime IP/address.
-
Run the command to deploy.
sls deploy
-
Login to Slack and navigate to the Create a Slack App page.
-
Give your app a name and choose the workspace you'd like to deploy it to.
-
Under 'Features' navigate to 'Slash Commands' and select 'Create New Command'. Call the command whatever you like, and for the Request URL enter the URL returned when the
sls deploy
command finished executing. Fill in the Description and Hint with something meaningful and save. -
Now, under 'Settings' choose 'Install App' and install it to your workspace.
-
Finally, in Slack run
/whereis firstname.surname
and it should return the location from Prime!