DiscoveryClient
DiscoveryClient
evo.compute.discovery.DiscoveryClient
List the compute task catalogue for an organization.
Returned tasks are independent copies, so editing them does not affect the cache.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connector | APIConnector | The API connector to use. | required |
org_id | UUID | The organization ID. | required |
cache_ttl_seconds | float | How long a fetched catalogue is cached before the next call re-fetches it. Pass force_refresh=True to any accessor to re-fetch sooner. | DEFAULT_CACHE_TTL_SECONDS |
org_id property
The organization ID.
from_context classmethod
Create a DiscoveryClient from any real evo.common.IContext.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context | IContext | The context to create the client from (provides the connector and org id). | required |
cache_ttl_seconds | float | The catalogue cache time-to-live, in seconds. | DEFAULT_CACHE_TTL_SECONDS |
Returns:
| Type | Description |
|---|---|
DiscoveryClient | A DiscoveryClient instance. |
list_tasks async
Return the full catalogue of discoverable tasks.
Served from the cache while it is within its TTL; pass force_refresh=True to re-fetch immediately.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force_refresh | bool | Re-fetch the catalogue even if the cache is still valid. | False |
Returns:
| Type | Description |
|---|---|
list[TaskResource] | Every advertised task. |
get_topics async
Return the sorted list of topics that have discoverable tasks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force_refresh | bool | Re-fetch the catalogue even if the cache is still valid. | False |
get_topic_tasks async
Return the tasks advertised within a single topic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
topic | str | The task topic. | required |
force_refresh | bool | Re-fetch the catalogue even if the cache is still valid. | False |
Returns:
| Type | Description |
|---|---|
list[TaskResource] | The tasks in the topic (empty if the topic is not advertised). |
get_task async
Return a single task by topic and name, or None if it is not advertised.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
topic | str | The task topic. | required |
name | str | The task name as advertised by the platform (e.g. kriging). | required |
force_refresh | bool | Re-fetch the catalogue even if the cache is still valid. | False |
Returns:
| Type | Description |
|---|---|
TaskResource | None | The matching task, or None. |