Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/sap_cloud_sdk/dms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ def create_client(
*,
instance: Optional[str] = None,
dms_cred: Optional[DMSCredentials] = None,
connect_timeout: Optional[int] = None,
read_timeout: Optional[int] = None,
_telemetry_source: Optional[Module] = None,
):
"""Create a DMS client with automatic credential resolution.

Args:
instance: Logical instance name for secret resolution. Defaults to ``"default"``.
dms_cred: Explicit credentials. If provided, skips secret resolution.
connect_timeout: TCP connection timeout in seconds. Defaults to 10.
read_timeout: Response read timeout in seconds. Defaults to 30.
_telemetry_source: Internal telemetry source identifier. Not intended for external use.

Returns:
Expand All @@ -55,7 +59,11 @@ def create_client(
"""
try:
credentials = dms_cred or load_sdm_config_from_env_or_mount(instance)
client = DMSClient(credentials)
client = DMSClient(
credentials,
connect_timeout=connect_timeout,
read_timeout=read_timeout,
)
client._telemetry_source = _telemetry_source
return client
except Exception as e:
Expand Down
5 changes: 5 additions & 0 deletions src/sap_cloud_sdk/dms/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ def __init__(
) -> None:
"""Initialise a DMSClient.

Note:
Do not call this constructor directly. Use create_client() from
sap_cloud_sdk.dms instead, which properly configures
authentication and handles environment detection.

Args:
credentials: OAuth2 credentials and service URI for the DMS instance.
connect_timeout: TCP connection timeout in seconds. Defaults to 10.
Expand Down
Loading