blob: 42ef15e4e93ffe7a09efb64ad61b287e0e6a1686 [file] [log] [blame]
Jian Li3defa842019-02-12 00:31:35 +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.onlab.packet.IpAddress;
19import org.onosproject.event.ListenerService;
20import org.onosproject.k8snode.api.K8sApiConfig.Scheme;
21
22import java.util.Set;
23
24/**
25 * Service for interfacing with the inventory of kubernetes API server config.
26 */
27public interface K8sApiConfigService
28 extends ListenerService<K8sApiConfigEvent, K8sApiConfigListener> {
29 String APP_ID = "org.onosproject.k8snode";
30
31 /**
32 * Returns all registered API configs.
33 *
34 * @return set of kubernetes API configs
35 */
36 Set<K8sApiConfig> apiConfigs();
37
38 /**
39 * Returns the API config with the specified endpoint.
40 *
41 * @param endpoint endpoint
42 * @return kubernetes API config
43 */
44 K8sApiConfig apiConfig(String endpoint);
45
46 /**
47 * Returns the API config with the specified scheme, IP and port.
48 *
49 * @param scheme scheme (HTTP/HTTPS)
50 * @param ipAddress IP address of API server
51 * @param port port number of API server
52 * @return kubernetes API config
53 */
54 K8sApiConfig apiConfig(Scheme scheme, IpAddress ipAddress, int port);
55}