blob: 1a8f84e305f93582508b8321e9bfa8b4124e6033 [file] [log] [blame]
Jian Lifc55e422019-01-21 14:39:34 +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.k8snetworking.api;
17
18import org.onosproject.event.ListenerService;
19import org.onosproject.k8snetworking.api.K8sNetwork.Type;
20import org.onosproject.k8snetworking.api.K8sPort.State;
21
22import java.util.Set;
23
24/**
25 * Service for interacting with the inventory of kubernetes network.
26 */
27public interface K8sNetworkService
28 extends ListenerService<K8sNetworkEvent, K8sNetworkListener> {
29
30 /**
31 * Returns the kubernetes network with the supplied network identifier.
32 *
33 * @param networkId network identifier
34 * @return kubernetes network
35 */
36 K8sNetwork network(String networkId);
37
38 /**
39 * Returns all kubernetes networks registered in the service.
40 *
41 * @return set of kubernetes networks
42 */
43 Set<K8sNetwork> networks();
44
45 /**
46 * Returns the kubernetes networks with the given network type.
47 *
48 * @param type virtual network type
49 * @return set of kubernetes networks
50 */
51 Set<K8sNetwork> networks(Type type);
52
53 /**
54 * Returns the kubernetes port with the supplied network identifier.
55 *
56 * @param portId port identifier
57 * @return kubernetes port
58 */
59 K8sPort port(String portId);
60
61 /**
62 * Returns all kubernetes ports registered in the service.
63 *
64 * @return set of kubernetes ports
65 */
66 Set<K8sPort> ports();
67
68 /**
69 * Returns the kubernetes ports with the given port state.
70 *
71 * @param state port state
72 * @return set of kubernetes ports
73 */
74 Set<K8sPort> ports(State state);
75
76 /**
77 * Returns the kubernetes ports belongs to the given network.
78 *
79 * @param networkId network identifier
80 * @return kubernetes ports
81 */
82 Set<K8sPort> ports(String networkId);
83}