Miosa.Computer.Logs (Miosa v1.0.1)

Copy Markdown View Source

Read and stream VM logs for a computer.

  • GET /computers/:id/logs — snapshot (JSON)
  • GET /computers/:id/logs/stream — live SSE stream

Summary

Functions

Fetch the most recent log snapshot (GET /computers/:computer_id/logs).

Stream live log events via SSE (GET /computers/:computer_id/logs/stream).

Functions

get(client, computer_id, opts \\ %{})

Fetch the most recent log snapshot (GET /computers/:computer_id/logs).

Options

  • :lines — Number of log lines to return.
  • :since — ISO8601 timestamp; return only lines after this time.

stream(client, computer_id, callback)

@spec stream(Miosa.Client.t(), String.t(), function()) ::
  :ok | {:error, Miosa.Error.t()}

Stream live log events via SSE (GET /computers/:computer_id/logs/stream).

callback is called for each event map %{type: ..., data: ...}. Returns :ok when the stream closes or {:error, reason} on failure.