diff options
author | Ashlee Young <ashlee@onosfw.com> | 2015-09-09 22:15:21 -0700 |
---|---|---|
committer | Ashlee Young <ashlee@onosfw.com> | 2015-09-09 22:15:21 -0700 |
commit | 13d05bc8458758ee39cb829098241e89616717ee (patch) | |
tree | 22a4d1ce65f15952f07a3df5af4b462b4697cb3a /framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java | |
parent | 6139282e1e93c2322076de4b91b1c85d0bc4a8b3 (diff) |
ONOS checkin based on commit tag e796610b1f721d02f9b0e213cf6f7790c10ecd60
Change-Id: Ife8810491034fe7becdba75dda20de4267bd15cd
Diffstat (limited to 'framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java')
-rw-r--r-- | framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java new file mode 100644 index 00000000..1e3648b5 --- /dev/null +++ b/framework/src/onos/incubator/api/src/main/java/org/onosproject/incubator/net/virtual/VirtualNetworkAdminService.java @@ -0,0 +1,147 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onosproject.incubator.net.virtual; + +import com.google.common.annotations.Beta; +import org.onosproject.incubator.net.tunnel.Tunnel; +import org.onosproject.net.ConnectPoint; +import org.onosproject.net.DeviceId; +import org.onosproject.net.Port; +import org.onosproject.net.PortNumber; +import org.onosproject.net.device.DeviceDescription; +import org.onosproject.net.device.PortDescription; +import org.onosproject.net.link.LinkDescription; + +import java.util.Set; + +/** + * Service for managing the inventory of virtual networks. + */ +@Beta +public interface VirtualNetworkAdminService extends VirtualNetworkService { + + /** + * Registers the specified, externally generated tenant identifier. + * + * @param tenantId tenant identifier + */ + void registerTenantId(TenantId tenantId); + + /** + * Unregisters the specified, externally generated tenant identifier. + * + * @param tenantId tenant identifier + * @throws IllegalStateException if there are networks still owned by this tenant + */ + void unregisterTenantId(TenantId tenantId); + + /** + * Returns the set of tenant identifiers known to the system. + * + * @return set of known tenant identifiers + */ + Set<TenantId> getTenantIds(); + + + /** + * Creates a new virtual network for the specified tenant. + * + * @param tenantId tenant identifier + * @return newly created virtual network + */ + VirtualNetwork createVirtualNetwork(TenantId tenantId); + + /** + * Removes the specified virtual network and all its devices and links. + * + * @param networkId network identifier + */ + void removeVirtualNetwork(NetworkId networkId); + + + /** + * Creates a new virtual device within the specified network. The device id + * must be unique within the bounds of the network. + * + * @param networkId network identifier + * @param description device description + * @return newly created device + * @throws org.onlab.util.ItemNotFoundException if no such network found + */ + VirtualDevice createVirtualDevice(NetworkId networkId, DeviceDescription description); + + /** + * Removes the specified virtual device and all its ports and affiliated links. + * + * @param networkId network identifier + * @param deviceId device identifier + * @throws org.onlab.util.ItemNotFoundException if no such network or device found + */ + void removeVirtualDevice(NetworkId networkId, DeviceId deviceId); + + + /** + * Creates a new virtual link within the specified network. + * + * @param networkId network identifier + * @param description link description + * @param realizedBy tunnel using which this link is realized + * @return newly created virtual link + * @throws org.onlab.util.ItemNotFoundException if no such network found + */ + VirtualLink createVirtualLink(NetworkId networkId, LinkDescription description, + Tunnel realizedBy); + + // TODO: Discuss whether we should provide an alternate createVirtualLink + // which is backed by a Path instead; I'm leaning towards not doing that. + + /** + * Removes the specified virtual link. + * + * @param networkId network identifier + * @param src source connection point + * @param dst destination connection point + * @throws org.onlab.util.ItemNotFoundException if no such network or link found + */ + void removeVirtualLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst); + + /** + * Creates a new virtual port on the specified device. Note that the port + * description can only request the resources which the underlying port + * port is capable of providing. It is, however, permissible to request + * only portion of those resources. + * + * @param networkId network identifier + * @param deviceId device identifier + * @param description port description + * @param realizedBy underlying port using which this virtual port is realized + * @return newly created port + * @throws org.onlab.util.ItemNotFoundException if no such network or device found + */ + VirtualPort createVirtualPort(NetworkId networkId, DeviceId deviceId, + PortDescription description, Port realizedBy); + + /** + * Removes the specified virtual port. + * + * @param networkId network identifier + * @param deviceId device identifier + * @param portNumber port number + * @throws org.onlab.util.ItemNotFoundException if no such network or port found + */ + void removeVirtualPort(NetworkId networkId, DeviceId deviceId, PortNumber portNumber); + +} |