2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onosproject.incubator.net.virtual;
18 import com.google.common.annotations.Beta;
19 import org.onosproject.incubator.net.tunnel.Tunnel;
20 import org.onosproject.net.ConnectPoint;
21 import org.onosproject.net.DeviceId;
22 import org.onosproject.net.Port;
23 import org.onosproject.net.PortNumber;
24 import org.onosproject.net.device.DeviceDescription;
25 import org.onosproject.net.device.PortDescription;
26 import org.onosproject.net.link.LinkDescription;
31 * Service for managing the inventory of virtual networks.
34 public interface VirtualNetworkAdminService extends VirtualNetworkService {
37 * Registers the specified, externally generated tenant identifier.
39 * @param tenantId tenant identifier
41 void registerTenantId(TenantId tenantId);
44 * Unregisters the specified, externally generated tenant identifier.
46 * @param tenantId tenant identifier
47 * @throws IllegalStateException if there are networks still owned by this tenant
49 void unregisterTenantId(TenantId tenantId);
52 * Returns the set of tenant identifiers known to the system.
54 * @return set of known tenant identifiers
56 Set<TenantId> getTenantIds();
60 * Creates a new virtual network for the specified tenant.
62 * @param tenantId tenant identifier
63 * @return newly created virtual network
65 VirtualNetwork createVirtualNetwork(TenantId tenantId);
68 * Removes the specified virtual network and all its devices and links.
70 * @param networkId network identifier
72 void removeVirtualNetwork(NetworkId networkId);
76 * Creates a new virtual device within the specified network. The device id
77 * must be unique within the bounds of the network.
79 * @param networkId network identifier
80 * @param description device description
81 * @return newly created device
82 * @throws org.onlab.util.ItemNotFoundException if no such network found
84 VirtualDevice createVirtualDevice(NetworkId networkId, DeviceDescription description);
87 * Removes the specified virtual device and all its ports and affiliated links.
89 * @param networkId network identifier
90 * @param deviceId device identifier
91 * @throws org.onlab.util.ItemNotFoundException if no such network or device found
93 void removeVirtualDevice(NetworkId networkId, DeviceId deviceId);
97 * Creates a new virtual link within the specified network.
99 * @param networkId network identifier
100 * @param description link description
101 * @param realizedBy tunnel using which this link is realized
102 * @return newly created virtual link
103 * @throws org.onlab.util.ItemNotFoundException if no such network found
105 VirtualLink createVirtualLink(NetworkId networkId, LinkDescription description,
108 // TODO: Discuss whether we should provide an alternate createVirtualLink
109 // which is backed by a Path instead; I'm leaning towards not doing that.
112 * Removes the specified virtual link.
114 * @param networkId network identifier
115 * @param src source connection point
116 * @param dst destination connection point
117 * @throws org.onlab.util.ItemNotFoundException if no such network or link found
119 void removeVirtualLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst);
122 * Creates a new virtual port on the specified device. Note that the port
123 * description can only request the resources which the underlying port
124 * port is capable of providing. It is, however, permissible to request
125 * only portion of those resources.
127 * @param networkId network identifier
128 * @param deviceId device identifier
129 * @param description port description
130 * @param realizedBy underlying port using which this virtual port is realized
131 * @return newly created port
132 * @throws org.onlab.util.ItemNotFoundException if no such network or device found
134 VirtualPort createVirtualPort(NetworkId networkId, DeviceId deviceId,
135 PortDescription description, Port realizedBy);
138 * Removes the specified virtual port.
140 * @param networkId network identifier
141 * @param deviceId device identifier
142 * @param portNumber port number
143 * @throws org.onlab.util.ItemNotFoundException if no such network or port found
145 void removeVirtualPort(NetworkId networkId, DeviceId deviceId, PortNumber portNumber);