Jian Li | e2a04ce | 2020-07-01 19:07:02 +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.k8snode.api; |
| 17 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onosproject.event.ListenerService; |
Jian Li | 077b07e | 2020-09-01 16:55:25 +0900 | [diff] [blame] | 20 | import org.onosproject.net.DeviceId; |
Jian Li | e2a04ce | 2020-07-01 19:07:02 +0900 | [diff] [blame] | 21 | |
| 22 | import java.util.Set; |
| 23 | |
| 24 | /** |
| 25 | * Service for interfacing with the inventory of Kubernetes host. |
| 26 | */ |
| 27 | public 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 Li | 077b07e | 2020-09-01 16:55:25 +0900 | [diff] [blame] | 52 | |
| 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 Li | e2a04ce | 2020-07-01 19:07:02 +0900 | [diff] [blame] | 68 | } |