Jian Li | 58b3398 | 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; |
| 20 | |
| 21 | import java.util.Set; |
| 22 | |
| 23 | /** |
| 24 | * Service for interfacing with the inventory of Kubernetes host. |
| 25 | */ |
| 26 | public interface K8sHostService extends ListenerService<K8sHostEvent, K8sHostListener> { |
| 27 | |
| 28 | String APP_ID = "org.onosproject.k8snode"; |
| 29 | |
| 30 | /** |
| 31 | * Returns all registered hosts. |
| 32 | * |
| 33 | * @return set of kubernetes hosts |
| 34 | */ |
| 35 | Set<K8sHost> hosts(); |
| 36 | |
| 37 | /** |
| 38 | * Returns all hosts with complete states. |
| 39 | * |
| 40 | * @return set of kubernetes hosts |
| 41 | */ |
| 42 | Set<K8sHost> completeHosts(); |
| 43 | |
| 44 | /** |
| 45 | * Returns the host with the specified IP address. |
| 46 | * |
| 47 | * @param hostIp host IP address |
| 48 | * @return kubernetes host |
| 49 | */ |
| 50 | K8sHost host(IpAddress hostIp); |
| 51 | } |