blob: aec871abbcf4296e1a59b826950d97017f09c456 [file] [log] [blame]
Jian Lie2a04ce2020-07-01 19:07:02 +09001/*
2 * Copyright 2020-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.k8snode.api;
17
18import org.onlab.packet.IpAddress;
19import org.onosproject.store.Store;
20
21import java.util.Set;
22
23/**
24 * Manages inventory of Kubernetes Host; not intended for direct use.
25 */
26public interface K8sHostStore extends Store<K8sHostEvent, K8sHostStoreDelegate> {
27
28 /**
29 * Creates a new host.
30 *
31 * @param host kubernetes host
32 */
33 void createHost(K8sHost host);
34
35 /**
36 * Updates the host.
37 *
38 * @param host kubernetes host
39 */
40 void updateHost(K8sHost host);
41
42 /**
43 * Removes the host with the given host IP.
44 *
45 * @param hostIp kubernetes host IP
46 * @return removed kubernetes host; null if no host is associated with the host IP
47 */
48 K8sHost removeHost(IpAddress hostIp);
49
50 /**
51 * Returns all registered hosts.
52 *
53 * @return set of kubernetes hosts
54 */
55 Set<K8sHost> hosts();
56
57 /**
58 * Returns the host with the specified host IP.
59 *
60 * @param hostIp host IP address
61 * @return kubernetes host
62 */
63 K8sHost host(IpAddress hostIp);
64}