Skip to content

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.executions.list()

src.platform.executions.Executions

Executions API wrapper.

Provides access to tool execution-related endpoints through the DeepOriginClient.

Functions

cancel

cancel(execution_id: str) -> None

Cancel a tool execution.

Parameters:

Name Type Description Default
execution_id str

The execution ID to cancel.

required

Returns:

Type Description
None

None. If the execution is already in a terminal state, returns early.

confirm

confirm(execution_id: str) -> None

Confirm a tool execution.

Parameters:

Name Type Description Default
execution_id str

The execution ID to confirm.

required

Returns:

Type Description
None

None.

create

create(
    *,
    tool_key: str,
    tool_version: str,
    data: dict,
    timeout: float | None = None
) -> dict

Create (run) an execution of a tool with a specific version.

Parameters:

Name Type Description Default
tool_key str

Key of the tool to run.

required
tool_version str

Version of the tool to run.

required
data dict

Data transfer object (DTO) containing tool execution parameters. This is typically generated by the make_payload function. If "clusterId" is not present, it will be set to the default cluster ID.

required
timeout float | None

HTTP timeout in seconds for this request. If None, uses TOOL_EXECUTION_POST_TIMEOUT_SECONDS (120s), since quoting and execution creation can exceed the client's default short timeout.

None

Returns:

Type Description
dict

Dictionary containing the execution response from the API.

Raises:

Type Description
Exception

If the tool execution fails, with error details printed.

get

get(execution_id: str) -> dict

Get a tool execution by execution ID.

Parameters:

Name Type Description Default
execution_id str

The execution ID to fetch.

required

Returns:

Type Description
dict

Dictionary containing the tool execution data.

list

list(
    *,
    page: int | None = None,
    page_size: int | None = None,
    order: str | None = None,
    tool_key: str | None = None
) -> dict

List tool executions with pagination and filtering.

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, e.g., "executionId? asc", "completedAt? desc".

None
tool_key str | None

Tool key to filter by.

None

Returns:

Type Description
dict

Dictionary containing paginated execution data.