Pygerduty
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 = next(pager.users.list(query="gary", limit=1))
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")
Acknowledging a group by incidents:
me = next(pager.users.list(query="me@you.com", limit=1))
for incident in pagerduty.incidents.list(status='triggered'):
incident.acknowledge(requester_id=me.id)
Metadata
Release files for pygerduty-py3 0.28.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygerduty-py3-0.28.2.tar.gz | 8.8 kB | Without provenance | Details for pygerduty-py3-0.28.2.tar.gz |
Release files / pygerduty-py3-0.28.2.tar.gz
| Download URL | pygerduty-py3-0.28.2.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbe9b67cad5e27ca9932bde745250bfa378740212f7a7a333a71063c2e342406
|
|
BLAKE2b-256 checksum How to use checksums |
47fb30299cc95799558084c9415681d5b0ea16d6bb5d48a7588fd6411e0189a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pygerduty-py3 0.28.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.