blob: 88ef56bb0283e6fab630726f7d31724756c72268 [file] [log] [blame]
Thomas Vachuska7b438af2015-07-07 09:52:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Thomas Vachuska7b438af2015-07-07 09:52:07 -07003 *
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.incubator.net.virtual;
17
18import com.google.common.annotations.Beta;
yoonseonc6a69272017-01-12 18:22:20 -080019import org.onlab.osgi.ServiceDirectory;
yoonseon322c9c32016-12-07 16:47:02 -080020import org.onosproject.core.ApplicationId;
Yoonseon Han33821fb2017-02-24 13:40:44 +090021import org.onosproject.event.ListenerService;
Thomas Vachuska7b438af2015-07-07 09:52:07 -070022import org.onosproject.net.DeviceId;
23
24import java.util.Set;
25
26/**
27 * Service for querying virtual network inventory.
28 */
29@Beta
Yoonseon Han33821fb2017-02-24 13:40:44 +090030public interface VirtualNetworkService
31 extends ListenerService<VirtualNetworkEvent, VirtualNetworkListener> {
Thomas Vachuska7b438af2015-07-07 09:52:07 -070032
33 /**
Brian Stanke0e5c94e2016-03-08 11:20:04 -050034 * The topic used for obtaining globally unique ids.
35 */
36 String VIRTUAL_NETWORK_TOPIC = "virtual-network-ids";
37
38 /**
Thomas Vachuska7b438af2015-07-07 09:52:07 -070039 * Returns a collection of all virtual networks created on behalf of the
40 * specified tenant.
41 *
42 * @param tenantId tenant identifier
43 * @return collection of networks
44 * @throws org.onlab.util.ItemNotFoundException if no such network found
45 */
46 Set<VirtualNetwork> getVirtualNetworks(TenantId tenantId);
47
48 /**
49 * Returns a collection of all virtual devices in the specified network.
50 *
51 * @param networkId network identifier
52 * @return collection of devices
53 * @throws org.onlab.util.ItemNotFoundException if no such network found
54 */
55 Set<VirtualDevice> getVirtualDevices(NetworkId networkId);
56
57 /**
Brian Stanke7a81b532016-06-14 15:43:51 -040058 * Returns a collection of all virtual hosts in the specified network.
59 *
60 * @param networkId network identifier
61 * @return collection of hosts
62 * @throws org.onlab.util.ItemNotFoundException if no such network found
63 */
64 Set<VirtualHost> getVirtualHosts(NetworkId networkId);
65
66 /**
Thomas Vachuska7b438af2015-07-07 09:52:07 -070067 * Returns collection of all virtual links in the specified network.
68 *
69 * @param networkId network identifier
70 * @return collection of links
71 * @throws org.onlab.util.ItemNotFoundException if no such network found
72 */
73 Set<VirtualLink> getVirtualLinks(NetworkId networkId);
74
75 /**
Brian Stanke612cebf2016-05-02 10:21:33 -040076 * Returns list of all virtual ports of the specified device. If the
77 * device identifier is null then all of the virtual ports in the specified
78 * network will be returned.
Thomas Vachuska7b438af2015-07-07 09:52:07 -070079 *
80 * @param networkId network identifier
81 * @param deviceId device identifier
82 * @return list of ports
83 * @throws org.onlab.util.ItemNotFoundException if no such network found
84 */
85 Set<VirtualPort> getVirtualPorts(NetworkId networkId, DeviceId deviceId);
86
87 /**
sangyun-han3c3e99e2017-02-08 15:30:53 +090088 * Returns list of physical device identifier mapping with the virtual
89 * device in the specified network. The physical devices are specified by
90 * port mapping mechanism.
91 *
92 * @param networkId network identifier
Harold Huang3fcf7432017-05-16 16:21:08 +080093 * @param deviceId the virtual device identifier
sangyun-han3c3e99e2017-02-08 15:30:53 +090094 * @return collection of the specified device's identifier
95 */
Harold Huang3fcf7432017-05-16 16:21:08 +080096 Set<DeviceId> getPhysicalDevices(NetworkId networkId, DeviceId deviceId);
sangyun-han3c3e99e2017-02-08 15:30:53 +090097
98 /**
Thomas Vachuska7b438af2015-07-07 09:52:07 -070099 * Returns implementation of the specified service class for operating
100 * in the context of the given network.
101 * <p>
102 * The following services will be available:
103 * <ul>
104 * <li>{@link org.onosproject.net.device.DeviceService}</li>
105 * <li>{@link org.onosproject.net.link.LinkService}</li>
106 * <li>{@link org.onosproject.net.host.HostService}</li>
107 * <li>{@link org.onosproject.net.topology.TopologyService}</li>
108 * <li>{@link org.onosproject.net.topology.PathService}</li>
yoonseon97b9b592017-01-31 14:35:06 -0800109 * <li>{@link org.onosproject.net.packet.PacketService}</li>
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700110 * <li>{@link org.onosproject.net.flow.FlowRuleService}</li>
111 * <li>{@link org.onosproject.net.flowobjective.FlowObjectiveService}</li>
112 * <li>{@link org.onosproject.net.intent.IntentService}</li>
113 * </ul>
114 *
115 * @param networkId network identifier
116 * @param serviceClass service class
117 * @param <T> type of service
118 * @return implementation class
119 * @throws org.onlab.util.ItemNotFoundException if no such network found
120 * @throws org.onlab.osgi.ServiceNotFoundException if no implementation found
121 */
122 <T> T get(NetworkId networkId, Class<T> serviceClass);
123
yoonseonc6a69272017-01-12 18:22:20 -0800124 /**
125 * Returns service directory.
126 *
127 * @return a service directory
128 */
129 ServiceDirectory getServiceDirectory();
yoonseon322c9c32016-12-07 16:47:02 -0800130
131 /**
132 * Returns the application identifier for a virtual network.
133 *
134 * @param networkId network identifier
135 * @return an representative application identifier for a virtual network
136 */
137 ApplicationId getVirtualNetworkApplicationId(NetworkId networkId);
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700138}