blob: 530c67a8a9258861c3b7d7445338e87412b9c3b3 [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;
19import org.onosproject.net.DeviceId;
20
21import java.util.Set;
22
23/**
24 * Service for querying virtual network inventory.
25 */
26@Beta
27public interface VirtualNetworkService {
28
29 /**
Brian Stanke0e5c94e2016-03-08 11:20:04 -050030 * The topic used for obtaining globally unique ids.
31 */
32 String VIRTUAL_NETWORK_TOPIC = "virtual-network-ids";
33
34 /**
Thomas Vachuska7b438af2015-07-07 09:52:07 -070035 * Returns a collection of all virtual networks created on behalf of the
36 * specified tenant.
37 *
38 * @param tenantId tenant identifier
39 * @return collection of networks
40 * @throws org.onlab.util.ItemNotFoundException if no such network found
41 */
42 Set<VirtualNetwork> getVirtualNetworks(TenantId tenantId);
43
44 /**
45 * Returns a collection of all virtual devices in the specified network.
46 *
47 * @param networkId network identifier
48 * @return collection of devices
49 * @throws org.onlab.util.ItemNotFoundException if no such network found
50 */
51 Set<VirtualDevice> getVirtualDevices(NetworkId networkId);
52
53 /**
Brian Stanke7a81b532016-06-14 15:43:51 -040054 * Returns a collection of all virtual hosts in the specified network.
55 *
56 * @param networkId network identifier
57 * @return collection of hosts
58 * @throws org.onlab.util.ItemNotFoundException if no such network found
59 */
60 Set<VirtualHost> getVirtualHosts(NetworkId networkId);
61
62 /**
Thomas Vachuska7b438af2015-07-07 09:52:07 -070063 * Returns collection of all virtual links in the specified network.
64 *
65 * @param networkId network identifier
66 * @return collection of links
67 * @throws org.onlab.util.ItemNotFoundException if no such network found
68 */
69 Set<VirtualLink> getVirtualLinks(NetworkId networkId);
70
71 /**
Brian Stanke612cebf2016-05-02 10:21:33 -040072 * Returns list of all virtual ports of the specified device. If the
73 * device identifier is null then all of the virtual ports in the specified
74 * network will be returned.
Thomas Vachuska7b438af2015-07-07 09:52:07 -070075 *
76 * @param networkId network identifier
77 * @param deviceId device identifier
78 * @return list of ports
79 * @throws org.onlab.util.ItemNotFoundException if no such network found
80 */
81 Set<VirtualPort> getVirtualPorts(NetworkId networkId, DeviceId deviceId);
82
83 /**
84 * Returns implementation of the specified service class for operating
85 * in the context of the given network.
86 * <p>
87 * The following services will be available:
88 * <ul>
89 * <li>{@link org.onosproject.net.device.DeviceService}</li>
90 * <li>{@link org.onosproject.net.link.LinkService}</li>
91 * <li>{@link org.onosproject.net.host.HostService}</li>
92 * <li>{@link org.onosproject.net.topology.TopologyService}</li>
93 * <li>{@link org.onosproject.net.topology.PathService}</li>
94 * <li>{@link org.onosproject.net.flow.FlowRuleService}</li>
95 * <li>{@link org.onosproject.net.flowobjective.FlowObjectiveService}</li>
96 * <li>{@link org.onosproject.net.intent.IntentService}</li>
97 * </ul>
98 *
99 * @param networkId network identifier
100 * @param serviceClass service class
101 * @param <T> type of service
102 * @return implementation class
103 * @throws org.onlab.util.ItemNotFoundException if no such network found
104 * @throws org.onlab.osgi.ServiceNotFoundException if no implementation found
105 */
106 <T> T get(NetworkId networkId, Class<T> serviceClass);
107
108}