1package v1
2
3import (
4 "cue.dev/x/k8s.io/apimachinery/pkg/apis/meta/v1"
5 v1_9 "cue.dev/x/k8s.io/api/core/v1"
6)
7
8// Event is a report of an event somewhere in the cluster. It generally denotes
9// some state change in the system. Events have a limited retention time and
10// triggers and messages may evolve with time. Event consumers should not rely
11// on the timing of an event with a given Reason reflecting a consistent
12// underlying trigger, or the continued existence of events with that Reason.
13// Events should be treated as informative, best-effort, supplemental data.
14#Event: {
15 // action is what action was taken/failed regarding to the regarding object. It
16 // is machine-readable. This field cannot be empty for new Events and it can
17 // have at most 128 characters.
18 "action"?: string
19
20 // APIVersion defines the versioned schema of this representation of an object.
21 // Servers should convert recognized schemas to the latest internal value, and
22 // may reject unrecognized values. More info:
23 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
24 "apiVersion": "events.k8s.io/v1"
25
26 // deprecatedCount is the deprecated field assuring backward compatibility with core.v1 Event type.
27 "deprecatedCount"?: int32 & int
28
29 // deprecatedFirstTimestamp is the deprecated field assuring backward
30 // compatibility with core.v1 Event type.
31 "deprecatedFirstTimestamp"?: v1.#Time
32
33 // deprecatedLastTimestamp is the deprecated field assuring backward
34 // compatibility with core.v1 Event type.
35 "deprecatedLastTimestamp"?: v1.#Time
36
37 // deprecatedSource is the deprecated field assuring backward compatibility with core.v1 Event type.
38 "deprecatedSource"?: v1_9.#EventSource
39
40 // eventTime is the time when this Event was first observed. It is required.
41 "eventTime"!: v1.#MicroTime
42
43 // Kind is a string value representing the REST resource this object represents.
44 // Servers may infer this from the endpoint the client submits requests to.
45 // Cannot be updated. In CamelCase. More info:
46 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
47 "kind": "Event"
48
49 // Standard object's metadata. More info:
50 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
51 "metadata"?: v1.#ObjectMeta
52
53 // note is a human-readable description of the status of this operation. Maximal
54 // length of the note is 1kB, but libraries should be prepared to handle values
55 // up to 64kB.
56 "note"?: string
57
58 // reason is why the action was taken. It is human-readable. This field cannot
59 // be empty for new Events and it can have at most 128 characters.
60 "reason"?: string
61
62 // regarding contains the object this Event is about. In most cases it's an
63 // Object reporting controller implements, e.g. ReplicaSetController implements
64 // ReplicaSets and this event is emitted because it acts on some changes in a
65 // ReplicaSet object.
66 "regarding"?: v1_9.#ObjectReference
67
68 // related is the optional secondary object for more complex actions. E.g. when
69 // regarding object triggers a creation or deletion of related object.
70 "related"?: v1_9.#ObjectReference
71
72 // reportingController is the name of the controller that emitted this Event,
73 // e.g. `kubernetes.io/kubelet`. This field cannot be empty for new Events.
74 "reportingController"?: string
75
76 // reportingInstance is the ID of the controller instance, e.g. `kubelet-xyzf`.
77 // This field cannot be empty for new Events and it can have at most 128
78 // characters.
79 "reportingInstance"?: string
80
81 // series is data about the Event series this event represents or nil if it's a singleton Event.
82 "series"?: #EventSeries
83
84 // type is the type of this event (Normal, Warning), new types could be added in
85 // the future. It is machine-readable. This field cannot be empty for new
86 // Events.
87 "type"?: string
88}
89
90// EventList is a list of Event objects.
91#EventList: {
92 // APIVersion defines the versioned schema of this representation of an object.
93 // Servers should convert recognized schemas to the latest internal value, and
94 // may reject unrecognized values. More info:
95 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
96 "apiVersion": "events.k8s.io/v1"
97
98 // items is a list of schema objects.
99 "items"!: [...#Event]
100
101 // Kind is a string value representing the REST resource this object represents.
102 // Servers may infer this from the endpoint the client submits requests to.
103 // Cannot be updated. In CamelCase. More info:
104 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
105 "kind": "EventList"
106
107 // Standard list metadata. More info:
108 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
109 "metadata"?: v1.#ListMeta
110}
111
112// EventSeries contain information on series of events, i.e. thing that was/is
113// happening continuously for some time. How often to update the EventSeries is
114// up to the event reporters. The default event reporter in
115// "k8s.io/client-go/tools/events/event_broadcaster.go" shows how this struct
116// is updated on heartbeats and can guide customized reporter implementations.
117#EventSeries: {
118 // count is the number of occurrences in this series up to the last heartbeat time.
119 "count"!: int32 & int
120
121 // lastObservedTime is the time when last Event from the series was seen before last heartbeat.
122 "lastObservedTime"!: v1.#MicroTime
123}