blob: cf7b77f0f625e0f8e61be5d6733bbf337b088a1a [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.event.ListenerService;
Jian Li077b07e2020-09-01 16:55:25 +090020import org.onosproject.net.DeviceId;
Jian Lie2a04ce2020-07-01 19:07:02 +090021
22import java.util.Set;
23
24/**
25 * Service for interfacing with the inventory of Kubernetes host.
26 */
27public interface K8sHostService extends ListenerService<K8sHostEvent, K8sHostListener> {
28
29 String APP_ID = "org.onosproject.k8snode";
30
31 /**
32 * Returns all registered hosts.
33 *
34 * @return set of kubernetes hosts
35 */
36 Set<K8sHost> hosts();
37
38 /**
39 * Returns all hosts with complete states.
40 *
41 * @return set of kubernetes hosts
42 */
43 Set<K8sHost> completeHosts();
44
45 /**
46 * Returns the host with the specified IP address.
47 *
48 * @param hostIp host IP address
49 * @return kubernetes host
50 */
51 K8sHost host(IpAddress hostIp);
Jian Li077b07e2020-09-01 16:55:25 +090052
53 /**
54 * Returns the host with the specified device ID.
55 *
56 * @param deviceId device identifier
57 * @return kubernetes host
58 */
59 K8sHost host(DeviceId deviceId);
60
61 /**
62 * Returns the host with the specified tunnel bridge device ID.
63 *
64 * @param deviceId tunnel bridge's device ID
65 * @return kubernetes host
66 */
67 K8sHost hostByTunBridge(DeviceId deviceId);
Jian Lie2a04ce2020-07-01 19:07:02 +090068}