Kathikon.Dashboard.RPC (Kathikon v0.2.1)

Copy Markdown View Source

Remote dashboard calls over Erlang distribution.

Requires the target node to run Kathikon with a matching cookie.

Examples

node = :"kathikon@10.0.0.5"

# Returns the same value as the local Dashboard call — not wrapped again.
{:ok, queues} = Kathikon.Dashboard.RPC.call(node, :queue_summary, [[]])
:ok = Kathikon.Dashboard.RPC.call(node, :pause_all, [])
{:ok, page} = Kathikon.Dashboard.RPC.call(node, :list_jobs, [[queue: :default, limit: 20]])

Only Kathikon.Dashboard functions should be invoked remotely — do not expose arbitrary MFA calls from a UI.

Summary

Functions

Returns whether fun/1 may be called remotely.

Invokes Kathikon.Dashboard.fun/arity on node via :rpc.call/5.

Functions

allowed?(fun)

@spec allowed?(atom()) :: boolean()

Returns whether fun/1 may be called remotely.

call(node, fun, args \\ [], timeout \\ 5000)

@spec call(node(), atom(), [term()], timeout()) ::
  term() | {:error, :badrpc | :nodedown | term()}

Invokes Kathikon.Dashboard.fun/arity on node via :rpc.call/5.

Returns the same value as the local Kathikon.Dashboard call, or {:error, :badrpc}, {:error, :nodedown}, or {:error, {:rpc_not_allowed, fun}}.