blob: c903e618bfd276bab7b18c457cb92d6da20232b9 [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;
Thomas Vachuska7b438af2015-07-07 09:52:07 -070019import org.onosproject.net.ConnectPoint;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.Port;
22import org.onosproject.net.PortNumber;
Thomas Vachuska7b438af2015-07-07 09:52:07 -070023
24import java.util.Set;
25
26/**
27 * Service for managing the inventory of virtual networks.
28 */
29@Beta
30public interface VirtualNetworkAdminService extends VirtualNetworkService {
31
32 /**
33 * Registers the specified, externally generated tenant identifier.
34 *
35 * @param tenantId tenant identifier
36 */
37 void registerTenantId(TenantId tenantId);
38
39 /**
40 * Unregisters the specified, externally generated tenant identifier.
41 *
42 * @param tenantId tenant identifier
43 * @throws IllegalStateException if there are networks still owned by this tenant
44 */
45 void unregisterTenantId(TenantId tenantId);
46
47 /**
48 * Returns the set of tenant identifiers known to the system.
49 *
50 * @return set of known tenant identifiers
51 */
52 Set<TenantId> getTenantIds();
53
54
55 /**
56 * Creates a new virtual network for the specified tenant.
57 *
58 * @param tenantId tenant identifier
59 * @return newly created virtual network
60 */
61 VirtualNetwork createVirtualNetwork(TenantId tenantId);
62
63 /**
64 * Removes the specified virtual network and all its devices and links.
65 *
66 * @param networkId network identifier
67 */
68 void removeVirtualNetwork(NetworkId networkId);
69
70
71 /**
72 * Creates a new virtual device within the specified network. The device id
73 * must be unique within the bounds of the network.
74 *
Thomas Vachuska33979fd2015-07-31 11:41:14 -070075 * @param networkId network identifier
76 * @param deviceId device identifier
Thomas Vachuska7b438af2015-07-07 09:52:07 -070077 * @return newly created device
78 * @throws org.onlab.util.ItemNotFoundException if no such network found
79 */
Thomas Vachuska33979fd2015-07-31 11:41:14 -070080 VirtualDevice createVirtualDevice(NetworkId networkId, DeviceId deviceId);
Thomas Vachuska7b438af2015-07-07 09:52:07 -070081
82 /**
83 * Removes the specified virtual device and all its ports and affiliated links.
84 *
85 * @param networkId network identifier
86 * @param deviceId device identifier
87 * @throws org.onlab.util.ItemNotFoundException if no such network or device found
88 */
89 void removeVirtualDevice(NetworkId networkId, DeviceId deviceId);
90
91
92 /**
93 * Creates a new virtual link within the specified network.
94 *
Thomas Vachuska33979fd2015-07-31 11:41:14 -070095 * @param networkId network identifier
96 * @param src source connection point
97 * @param dst destination connection point
Thomas Vachuska7b438af2015-07-07 09:52:07 -070098 * @return newly created virtual link
99 * @throws org.onlab.util.ItemNotFoundException if no such network found
100 */
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700101 VirtualLink createVirtualLink(NetworkId networkId,
Brian Stanke9a108972016-04-11 15:25:17 -0400102 ConnectPoint src, ConnectPoint dst);
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700103
104 // TODO: Discuss whether we should provide an alternate createVirtualLink
105 // which is backed by a Path instead; I'm leaning towards not doing that.
106
107 /**
108 * Removes the specified virtual link.
109 *
110 * @param networkId network identifier
111 * @param src source connection point
112 * @param dst destination connection point
113 * @throws org.onlab.util.ItemNotFoundException if no such network or link found
114 */
115 void removeVirtualLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst);
116
117 /**
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700118 * Creates a new virtual port on the specified device.
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700119 *
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700120 * @param networkId network identifier
Brian Stanke9a108972016-04-11 15:25:17 -0400121 * @param deviceId virtual device identifier
122 * @param portNumber virtual port number
123 * @param realizedBy underlying physical port using which this virtual port is realized
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700124 * @return newly created port
Brian Stanke9a108972016-04-11 15:25:17 -0400125 * @throws org.onlab.util.ItemNotFoundException if no such network or device is found
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700126 */
127 VirtualPort createVirtualPort(NetworkId networkId, DeviceId deviceId,
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700128 PortNumber portNumber, Port realizedBy);
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700129
130 /**
131 * Removes the specified virtual port.
132 *
133 * @param networkId network identifier
134 * @param deviceId device identifier
135 * @param portNumber port number
136 * @throws org.onlab.util.ItemNotFoundException if no such network or port found
137 */
138 void removeVirtualPort(NetworkId networkId, DeviceId deviceId, PortNumber portNumber);
139
140}