From d521ca387dc14db0202ae0c10e2632bc1a1d4f97 Mon Sep 17 00:00:00 2001 From: "Ch.-David Blot" Date: Thu, 11 Sep 2025 09:15:10 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs:=20add=20documentation=20ab?= =?UTF-8?q?out=20retry=20options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 64e0447..ea6c695 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,15 @@ In the file, you can set a default profile, naming `default`. It will be used if ## Environment variables ```bash +$ export OSC_PROFILE= (default: "default") +$ # or $ export OSC_ACCESS_KEY= $ export OSC_SECRET_KEY= $ # optional $ export OSC_REGION= (default: eu-west-2) +$ export OSC_MAX_RETRIES= (default: 3) +$ export OSC_RETRY_BACKOFF_FACTOR= (default: 1.0) +$ export OSC_RETRY_BACKOFF_JITTER= (default: 3.0) ``` ## Credentials files @@ -81,9 +86,25 @@ gw = Gateway(email="your@email.com", password="youAccountPassword") keys = gw.ReadAccessKeys() ``` +## Retry Options + +The following options can be provided when initializing the Gateway to customize the retry behavior of the SDK. + +These options are: + - max_retries (integer, default 3) + - retry_backoff_factor (float, default 1.0) + - retry_backoff_jitter (float, default 3.0) + +Those options correspond to their counterparts in [urllib3](https://urllib3.readthedocs.io/en/stable/reference/urllib3.util.html#urllib3.util.Retry) + +Example: +```python +gw = Gateway(max_retries=5, retry_backoff_factor=0.5, retry_backoff_jitter=1.0) +```` + # Example -A simple example which prints all your Virtual Machine and Volume ids. +A simple example that prints all your Virtual Machine and Volume IDs. ```python from osc_sdk_python import Gateway