blob: 41e90a3ad87cf9c4603d0b0ca1d08fda3a7f2b93 [file] [log] [blame]
Jian Lib230e07c2020-12-21 11:25:12 +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.kubevirtnode.api;
17
18import org.onlab.packet.IpAddress;
19import org.onosproject.event.ListenerService;
20import org.onosproject.net.DeviceId;
21
22import java.util.Set;
23
24/**
25 * Service for interfacing with the inventory of {@link KubevirtNode}.
26 */
27public interface KubevirtNodeService extends ListenerService<KubevirtNodeEvent, KubevirtNodeListener> {
28
29 String APP_ID = "org.onosproject.kubevirtnode";
30
31 /**
32 * Returns all registered nodes.
33 *
34 * @return set of kubevirt nodes
35 */
36 Set<KubevirtNode> nodes();
37
38 /**
39 * Returns all nodes with the specified type.
40 *
41 * @param type node type
42 * @return set of kubevirt nodes
43 */
44 Set<KubevirtNode> nodes(KubevirtNode.Type type);
45
46 /**
47 * Returns all nodes with complete state.
48 *
49 * @return set of kubevirt nodes
50 */
51 Set<KubevirtNode> completeNodes();
52
53 /**
54 * Returns all nodes with complete state and the specified type.
55 *
56 * @param type node type
57 * @return set of kubevirt nodes
58 */
59 Set<KubevirtNode> completeNodes(KubevirtNode.Type type);
60
61 /**
62 * Returns the node with the specified hostname.
63 *
64 * @param hostname hostname
65 * @return kubevirt node
66 */
67 KubevirtNode node(String hostname);
68
69 /**
70 * Returns the node with the specified device ID.
71 * The device ID can be any one of integration bridge or ovsdb device.
72 *
73 * @param deviceId device id
74 * @return kubevirt node
75 */
76 KubevirtNode node(DeviceId deviceId);
77
78 /**
79 * Returns the node with the specified management IP address.
80 *
81 * @param mgmtIp management IP
82 * @return kubevirt node
83 */
84 KubevirtNode node(IpAddress mgmtIp);
Jian Li4fe40e52021-01-06 03:29:58 +090085
86 /**
Jian Li4b249702021-02-19 18:13:10 +090087 * Checks whether has the node with the given hostname.
88 *
89 * @param hostname hostname
90 * @return true if it has the node, false otherwise
91 */
92 boolean hasNode(String hostname);
93
94 /**
Jian Li4fe40e52021-01-06 03:29:58 +090095 * Returns the node with the specified tunnel device ID.
96 * The device ID tunnel bridge.
97 *
98 * @param deviceId device id
99 * @return kubevirt node
100 */
101 KubevirtNode nodeByTunBridge(DeviceId deviceId);
Jian Lib230e07c2020-12-21 11:25:12 +0900102}