Miosa.Computer.Ports (Miosa v1.0.1)

Copy Markdown View Source

Per-port visibility control for a computer.

  • GET /computers/:id/ports — list/2
  • POST /computers/:id/ports — create/3
  • PATCH /computers/:id/ports/:port — update/4
  • DELETE /computers/:id/ports/:port — delete/3

The backend does not expose a single-port GET; get/3 filters the list response client-side.

Summary

Functions

Expose a port with the given visibility options (POST /computers/:computer_id/ports).

Stop exposing a port (DELETE /computers/:computer_id/ports/:port).

Return the port record for port, or {:ok, nil} if not exposed.

List all exposed ports (GET /computers/:computer_id/ports).

Patch visibility/auth options for a port (PATCH /computers/:computer_id/ports/:port).

Functions

create(client, computer_id, port, opts \\ %{})

Expose a port with the given visibility options (POST /computers/:computer_id/ports).

delete(client, computer_id, port)

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

Stop exposing a port (DELETE /computers/:computer_id/ports/:port).

get(client, computer_id, port)

@spec get(Miosa.Client.t(), String.t(), pos_integer()) ::
  Miosa.Client.result(map() | nil)

Return the port record for port, or {:ok, nil} if not exposed.

Filters list/2 client-side.

list(client, computer_id)

List all exposed ports (GET /computers/:computer_id/ports).

update(client, computer_id, port, opts)

Patch visibility/auth options for a port (PATCH /computers/:computer_id/ports/:port).