blob: a1f5b833e0bbc5220cdbd2546308d0484a31825a [file] [log] [blame]
Jian Li105770e2021-01-17 02:18:30 +09001/*
2 * Copyright 2021-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.kubevirtnetworking.api;
17
18import io.fabric8.kubernetes.api.model.Pod;
19import org.onosproject.event.AbstractEvent;
20
21/**
22 * Kubevirt pod event class.
23 */
24public class KubevirtPodEvent extends AbstractEvent<KubevirtPodEvent.Type, Pod> {
25
26 /**
27 * Creates an event of a given type for the specified kubevirt pod.
28 *
29 * @param type kubevirt pod event type
30 * @param subject kubevirt pod
31 */
32 public KubevirtPodEvent(Type type, Pod subject) {
33 super(type, subject);
34 }
35
36 public enum Type {
37 /**
38 * Signifies that a new kubevirt pod is created.
39 */
40 KUBEVIRT_POD_CREATED,
41
42 /**
43 * Signifies that the kubevirt pod is updated.
44 */
45 KUBEVIRT_POD_UPDATED,
46
47 /**
48 * Signifies that the kubevirt pod is in Pending phase.
49 */
50 KUBEVIRT_POD_PENDING,
51
52 /**
53 * Signifies that the kubevirt pod is in Running phase.
54 */
55 KUBEVIRT_POD_RUNNING,
56
57 /**
58 * Signifies that the kubevirt pod is in Succeeded phase.
59 */
60 KUBEVIRT_POD_SUCCEEDED,
61
62 /**
63 * Signifies that the kubevirt pod is in Failed phase.
64 */
65 KUBEVIRT_POD_FAILED,
66
67 /**
68 * Signifies that the kubevirt pod is in Unknown phase.
69 */
70 KUBEVIRT_POD_UNKNOWN,
71
72 /**
73 * Signifies that the kubevirt pod is in Completed phase.
74 */
75 KUBEVIRT_POD_COMPLETED,
76
77 /**
78 * Signifies that the kubevirt pod is in CrashLoopBackOff phase.
79 */
80 KUBEVIRT_POD_CRASH_LOOP_BACK_OFF,
81
82 /**
83 * Signifies that the kubevirt pod annotation is added.
84 */
85 KUBEVIRT_POD_ANNOTATION_ADDED,
86
87 /**
88 * Signifies that the kubevirt pod is removed.
89 */
90 KUBEVIRT_POD_REMOVED,
91 }
92}