Remote job execution on registered hosts.
Jobs dispatch shell commands to a registered host and return the result once the command completes.
Summary
Functions
Cancel a running job.
Get a specific job by ID.
List jobs for a host.
Run a command on a host and return the completed job.
Stream live output events from a running job (SSE).
Types
@type result() :: {:ok, map()} | {:error, Miosa.Error.t()}
Functions
@spec cancel(Miosa.Client.t(), String.t(), String.t()) :: result()
Cancel a running job.
@spec get(Miosa.Client.t(), String.t(), String.t()) :: result()
Get a specific job by ID.
@spec list(Miosa.Client.t(), String.t(), keyword()) :: result()
List jobs for a host.
@spec run(Miosa.Client.t(), String.t(), map()) :: result()
Run a command on a host and return the completed job.
attrs must include :command. Optional: :args, :env, :cwd, :timeout.
@spec stream(Miosa.Client.t(), String.t(), String.t(), function()) :: :ok | {:error, Miosa.Error.t()}
Stream live output events from a running job (SSE).
The callback receives %{type: type, data: data} maps. Blocks until done.