Python module that updates a Slack chat room topic with the current on-call for a pagerduty schedule.
This module is based on pd-oncall-chat-topic by the nice folks at Pagerduty. If you have access to run lambda I'd advice you to use their project.
Small changes apply to this particular code:
- We use the /oncalls endpoint of the pagerduty v2 API
- We assume that each user will update their names in pagerduty match their slack handle
- Obtain a Slack API token from a Bot Directions Here
- Obtain a PagerDuty API Key (v2) Directions Here
- Get the unique ID of the Slack channel which you want to manage the topic (Not the name)
- Get the unique ID of the Pagerduty schedule that you want to monitor (Not the name)
pd_observer -t <SLACK_TOKEN_ID> -A <PAGERDUTY_API_KEY> -S <PD_SCHEDULE_ID> -C <SLACK_CHANNEL_ID>
HTTPS_PROXY=http://proxy:3128 pd_observer -t <SLACK_TOKEN_ID> -A <PAGERDUTY_API_KEY> -S <PD_SCHEDULE_ID> -C <SLACK_CHANNEL_ID>
docker run -it docker -t <SLACK_TOKEN_ID> -A <PAGERDUTY_API_KEY> -S <PD_SCHEDULE_ID> -C <SLACK_CHANNEL_ID>