Misc utility functions and constants
This is a decorator which can be used to mark methods as deprecated. It will result in a warning being emitted when the function is used.
- to_be_removed_in_version (str) – Version of this module the decorated method will be removed in.
- new_method (function) – Method intended to replace the decorated method. This method’s docstrings are included in the decorated method’s docstring.
Wrapped function that includes a deprecation warning and update docstrings from the replacement method.
raise_for_error(status_code, message=None, errors=None)¶
Helper method to raise exceptions based on the status code of a response received back from Vault.
- status_code (int) – Status code received in a response from Vault.
- message (str) – Optional message to include in a resulting exception.
- errors (list | str) – Optional errors to include in a resulting exception.
hvac.exceptions.InvalidRequest | hvac.exceptions.Unauthorized | hvac.exceptions.Forbidden | hvac.exceptions.InvalidPath | hvac.exceptions.RateLimitExceeded | hvac.exceptions.InternalServerError | hvac.exceptions.VaultNotInitialized | hvac.exceptions.VaultDown | hvac.exceptions.UnexpectedError