Skip to content

Parameters

If in the request is_async is set to False the request will become a blocking operation. The client will not receive a response from LSO until the executable has completed. The response then contains the output from the executable. With is_async set to True, LSO will immediately give a response containing only the job ID. To get the output from the excutable once completed, a callback URL must be included in the request.

Request

When posting to the API endpoint to start an executable, the following attributes can be set.

lso.routes.execute.ExecutableRunParams

Bases: pydantic.BaseModel

Request parameters for running an arbitrary executable.

Attributes: executable_name (ExecutableName): The absolute path to the executable. args (list[str], optional): A list of arguments that is provided to the script. callback (HttpUrl, optional): A callback URL where the execution result of the script is posted to. is_async (bool, optional): Whether this script should be executed asynchronously.

Source code in .venv/lib/python3.12/site-packages/lso/routes/execute.py
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
class ExecutableRunParams(BaseModel):
    """Request parameters for running an arbitrary executable.

    Attributes:
        executable_name (ExecutableName): The absolute path to the executable.
        args (list[str], optional): A list of arguments that is provided to the script.
        callback (HttpUrl, optional): A callback URL where the execution result of the script is posted to.
        is_async (bool, optional): Whether this script should be executed asynchronously.

    """

    executable_name: ExecutableName
    args: list[str] = []
    callback: HttpUrl | None = None
    is_async: bool = True

Response

Once the API request is received, it returns a response that contains the following attributes.

lso.routes.execute.ExecutableRunResponse

Bases: pydantic.BaseModel

Response for running an arbitrary executable.

Attributes: job_id (UUID): Unique identifier for the executable run. result (ExecutionResult, optional): Executable result if the request was made with is_async set to False, None otherwise.

Source code in .venv/lib/python3.12/site-packages/lso/schema.py
53
54
55
56
57
58
59
60
61
62
63
64
class ExecutableRunResponse(BaseModel):
    """Response for running an arbitrary executable.

    Attributes:
        job_id (UUID): Unique identifier for the executable run.
        result (ExecutionResult, optional): Executable result if the request was made with `is_async` set to `False`,
            `None` otherwise.

    """

    job_id: UUID
    result: ExecutionResult | None = None