blob: d0a39910ca1f369b31fa77aa1ca66699eb3a87c3 [file] [log] [blame]
Jian Lid893a662019-02-19 11:18:54 +09001/*
2 * Copyright 2019-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.k8snetworking.api;
17
18import io.fabric8.kubernetes.api.model.Pod;
19import org.onosproject.store.Store;
20
21import java.util.Set;
22
23/**
24 * Manages inventory of kubernetes pod; not intended for direct use.
25 */
26public interface K8sPodStore extends Store<K8sPodEvent, K8sPodStoreDelegate> {
27
28 /**
29 * Creates the new kubernetes pod.
30 *
31 * @param pod kubernetes pod
32 */
33 void createPod(Pod pod);
34
35 /**
36 * Updates the kubernetes pod.
37 *
38 * @param pod kubernetes pod
39 */
40 void updatePod(Pod pod);
41
42 /**
43 * Removes the kubernetes pod with the given pod UID.
44 *
45 * @param uid kubernetes pod UID
46 * @return removed kubernetes pod; null if failed
47 */
48 Pod removePod(String uid);
49
50 /**
51 * Returns the kubernetes pod with the given pod UID.
52 *
53 * @param uid kubernetes pod UID
54 * @return kubernetes pod; null if not found
55 */
56 Pod pod(String uid);
57
58 /**
59 * Returns all kubernetes pods.
60 *
61 * @return set of kubernetes pods
62 */
63 Set<Pod> pods();
64
65 /**
66 * Removes all kubernetes pods.
67 */
68 void clear();
69}