blob: 21f721c5c23f0c87ef55d90ca1c44b33f7e2afc5 [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;
Thomas Vachuska7b438af2015-07-07 09:52:07 -070021import org.onosproject.net.DeviceId;
22
23import java.util.Set;
24
25/**
26 * Service for querying virtual network inventory.
27 */
28@Beta
29public interface VirtualNetworkService {
30
31 /**
Brian Stanke0e5c94e2016-03-08 11:20:04 -050032 * The topic used for obtaining globally unique ids.
33 */
34 String VIRTUAL_NETWORK_TOPIC = "virtual-network-ids";
35
36 /**
Thomas Vachuska7b438af2015-07-07 09:52:07 -070037 * Returns a collection of all virtual networks created on behalf of the
38 * specified tenant.
39 *
40 * @param tenantId tenant identifier
41 * @return collection of networks
42 * @throws org.onlab.util.ItemNotFoundException if no such network found
43 */
44 Set<VirtualNetwork> getVirtualNetworks(TenantId tenantId);
45
46 /**
47 * Returns a collection of all virtual devices in the specified network.
48 *
49 * @param networkId network identifier
50 * @return collection of devices
51 * @throws org.onlab.util.ItemNotFoundException if no such network found
52 */
53 Set<VirtualDevice> getVirtualDevices(NetworkId networkId);
54
55 /**
Brian Stanke7a81b532016-06-14 15:43:51 -040056 * Returns a collection of all virtual hosts in the specified network.
57 *
58 * @param networkId network identifier
59 * @return collection of hosts
60 * @throws org.onlab.util.ItemNotFoundException if no such network found
61 */
62 Set<VirtualHost> getVirtualHosts(NetworkId networkId);
63
64 /**
Thomas Vachuska7b438af2015-07-07 09:52:07 -070065 * Returns collection of all virtual links in the specified network.
66 *
67 * @param networkId network identifier
68 * @return collection of links
69 * @throws org.onlab.util.ItemNotFoundException if no such network found
70 */
71 Set<VirtualLink> getVirtualLinks(NetworkId networkId);
72
73 /**
Brian Stanke612cebf2016-05-02 10:21:33 -040074 * Returns list of all virtual ports of the specified device. If the
75 * device identifier is null then all of the virtual ports in the specified
76 * network will be returned.
Thomas Vachuska7b438af2015-07-07 09:52:07 -070077 *
78 * @param networkId network identifier
79 * @param deviceId device identifier
80 * @return list of ports
81 * @throws org.onlab.util.ItemNotFoundException if no such network found
82 */
83 Set<VirtualPort> getVirtualPorts(NetworkId networkId, DeviceId deviceId);
84
85 /**
86 * Returns implementation of the specified service class for operating
87 * in the context of the given network.
88 * <p>
89 * The following services will be available:
90 * <ul>
91 * <li>{@link org.onosproject.net.device.DeviceService}</li>
92 * <li>{@link org.onosproject.net.link.LinkService}</li>
93 * <li>{@link org.onosproject.net.host.HostService}</li>
94 * <li>{@link org.onosproject.net.topology.TopologyService}</li>
95 * <li>{@link org.onosproject.net.topology.PathService}</li>
96 * <li>{@link org.onosproject.net.flow.FlowRuleService}</li>
97 * <li>{@link org.onosproject.net.flowobjective.FlowObjectiveService}</li>
98 * <li>{@link org.onosproject.net.intent.IntentService}</li>
99 * </ul>
100 *
101 * @param networkId network identifier
102 * @param serviceClass service class
103 * @param <T> type of service
104 * @return implementation class
105 * @throws org.onlab.util.ItemNotFoundException if no such network found
106 * @throws org.onlab.osgi.ServiceNotFoundException if no implementation found
107 */
108 <T> T get(NetworkId networkId, Class<T> serviceClass);
109
yoonseonc6a69272017-01-12 18:22:20 -0800110 /**
111 * Returns service directory.
112 *
113 * @return a service directory
114 */
115 ServiceDirectory getServiceDirectory();
yoonseon322c9c32016-12-07 16:47:02 -0800116
117 /**
118 * Returns the application identifier for a virtual network.
119 *
120 * @param networkId network identifier
121 * @return an representative application identifier for a virtual network
122 */
123 ApplicationId getVirtualNetworkApplicationId(NetworkId networkId);
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700124}