View Source Datapio.K8s.Event (Datapio OpenCore v0.1.0)
This module allows you to create and publish custom Kubernetes Events. For more information about the Event spec, please read this reference.
Usage example:
alias Datapio.K8s.Event
{:ok, conn} = Datapio.K8s.Conn.lookup()
operation = K8s.Client.get("apps/v1", :deployment, [namespace: "default", name: "nginx-deployment"])
{:ok, deployment} = K8s.Client.run(conn, operation)
Event.new(name: "some-prefix", namespace: "default")
|> Event.action("notify")
|> Event.reporting_controller("my-app")
|> Event.reporting_instance("my-app-0")
|> Event.regarding(deployment)
|> Event.type(:normal)
|> Event.reason("TestMessage")
|> Event.message("This is an example")
|> Event.time(:now)
|> Event.publish(conn)
Link to this section Summary
Functions
Specify what action was taken/failed
Specify the message describing this event
Create a new event
Publish the event to Kubernetes
Specify the reason of the event
Specify the object this event is about
Specify a secondary object this event is related to
Specify the name of the controller that emitted this Event
Specify the ID of the controller instance
Specify the time at which the event was first observed
Specify the type of the event
Link to this section Types
Specs
partial() :: t()
Represent a partial Kubernetes Event (not publishable yet)
Specs
t() :: Datapio.K8s.Resource.t()
Represent a Kubernetes Event
Link to this section Functions
Specs
Specify what action was taken/failed
Specs
Specify the message describing this event
Specs
Create a new event
Specs
publish(t(), K8s.Conn.t()) :: {:ok, any()} | {:error, term()}
Publish the event to Kubernetes
Specs
Specify the reason of the event
Specs
regarding(partial(), Datapio.K8s.Resource.t()) :: partial()
Specify the object this event is about
Specs
Specify the name of the controller that emitted this Event
Specs
Specify the ID of the controller instance
Specs
time(partial(), :now | DateTime.t()) :: partial()
Specify the time at which the event was first observed
Specs
Specify the type of the event