blob: 455e42c6cc522df0bea65d02db76b6af17c584ff [file] [log] [blame]
Jian Li9e43ec12019-01-21 23:04:23 +09001/*
2 * Copyright 2019-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.onosproject.event.ListenerService;
19import org.onosproject.k8snode.api.K8sNode.Type;
20import org.onosproject.net.DeviceId;
21
22import java.util.Set;
23
24/**
25 * Service for interfacing with the inventory of Kubernetes Node.
26 */
27public interface K8sNodeService extends ListenerService<K8sNodeEvent, K8sNodeListener> {
28
29 String APP_ID = "org.onosproject.k8snode";
30
31 /**
32 * Returns all registered nodes.
33 *
34 * @return set of kubernetes nodes
35 */
36 Set<K8sNode> nodes();
37
38 /**
39 * Returns all nodes with the specified type.
40 *
41 * @param type node type
42 * @return set of kubernetes nodes
43 */
44 Set<K8sNode> nodes(Type type);
45
46 /**
47 * Returns all nodes with complete states.
48 *
49 * @return set of kubernetes nodes
50 */
51 Set<K8sNode> completeNodes();
52
53 /**
54 * Returns all nodes with complete state and the specified type.
55 *
56 * @param type node type
57 * @return set of kubernetes nodes
58 */
59 Set<K8sNode> completeNodes(Type type);
60
61 /**
62 * Returns the node with the specified hostname.
63 *
64 * @param hostname hostname
65 * @return kubernetes node
66 */
67 K8sNode 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, router bridge,
72 * or ovsdb device.
73 *
74 * @param deviceId device ID
75 * @return kubernetes node
76 */
77 K8sNode node(DeviceId deviceId);
78}