forked from kubernetes/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathevent.go
65 lines (51 loc) · 2.13 KB
/
event.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright 2017 The Kubernetes Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package common
import (
"github.com/kubernetes/dashboard/src/app/backend/api"
"k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EventList is an events response structure.
type EventList struct {
ListMeta api.ListMeta `json:"listMeta"`
// List of events from given namespace.
Events []Event `json:"events"`
}
// Event is a single event representation.
type Event struct {
ObjectMeta api.ObjectMeta `json:"objectMeta"`
TypeMeta api.TypeMeta `json:"typeMeta"`
// A human-readable description of the status of related object.
Message string `json:"message"`
// Component from which the event is generated.
SourceComponent string `json:"sourceComponent"`
// Host name on which the event is generated.
SourceHost string `json:"sourceHost"`
// Reference to a piece of an object, which triggered an event. For example
// "spec.containers{name}" refers to container within pod with given name, if no container
// name is specified, for example "spec.containers[2]", then it refers to container with
// index 2 in this pod.
SubObject string `json:"object"`
// The number of times this event has occurred.
Count int32 `json:"count"`
// The time at which the event was first recorded.
FirstSeen v1.Time `json:"firstSeen"`
// The time at which the most recent occurrence of this event was recorded.
LastSeen v1.Time `json:"lastSeen"`
// Short, machine understandable string that gives the reason
// for this event being generated.
Reason string `json:"reason"`
// Event type (at the moment only normal and warning are supported).
Type string `json:"type"`
}