blagh / pagerduty-service-maintenance-sample

Client-side JavaScript sample that enables and disables PagerDuty Services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PagerDuty Service Maintenance

This is a simple tool that showcases how to use PKCE OAuth and the PDJS library to enable and disable services in PagerDuty.

A detailed explanation of the PKCE OAuth code can be found in the pagerduty-bulk-user-mgr-sample project. Questions about the code in this project can either be posted as an Issue in GitHub, or on the Developer Forum on the PagerDuty Community site.

Set Up Instructions

To run this code, do the following:

  • Clone the repository
  • Generate a clientId in PagerDuty. This is done by Creating an App and Adding OAuth2 Functionality to your App
  • in js/config.js set the values of redirectUrl with the value you entered while creating your app in PagerDuty, and clientId with the value generated while adding OAuth2 functionality
  • Point your browser where ever you running the sample, and with the js/config.js correctly set, the sample should authenticate you and authorize the sample to grab a list of the services for your PagerDuty account.

How It Works

Once authenticated, the app will grab a list of Services from your PagerDuty account. Each service will have a checkbox. If the service is enabled the box will be checked, if disabled it will be unchecked.

PagerDuty Service Maintenance Service List

By checking and unchecking the boxes you will be enabling and disabling the corresponding service in your account.

A list of the actions you take while using the sample will appear below the list of services. There, you will also see a button that will allow you to Disconnect the sample from your PagerDuty account.

PagerDuty Service Maintenance Action Log and Disconnect Button

Questions

If you have any questions or issues with this sample please post an Issue on this repository or create a post in the PagerDuty Developer Community.

About

Client-side JavaScript sample that enables and disables PagerDuty Services


Languages

Language:JavaScript 72.6%Language:HTML 17.0%Language:CSS 10.3%