Skip to content

Commit 6e59690

Browse files
DOC-5712 update for new Python API
1 parent cce50c9 commit 6e59690

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

content/develop/clients/redis-py/connect.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,21 +262,21 @@ lets a client take action to avoid disruptions in service.
262262
See [Smart client handoffs]({{< relref "/develop/clients/sch" >}})
263263
for more information about SCH.
264264

265-
To enable SCH on the client, pass a `MaintenanceEventsConfig` object
265+
To enable SCH on the client, pass a `MaintNotificationsConfig` object
266266
during the connection, as shown in the following example:
267267

268268
```py
269269
import redis
270-
from redis.connection import MaintenanceEventsConfig
271-
from redis.maintenance_events import EndpointType
270+
from redis.maint_notifications import MaintNotificationsConfig, EndpointType
272271

273272
r = redis.Redis(
274273
decode_responses=True,
275274
protocol=3,
276-
maintenance_events_config = MaintenanceEventsConfig(
275+
maint_notifications_config = MaintNotificationsConfig(
277276
enabled=True,
278277
proactive_reconnect=True,
279-
relax_timeout=10,
278+
relaxed_timeout=10,
279+
endpoint_type=EndpointType.EXTERNAL_IP
280280
),
281281
...
282282
)
@@ -286,10 +286,11 @@ r = redis.Redis(
286286
protocol, so you must set `protocol=3` explicitly when you connect.
287287
{{< /note >}}
288288

289-
The `MaintenanceEventsConfig` constructor accepts the following parameters:
289+
The `MaintNotificationsConfig` constructor accepts the following parameters:
290290

291291
| Name | Type | Default | Description |
292292
|------|------|---------|-------------|
293293
| `enabled` | `bool` | `False` | Whether or not to enable SCH. |
294294
| `proactive_reconnect` | `bool` | `True` | Whether or not to automatically reconnect when a node is replaced. |
295-
| `relax_timeout` | `int` | `20` | The timeout (in seconds) to use while the server is performing maintenance. A value of `-1` disables the relax timeout and just uses the normal timeout during maintenance. |
295+
| `endpoint_type` | `EndpointType` | Auto-detect | The type of endpoint to use for the connection. The options are `EndpointType.EXTERNAL_IP`, `EndpointType.INTERNAL_IP`, `EndpointType.EXTERNAL_FQDN`, `EndpointType.INTERNAL_FQDN`, and `EndpointType.NONE`. |
296+
| `relaxed_timeout` | `int` | `20` | The timeout (in seconds) to use while the server is performing maintenance. A value of `-1` disables the relax timeout and just uses the normal timeout during maintenance. |

0 commit comments

Comments
 (0)