Miosa.Workspaces (Miosa v1.0.1)

Copy Markdown View Source

Manage MIOSA workspaces.

A workspace groups one or more computers under a shared project boundary. Workspaces are identified by an ID and carry a display name and optional metadata. Every computer belongs to exactly one workspace.

Example

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

{:ok, ws} = Miosa.Workspaces.create(client, %{name: "my-project"})
{:ok, workspaces} = Miosa.Workspaces.list(client)
{:ok, ws} = Miosa.Workspaces.get(client, ws.id)
{:ok, ws} = Miosa.Workspaces.update(client, ws.id, %{name: "renamed"})
{:ok, computers} = Miosa.Workspaces.list_computers(client, ws.id)
:ok = Miosa.Workspaces.delete(client, ws.id)

Summary

Functions

Creates a new workspace.

Deletes a workspace.

Fetches a single workspace by ID.

Lists all workspaces for the authenticated tenant.

Lists all computers belonging to a workspace.

Updates a workspace's attributes.

Types

create_params()

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

update_params()

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

Functions

create(client, params)

Creates a new workspace.

Params

  • :name — Required. Display name for the workspace.
  • :metadata — Optional. Arbitrary key-value map.

delete(client, id)

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

Deletes a workspace.

All computers in the workspace must be stopped or destroyed before deletion, or the API will return a 409 conflict.

get(client, id)

Fetches a single workspace by ID.

list(client)

Lists all workspaces for the authenticated tenant.

list_computers(client, workspace_id)

Lists all computers belonging to a workspace.

update(client, id, params)

Updates a workspace's attributes.

Only the supplied fields are updated (PATCH semantics).