Skip to main content

Python Client Library for PagerDuty's REST API

Project description

Python Library for PagerDuty’s v1 REST API.

This library is currently evolving and backwards compatibility cannot always be guaranteed at this time.

Installation

You can install with pip install pygerduty.

If you want to install from source, then python setup.py install.

Requirements

Pygerduty is tested against >= Python 2.5

simplejson is required on Python2.5

Documentation

Pygerduty is a thin wrapper around PagerDuty’s APIs. You will need to refer to the the PagerDuty Documentation for all available parameters to pass and all available attributes on responses.

The main methods available to resources are list, show, create, update, and delete. Not all resources have endpoints for all of the above methods. Again, refer to the PagerDuty Documentation to see all available endpoints.

Top level resources will be accessible via the PagerDuty object and nested resources available on containers returned from their parent resource.

Examples

Instantiating a client:

import pygerduty
pager = pygerduty.PagerDuty("foobar", "SOMEAPIKEY123456")

Listing a resource:

for schedule in pager.schedules.list():
    print schedule.id, schedule.name

# PX7F8S3 Primary
# PJ48C0S Tertiary
# PCJ94SK Secondary

Getting a resource by ID:

schedule = pager.schedules.show("PX7F8S3")

Creating a resource:

user = pager.users.list(query="gary")[0]
override = schedule.overrides.create(
    start="2012-12-16", end="2012-12-17", user_id=user.id)

Delete a resource:

schedule.overrides.delete(override.id)

Updating a resource:

pagerduty.users.update(user.id, name="Gary Example")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygerduty-0.13.tar.gz (6.4 kB view details)

Uploaded Source

File details

Details for the file pygerduty-0.13.tar.gz.

File metadata

  • Download URL: pygerduty-0.13.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pygerduty-0.13.tar.gz
Algorithm Hash digest
SHA256 7226ff9656a51e9144634bdbac9e7677bc4ef2a2d932f2932e3989ac52b88b54
MD5 17be25ad856f1351ba4f986a00afc3c4
BLAKE2b-256 6cc4e670a1d807492bdee23f33119f27e5c819d9bb18a80c66d58cb80071e9c4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page