ExDaytona.Api.Process (ex_daytona v0.4.0)

Copy Markdown View Source

API calls for all endpoints tagged Process.

Summary

Functions

Execute code Execute Python, JavaScript, or TypeScript code and return output, exit code, and artifacts

Connect to PTY session via WebSocket Establish a WebSocket connection to interact with a pseudo-terminal session

Create a new PTY session Create a new pseudo-terminal session with specified configuration

Create a new session Create a new shell session for command execution

Delete a PTY session Delete a pseudo-terminal session and terminate its process

Delete a session Delete an existing shell session

Execute a command Execute a shell command and return the output and exit code

Get entrypoint logs Get logs for a sandbox entrypoint session. Returns JSON with separated stdout/stderr for SDK >= 0.161.0, plain text otherwise. Supports WebSocket streaming.

Get entrypoint session details Get details of an entrypoint session including its commands

Get PTY session information Get detailed information about a specific pseudo-terminal session

Get session details Get details of a specific session including its commands

Get session command details Get details of a specific command within a session

Get session command logs Get logs for a specific command within a session. Returns JSON with separated stdout/stderr for SDK >= 0.167.0, plain text otherwise. Supports WebSocket streaming.

List all PTY sessions Get a list of all active pseudo-terminal sessions

List all sessions Get a list of all active shell sessions

Resize a PTY session Resize the terminal dimensions of a pseudo-terminal session

Send input to command Send input data to a running command in a session for interactive execution

Execute command in session Execute a command within an existing shell session

Functions

code_run(connection, code_run_request, opts \\ [])

Execute code Execute Python, JavaScript, or TypeScript code and return output, exit code, and artifacts

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • code_run_request (CodeRunRequest): Code execution request
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.CodeRunResponse.t} on success
  • {:error, Tesla.Env.t} on failure

connect_pty_session(connection, session_id, opts \\ [])

@spec connect_pty_session(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Connect to PTY session via WebSocket Establish a WebSocket connection to interact with a pseudo-terminal session

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • session_id (String.t): PTY session ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

create_pty_session(connection, pty_create_request, opts \\ [])

Create a new PTY session Create a new pseudo-terminal session with specified configuration

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • pty_create_request (PtyCreateRequest): PTY session creation request
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.PtyCreateResponse.t} on success
  • {:error, Tesla.Env.t} on failure

create_session(connection, create_session_request, opts \\ [])

@spec create_session(
  Tesla.Env.client(),
  ExDaytona.Model.CreateSessionRequest.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Create a new session Create a new shell session for command execution

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • create_session_request (CreateSessionRequest): Session creation request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

delete_pty_session(connection, session_id, opts \\ [])

@spec delete_pty_session(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, %{optional(String.t()) => any()}}
  | {:error, Tesla.Env.t()}

Delete a PTY session Delete a pseudo-terminal session and terminate its process

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • session_id (String.t): PTY session ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

delete_session(connection, session_id, opts \\ [])

@spec delete_session(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Delete a session Delete an existing shell session

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • session_id (String.t): Session ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

execute_command(connection, execute_request, opts \\ [])

Execute a command Execute a shell command and return the output and exit code

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • execute_request (ExecuteRequest): Command execution request
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.ExecuteResponse.t} on success
  • {:error, Tesla.Env.t} on failure

get_entrypoint_logs(connection, opts \\ [])

@spec get_entrypoint_logs(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, ExDaytona.Model.SessionCommandLogsResponse.t()}
  | {:error, Tesla.Env.t()}

Get entrypoint logs Get logs for a sandbox entrypoint session. Returns JSON with separated stdout/stderr for SDK >= 0.161.0, plain text otherwise. Supports WebSocket streaming.

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :follow (boolean()): Follow logs in real-time (WebSocket only)

Returns

  • {:ok, ExDaytona.Model.SessionCommandLogsResponse.t} on success
  • {:error, Tesla.Env.t} on failure

get_entrypoint_session(connection, opts \\ [])

@spec get_entrypoint_session(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, ExDaytona.Model.Session.t()}
  | {:error, Tesla.Env.t()}

Get entrypoint session details Get details of an entrypoint session including its commands

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.Session.t} on success
  • {:error, Tesla.Env.t} on failure

get_pty_session(connection, session_id, opts \\ [])

@spec get_pty_session(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, ExDaytona.Model.PtySessionInfo.t()}
  | {:error, Tesla.Env.t()}

Get PTY session information Get detailed information about a specific pseudo-terminal session

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • session_id (String.t): PTY session ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.PtySessionInfo.t} on success
  • {:error, Tesla.Env.t} on failure

get_session(connection, session_id, opts \\ [])

@spec get_session(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, ExDaytona.Model.Session.t()}
  | {:error, Tesla.Env.t()}

Get session details Get details of a specific session including its commands

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • session_id (String.t): Session ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.Session.t} on success
  • {:error, Tesla.Env.t} on failure

get_session_command(connection, session_id, command_id, opts \\ [])

@spec get_session_command(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.Command.t()}
  | {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Get session command details Get details of a specific command within a session

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • session_id (String.t): Session ID
  • command_id (String.t): Command ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.Command.t} on success
  • {:error, Tesla.Env.t} on failure

get_session_command_logs(connection, session_id, command_id, opts \\ [])

@spec get_session_command_logs(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, ExDaytona.Model.SessionCommandLogsResponse.t()}
  | {:error, Tesla.Env.t()}

Get session command logs Get logs for a specific command within a session. Returns JSON with separated stdout/stderr for SDK >= 0.167.0, plain text otherwise. Supports WebSocket streaming.

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • session_id (String.t): Session ID
  • command_id (String.t): Command ID
  • opts (keyword): Optional parameters
    • :follow (boolean()): Follow logs in real-time (WebSocket only)

Returns

  • {:ok, ExDaytona.Model.SessionCommandLogsResponse.t} on success
  • {:error, Tesla.Env.t} on failure

list_pty_sessions(connection, opts \\ [])

@spec list_pty_sessions(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, ExDaytona.Model.PtyListResponse.t()}
  | {:error, Tesla.Env.t()}

List all PTY sessions Get a list of all active pseudo-terminal sessions

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.PtyListResponse.t} on success
  • {:error, Tesla.Env.t} on failure

list_sessions(connection, opts \\ [])

@spec list_sessions(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, ExDaytona.Model.ErrorResponse.t()}
  | {:ok, [ExDaytona.Model.Session.t()]}
  | {:error, Tesla.Env.t()}

List all sessions Get a list of all active shell sessions

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, [%Session{}, ...]} on success
  • {:error, Tesla.Env.t} on failure

resize_pty_session(connection, session_id, pty_resize_request, opts \\ [])

Resize a PTY session Resize the terminal dimensions of a pseudo-terminal session

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • session_id (String.t): PTY session ID
  • pty_resize_request (PtyResizeRequest): Resize request with new dimensions
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.PtySessionInfo.t} on success
  • {:error, Tesla.Env.t} on failure

send_input(connection, session_id, command_id, session_send_input_request, opts \\ [])

Send input to command Send input data to a running command in a session for interactive execution

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • session_id (String.t): Session ID
  • command_id (String.t): Command ID
  • session_send_input_request (SessionSendInputRequest): Input send request
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

session_execute_command(connection, session_id, session_execute_request, opts \\ [])

Execute command in session Execute a command within an existing shell session

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • session_id (String.t): Session ID
  • session_execute_request (SessionExecuteRequest): Command execution request
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExDaytona.Model.SessionExecuteResponse.t} on success
  • {:error, Tesla.Env.t} on failure