Jian Li | b230e07c | 2020-12-21 11:25:12 +0900 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.kubevirtnode.api; |
| 17 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onosproject.event.ListenerService; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | |
| 22 | import java.util.Set; |
| 23 | |
| 24 | /** |
| 25 | * Service for interfacing with the inventory of {@link KubevirtNode}. |
| 26 | */ |
| 27 | public 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); |
| 85 | } |