Changelog¶
2024-06-03: Version 5.4.1: Final bugfix release
This version backports minor fixes from the new pagerduty package and adds a deprecation warning at import time:
The
r*andj*shorthand request functions no longer error out when the API (i.e.PUT /teams/{team_id}/users/{user_id}) responds with HTTP 204.iter_allnow passes user-supplied arguments thru toiter_cursorwhen short-circuiting to that method for cursor-based pagination endpoints.
2024-12-19: Version 5.4.0:
The package build now includes a universal Python 3 wheel. Contributed by @ymyzk
2024-10-04: Version 5.3.0:
Add support for searching by non-string fields in
pdpyras.APISession.find
2023-12-28: Version 5.2.0:
Expanded use of type hints in place of
:rtypeSphinx directiveRemove unused dependency
deprecationFix bug: path
/tags/{id}/{entity_type}breaks entity wrapping logic (issue #130)
2023-11-15: Version 5.1.3:
Remove deprecated escape sequences, which were causing downstream linter/unit test errors, from docstrings
Remove references to removed properties from the module reference that were causing Sphinx warnings
2023-09-12: Version 5.1.2:
Address issue #115 by adding default values to
pdpyras.PDSession.retryfor Events and Change Events API client classesUpgrade CI images
Add support for Python 3.11
2023-07-18: Version 5.1.1:
Fix bug: using
iter_allon an endpoint that supports cursor-based pagination should correctly call out toiter_cursor(it was making the call but with a removed keyword argument)
2023-06-26: Version 5.1.0:
- New features:
Add the ability to specify a timestamp when submitting a change event by supplying keyword argument
timestamptoChangeEventsAPISession.submitExplicitly include the upstream exception as cause when raising due to a non-transient network error
- Breaking Changes:
- Removal of deprecated functions:
pdpyras.tokenize_url_pathpdpyras.resource_envelopepdpyras.object_typepdpyras.resource_namepdpyras.raise_on_error
- Removal of deprecated keyword arguments:
__init__for all session classes no longer acceptsnamepdpyras.APISession.iter_allno longer acceptspaginatepdpyras.APISession.iter_cursorno longer acceptsattribute
- Removal of deprecated object methods/properties:
pdpyras.APISession.profiler_keypdpyras.APISession.raise_if_http_error
2023-06-07: Version 5.0.4:
Fix bug:
/users/meis also ambiguously matched by canonical path/users/{id}; the solution by @asmith-pd short-circuits if there is an exact match for the URL to a canonical path
2023-05-17: Version 5.0.3:
Incorporate bugfix from #103 by @av1m
Fix the generic issue behind #102 (unsafe mix of string formatting styles)
In HTTP retry exhaustion messages, print only the limit that got reached and not necessarily the per-status HTTP retry
2023-05-01: Version 5.0:
Note: version 5.0.0 has been yanked; patch release v5.0.1 addresses an issue in setup.py.
- New Features:
Methods that assume entity wrapping like
rgetanditer_allnow support all API endpointsProperty
PDSession.print_debugenables printing verbose log messages tosys.stderr
- Breaking Changes:
Removal of the deprecated method
PDSession.set_api_keyEnd support for Python v3.5, which has reached end-of-life.
- Deprecations: the following will be removed in the next minor release, and use of them in v5.0.0 will trigger warnings:
Keyword argument
nameof the session constructor: this previously set the name of the logger; now it has no effect.Keyword argument
paginateofAPISession.iter_all: this previously could be set toFalseto makeiter_allstop iteration after the first page of results; now it has no effect.Keyword argument
attributeofAPISession.iter_cursor: this previously could be used to specify the entity wrapper name of results. The wrapper is now determined automatically and this argument has no effect.Function
tokenize_url_pathFunction (decorator)
resource_envelopeFunction
object_typeFunction
raise_on_errorFunction
resource_nameProperty
APISession.raise_if_http_error: this previously allowed partial results to be returned fromiter_allin the case of HTTP errors; now it has no effect.Function
APISession.profiler_key
2022-10-13: Version 4.5.2
The default value for request timeouts is now 60s.
Method
api_key_accessis now implemented as a property in the classAPISession. Formerly it was implemented in the parent classPDSessionand inherited in classes that did not need it and could not use it.Bug in version 4.5.1 (removed) in package distribution/build fixed
2022-02-22: Version 4.5.0
Add a new API generator
iter_cursortoAPISessionthat yields results from API endpoints that support cursor-based pagination, requesting the next page of results whenever needed.
2022-01-18: Version 4.4.0
Added new error class
PDHTTPErrorfor strictly application-level errors (i.e. HTTP responses vs. network errors), inherits fromPDClientErrorRemoved unnecessary dependencies that were hold-outs from Python 2.7 compatibility (deprecated)
Automatically add square brackets to query parameters that are of list type if the user forgets to do so, per the requirement of using set filters
Fix bug: the
PDSession.stagger_cooldownfeature added in version 3.2 only applied to network error/retry; it now applies to all forms of retrialAdd “update” keyword argument to
APISession.persistthat updates any existing resource with the provided values
2021-06-28: Version 4.3.0
Make timeout configurable per-session as an instance variable (based on a suggestion in pull #48 made by @badnetmask)
Drop support for Python 2.7
Improve code samples formatting improvement (@jackton1 / #65)
Replace deprecated escape sequence for the double-splat operator in docstrings (@ashwin153 / #68)
2021-05-13: Version 4.2.1
Implement work-around for issue in response plays API (issue #61)
2021-05-04: Version 4.2.0
Add new change events API client class (@hunner / #56)
2021-03-18: Version 4.1.4
- Fix regression in
EventsAPISession.post Use case: explicitly-defined body (
jsonkeyword argument) without arouting_keyparameterThis was previously possible (before version 4.1.3) with the
X-Routing-Keyheader (an undocumented API feature)
- Fix regression in
2021-03-10: Version 4.1.3
Use documented method for including the routing key in the request for API V2 (addresses #53)
Add warning for Python 2.7
Configurable timeout: argument to
requests.Session.requestset in default args to backwards-compatible 5 second value that can be set at the module level (@ctrlaltdel / #48)
2020-09-15: Version 4.1.2
- Address issue #37 and add other enhancements to
iter_all: Stop iteration in
iter_allif the iteration limit (10000) is encountered, versus erroring out (because exceeding it will elicit a 400 response)Add the ability to set an initial offset via
paramsversus always starting fromoffset=0initer_all
- Address issue #37 and add other enhancements to
Capitalize “constants”
2020-06-26: Version 4.1.1
Define class variable
retryinitially as{}instead ofNone(#32)
2020-03-08: Version: 4.1
Added new idempotent resource creator function,
APISession.persistAdded the ability to use resource dictionaries (that have a
selfattribute) in place of URLs.
2020-02-04: Version 4.0
Added support for using OAuth 2 access tokens to authenticate (#23)
Added a property that indicates the access level/scope of a given API credential (#22)
2020-01-10: version 3.2.1
Fixed bug in
APISession.trunc_token; property name typo causesAttributeError
2019-10-31: version 3.2
The page size (
limit) parameter can now be set on a per-call basis in any of the*_allmethods (i.e.PDSession.iter_all) by passing thepage_sizekeyword argument. If the argument is not present, the default page size will be used.The
X-Request-Idheader in responses is now captured in log messages to make it easier to identify API calls when communicating with PagerDuty SupportExtended API call metadata is also now logged.
The cooldown time between rate limit responses can optionally be randomized by setting
PDSession.stagger_cooldownto a positive number.
2019-10-01: version 3.1.2
Fixed regression bug / departure from documentation (#17): the
payloadparameter does not merge with but rather completely replaces the default payload
2019-04-05: version 3.1.1
- Changed behavior of HTTP retry that caused issues with some internal tools: raising
PDClientErrorin the event of non-transient HTTP error, in therequestmethod, versus returning the request object and logging it. The previous behavior was: Not the intended design
At odds with the documentated behavior
- Changed behavior of HTTP retry that caused issues with some internal tools: raising
2019-04-05: version 3.1:
Introduction of a custom
User-Agentheader to distinguish the API client as such, for the purposes of usage analytics
2019-04-02: version 3.0.2:
Important bug fixes to the custom HTTP retry logic:
Fixed
KeyErrorinAPISession.requestFixed incorrect behavior (retrying more than the specified amount of times) due to faulty comparison logic
2019-03-14: version 3.0.1:
A light Events API client methods refactor:
All keyword arguments specific to sending trigger events have been refactored out of the generic
EventsAPISession.send_eventmethodNow, instead,
send_eventand uses a catch-all keyword argument to set event properties.The keyword arguments specific to triggering incidents are in the method EventsAPISession.trigger method.
2019-03-12: version 3.0:
Added new Events API session class that still has most of the same functional features as the REST API session class.
2019-01-28: version 2.4.1:
Fixed bug: unpacking wrapped entities does not work with
/log_entries
2019-01-10: version 2.4:
Whitelisting of endpoints supported by the
r*/*_allmethods has been rescinded, and documentation has been updated with how to identify endpoints that these methods can be used with.
2019-01-03: version 2.3:
More helpful error messaging when using
r*/*_allmethods on endpoints they don’t supportResource envelope auto-unpacking no longer validates for the presence of a
typeproperty in order to support posting to business impact metrics
2018-12-04: version 2.2:
Methods
list_allanddict_allturn all results from an index into a list/dict to save a bit of effort
2018-11-28: version 2.1:
Support for performing multi-update actions (i.e. Manage Incidents) via the
rputmethod.The default behavior of
iter_allis now to raise an exception if an error response is received from the API during iteration.
Changelog Started 2018-11-28