Skip to content

Commit 3c8c3e9

Browse files
committed
📝 docs: add documentation about retry options
1 parent f42827f commit 3c8c3e9

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ In the file, you can set a default profile, naming `default`. It will be used if
3737
## Environment variables
3838

3939
```bash
40+
$ export OSC_PROFILE=<PROFILE> (default: "default")
41+
$ # or
4042
$ export OSC_ACCESS_KEY=<ACCESS_KEY>
4143
$ export OSC_SECRET_KEY=<SECRET_KEY>
4244
$ # optional
4345
$ export OSC_REGION=<REGION> (default: eu-west-2)
46+
$ export OSC_MAX_RETRIES=<INT> (default: 3)
47+
$ export OSC_RETRY_BACKOFF_FACTOR=<FLOAT> (default: 1.0)
48+
$ export OSC_RETRY_BACKOFF_JITTER=<FLOAT> (default: 3.0)
4449
```
4550

4651
## Credentials files
@@ -81,9 +86,25 @@ gw = Gateway(email="your@email.com", password="youAccountPassword")
8186
keys = gw.ReadAccessKeys()
8287
```
8388

89+
## Retry Options
90+
91+
The following options can be provided when initializing the Gateway to customize the retry behavior of the SDK.
92+
93+
These options are:
94+
- max_retries (integer, default 3)
95+
- retry_backoff_factor (float, default 1.0)
96+
- retry_backoff_jitter (float, default 3.0)
97+
98+
Those options correspond to their counterparts in [urllib3](https://urllib3.readthedocs.io/en/stable/reference/urllib3.util.html#urllib3.util.Retry)
99+
100+
Example:
101+
```python
102+
gw = Gateway(max_retries=5, retry_backoff_factor=0.5, retry_backoff_jitter=1.0)
103+
````
104+
84105
# Example
85106

86-
A simple example which prints all your Virtual Machine and Volume ids.
107+
A simple example that prints all your Virtual Machine and Volume IDs.
87108
```python
88109
from osc_sdk_python import Gateway
89110

0 commit comments

Comments
 (0)