Host registration and lifecycle.
A host is a physical or virtual machine you own that has been registered
with MIOSA by installing the miosa-host agent. Once registered, MIOSA can
dispatch jobs, manage files, issue tunnels, and run AI agents on it.
The host_key is returned only on creation — save it immediately.
Summary
Functions
Register a new host.
Stream live host events (SSE).
Get a host by ID.
List all registered hosts.
Revoke a host registration. The host loses access immediately.
Update host metadata (name, labels).
Types
@type result() :: {:ok, map()} | {:error, Miosa.Error.t()}
Functions
@spec create(Miosa.Client.t(), map()) :: result()
Register a new host.
attrs must include :name. Optional: :region, :labels.
The returned map includes host_key — shown once, store it securely.
@spec events(Miosa.Client.t(), String.t(), function()) :: :ok | {:error, Miosa.Error.t()}
Stream live host events (SSE).
The callback is called for each %{type: type, data: data} event map.
Blocks until the stream ends. Returns :ok or {:error, reason}.
@spec get(Miosa.Client.t(), String.t()) :: result()
Get a host by ID.
@spec list( Miosa.Client.t(), keyword() ) :: result()
List all registered hosts.
Options: :page, :per_page.
@spec revoke(Miosa.Client.t(), String.t()) :: result()
Revoke a host registration. The host loses access immediately.
@spec update(Miosa.Client.t(), String.t(), map()) :: result()
Update host metadata (name, labels).