ExDaytona.Api.Interpreter (ex_daytona v0.2.0)

Copy Markdown View Source

API calls for all endpoints tagged Interpreter.

Summary

Functions

Create a new interpreter context Creates a new isolated interpreter context with optional working directory and language

Delete an interpreter context Deletes an interpreter context and shuts down its worker process

Execute code in an interpreter context Executes code in a specified context (or default context if not specified) via WebSocket streaming

List all user-created interpreter contexts Returns information about all user-created interpreter contexts (excludes default context)

Functions

create_interpreter_context(connection, create_context_request, opts \\ [])

Create a new interpreter context Creates a new isolated interpreter context with optional working directory and language

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • create_context_request (CreateContextRequest): Context configuration
  • opts (keyword): Optional parameters

Returns

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

delete_interpreter_context(connection, id, opts \\ [])

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

Delete an interpreter context Deletes an interpreter context and shuts down its worker process

Parameters

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

Returns

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

execute_interpreter_code(connection, opts \\ [])

@spec execute_interpreter_code(
  Tesla.Env.client(),
  keyword()
) :: {:ok, String.t()} | {:error, Tesla.Env.t()}

Execute code in an interpreter context Executes code in a specified context (or default context if not specified) via WebSocket streaming

Parameters

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

Returns

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

list_interpreter_contexts(connection, opts \\ [])

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

List all user-created interpreter contexts Returns information about all user-created interpreter contexts (excludes default context)

Parameters

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

Returns

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