Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Aug 6, 2024
1 parent da6b7d0 commit 56ca930
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion hcloud/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,33 @@ def func(retries: int) -> float:


class Client:
"""Base Client for accessing the Hetzner Cloud API"""
"""
Client for the Hetzner Cloud API.
The Hetzner Cloud API reference is available at https://docs.hetzner.cloud.
**Retry mechanism**
The :attr:`Client.request` method will retry failed requests that match certain criteria. The
default retry interval is defined by an exponential backoff algorithm truncated to 60s
with jitter. The default maximal number of retries is 5.
The following rules defines when a request can be retried:
- When the client returned a network timeout error.
- When the API returned an HTTP error, with the status code:
- ``502`` Bad Gateway
- ``504`` Gateway Timeout
- When the API returned an application error, with the code:
- ``conflict``
- ``rate_limit_exceeded``
Changes to the retry policy might occur between releases, and will not be considered
breaking changes.
"""

_version = __version__
__user_agent_prefix = "hcloud-python"
Expand Down

0 comments on commit 56ca930

Please sign in to comment.