dropbox / pygerduty

A Python library for PagerDuty.
MIT License
163 stars 72 forks source link

Support Collection.count() and exponential-backoff-and-retry #79

Closed jjinno closed 5 years ago

jjinno commented 5 years ago
  1. External pagination required the Collection.count() method to be updated to support when the base_container is not None (ex: when it is an Incident). This looks like it was probably an oversight originally, as most other Collection methods already take this into consideration.
  2. Pagination in the v2 REST API does not use the "count" endpoint anymore. Though empirical evidence suggests they have not removed support for it on the main incidents list, there are multiple documentation/community references that suggest it is no longer supported.
  3. Threading-off pages as parallel requests (note to use one PagerDuty instance per thread) rapidly causes requests to run into HTTP(429) and URLError(), eliciting the need for an exponential-backoff-and-retry loop.
jjinno commented 5 years ago

Accidental PR based on master... will redo