Tools API.¶
The DeepOriginClient can be used to access the tools API using:
from deeporigin.platform.client import DeepOriginClient
client = DeepOriginClient()
Then, the following methods can be used, for example:
tools = client.clusters.list()
src.platform.clusters.Clusters
¶
Clusters API wrapper.
Provides access to clusters-related endpoints through the DeepOriginClient.
Functions¶
get_default_cluster_id
¶
get_default_cluster_id() -> str
Get the default cluster ID for the client.
Returns the first cluster that does not have "dev" in the hostname. The result is cached per instance.
Returns:
| Type | Description |
|---|---|
str
|
The ID of the default cluster. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no clusters are found (excluding dev clusters). |
list
¶
list(
*,
page: int | None = None,
page_size: int | None = None,
order: str | None = None,
filter: str | None = None
) -> dict
List all clusters associated with the organization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
int | None
|
Page number of the pagination (default 0). |
None
|
page_size
|
int | None
|
Page size of the pagination (max 10,000). |
None
|
order
|
str | None
|
Order of the pagination, can be any of the following: hostname? asc | desc, name? asc | desc, orgKey? asc | desc, enabled? asc | desc, status? asc | desc. |
None
|
filter
|
str | None
|
Filter applied to the data set. |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary containing 'data' (list of cluster dictionaries) and |
dict
|
'pagination' (pagination metadata). |