Miosa.Computers (Miosa v1.0.1)

Copy Markdown View Source

Manage MIOSA computers (VM workspaces).

Computers are the core resource: isolated Linux VMs with a full desktop environment, terminal access, and an OSA agent running inside each one.

Example

client = Miosa.client("msk_u_...")

{:ok, computer} = Miosa.Computers.create(client, %{
  name: "my-agent-workspace",
  template_type: "miosa-desktop",
  size: "small"
})

{:ok, computers} = Miosa.Computers.list(client)
{:ok, computer} = Miosa.Computers.get(client, computer.id)
:ok = Miosa.Computers.delete(client, computer.id)

Summary

Functions

Creates a new computer.

Deletes a computer and destroys all associated resources.

Fetches a single computer by ID.

Lists all computers for the authenticated tenant.

Types

create_params()

@type create_params() :: %{
  optional(:name) => String.t(),
  optional(:template_type) => String.t(),
  optional(:size) => String.t(),
  optional(:metadata) => map()
}

Functions

create(client, params \\ %{})

Creates a new computer.

The computer starts in :creating status. Use Miosa.Computer.start/2 to boot it, or poll get/2 until the status becomes :running.

Params

  • :name — Display name (optional, auto-generated if omitted).
  • :template_type — Template to use. Defaults to "miosa-desktop".
  • :size — VM size: "small" (default), "medium", "large".
  • :metadata — Arbitrary key-value map stored with the computer.

delete(client, id, opts \\ [])

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

Deletes a computer and destroys all associated resources.

The computer must be stopped before deletion, or pass force: true to force destroy a running computer (data will be lost).

get(client, id)

Fetches a single computer by ID.

list(client)

Lists all computers for the authenticated tenant.

Returns a list of Miosa.Types.Computer structs ordered by creation time (newest first).