Opsmaru.Incus.Migration (opsmaru_incus v0.1.0)

Copy Markdown View Source

Native pull/push/relay negotiation between two explicit host-bound clients.

negotiate/5 takes source and target native request tuples {method_name, arguments, body}. The host supplies the target configuration and approves exactly one HTTPS origin for pull/push. Advertised backend addresses are never followed. It returns accepted operation handles, not completed workloads. Failures retain every accepted handle and never retry, cancel or delete backend data. relay/2 explicitly forwards bounded native WebSocket channels; reset/reconnection requires caller reconciliation.

Summary

Functions

Native RemoteOperation AddHandler: forwards to the accepted target operation. Without a target, native returns a placeholder that is never registered; this returns {:ok, nil}.

Explicit supported target cancellation; source identity/data remain available.

Forward accepted relay channels until EOF or a bounded deadline; does not await backend completion.

Read the accepted target handle; this performs no I/O or completion wait.

Wait for authoritative target completion within its budget; source completion is separate.

Functions

add_handler(migration, listener, callback)

Native RemoteOperation AddHandler: forwards to the accepted target operation. Without a target, native returns a placeholder that is never registered; this returns {:ok, nil}.

cancel_target(migration)

Explicit supported target cancellation; source identity/data remain available.

negotiate(source, target, source_request, target_request, opts \\ [])

relay(migration, opts \\ [])

Forward accepted relay channels until EOF or a bounded deadline; does not await backend completion.

target(migration)

Read the accepted target handle; this performs no I/O or completion wait.

wait_target(migration, opts \\ [])

Wait for authoritative target completion within its budget; source completion is separate.