blob: 96ce129279ee99c95b2911207b70328ae60b5bfb [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 /**
Jian Lie2a04ce2020-07-01 19:07:02 +090039 * Returns kubernetes nodes associated with cluster name.
40 *
41 * @param clusterName cluster name
42 * @return set of kubernetes nodes
43 */
44 Set<K8sNode> nodes(String clusterName);
45
46 /**
Jian Li9e43ec12019-01-21 23:04:23 +090047 * Returns all nodes with the specified type.
48 *
49 * @param type node type
50 * @return set of kubernetes nodes
51 */
52 Set<K8sNode> nodes(Type type);
53
54 /**
55 * Returns all nodes with complete states.
56 *
57 * @return set of kubernetes nodes
58 */
59 Set<K8sNode> completeNodes();
60
61 /**
62 * Returns all nodes with complete state and the specified type.
63 *
64 * @param type node type
65 * @return set of kubernetes nodes
66 */
67 Set<K8sNode> completeNodes(Type type);
68
69 /**
70 * Returns the node with the specified hostname.
71 *
72 * @param hostname hostname
73 * @return kubernetes node
74 */
75 K8sNode node(String hostname);
76
77 /**
78 * Returns the node with the specified device ID.
79 * The device ID can be any one of integration bridge, router bridge,
80 * or ovsdb device.
81 *
82 * @param deviceId device ID
83 * @return kubernetes node
84 */
85 K8sNode node(DeviceId deviceId);
86}