ExIncus.Event (ex_incus v1.0.0)

Copy Markdown

An event from the Incus event stream (/1.0/events), as delivered by ExIncus.EventListener.

The envelope fields (:type, :timestamp, :project, :location) are present on every event. For lifecycle events the interesting bits are lifted to the top level:

  • :action - e.g. "instance-created", "instance-started", "instance-stopped", "instance-ready", "instance-deleted"
  • :source - API path of the affected object, e.g. "/1.0/instances/web1"
  • :name - last segment of :source (the instance/network/... name)

The raw event payload is kept in :metadata: for operation events that is the full operation state (id, status, progress), for logging events the message and level.

Summary

Types

t()

@type t() :: %ExIncus.Event{
  action: String.t() | nil,
  location: String.t() | nil,
  metadata: map(),
  name: String.t() | nil,
  project: String.t() | nil,
  source: String.t() | nil,
  timestamp: DateTime.t() | String.t() | nil,
  type: :lifecycle | :operation | :logging | String.t()
}