This is a Node.js script for the bulk creation of PagerDuty services using CSV data.
Create a CSV file with the following columns:
name
: The name of the servicedescription
: A short description of the serviceauto_resolve_timeout
: The auto resolve timeout for the service (in miliseconds)escalation_policy
: The ID of the escalation policy to associate with the service
For an example, please refer to the services.csv file.
- Login in to your PagerDuty account.
- Hover over the 'People' menu and select 'Escalation Policies'
- Find the escalation policy you want to assign to your service.
- Click on the name of the escalation policy to open its details page.
- The policy_id is located at the end of the URL in the address bar. Example url: https://.pagerduty.com/escalation_policies#<policy_id>
Navigate to the root folder of the project, then:
- Generate a .env file:
cp .env.example .env
- Add your PagerDuty API key to the .env file:
PAGERDUTY_API_KEY= PAGERDUTY_BASE_API_URL=https://api.pagerduty.com
- Install the required dependencies:
npm install
- Run the script:
npm start <csv file path> <escalation policy ID>