blob: ef226442a5d3cc581b707d0f5c3417c6c7dca24b [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 Vachuska33979fd2015-07-31 11:41:14 -070019import org.onosproject.incubator.net.tunnel.TunnelId;
Thomas Vachuska7b438af2015-07-07 09:52:07 -070020import org.onosproject.net.ConnectPoint;
21import org.onosproject.net.DeviceId;
22import org.onosproject.net.Port;
23import org.onosproject.net.PortNumber;
Thomas Vachuska7b438af2015-07-07 09:52:07 -070024
25import java.util.Set;
26
27/**
28 * Service for managing the inventory of virtual networks.
29 */
30@Beta
31public interface VirtualNetworkAdminService extends VirtualNetworkService {
32
33 /**
34 * Registers the specified, externally generated tenant identifier.
35 *
36 * @param tenantId tenant identifier
37 */
38 void registerTenantId(TenantId tenantId);
39
40 /**
41 * Unregisters the specified, externally generated tenant identifier.
42 *
43 * @param tenantId tenant identifier
44 * @throws IllegalStateException if there are networks still owned by this tenant
45 */
46 void unregisterTenantId(TenantId tenantId);
47
48 /**
49 * Returns the set of tenant identifiers known to the system.
50 *
51 * @return set of known tenant identifiers
52 */
53 Set<TenantId> getTenantIds();
54
55
56 /**
57 * Creates a new virtual network for the specified tenant.
58 *
59 * @param tenantId tenant identifier
60 * @return newly created virtual network
61 */
62 VirtualNetwork createVirtualNetwork(TenantId tenantId);
63
64 /**
65 * Removes the specified virtual network and all its devices and links.
66 *
67 * @param networkId network identifier
68 */
69 void removeVirtualNetwork(NetworkId networkId);
70
71
72 /**
73 * Creates a new virtual device within the specified network. The device id
74 * must be unique within the bounds of the network.
75 *
Thomas Vachuska33979fd2015-07-31 11:41:14 -070076 * @param networkId network identifier
77 * @param deviceId device identifier
Thomas Vachuska7b438af2015-07-07 09:52:07 -070078 * @return newly created device
79 * @throws org.onlab.util.ItemNotFoundException if no such network found
80 */
Thomas Vachuska33979fd2015-07-31 11:41:14 -070081 VirtualDevice createVirtualDevice(NetworkId networkId, DeviceId deviceId);
Thomas Vachuska7b438af2015-07-07 09:52:07 -070082
83 /**
84 * Removes the specified virtual device and all its ports and affiliated links.
85 *
86 * @param networkId network identifier
87 * @param deviceId device identifier
88 * @throws org.onlab.util.ItemNotFoundException if no such network or device found
89 */
90 void removeVirtualDevice(NetworkId networkId, DeviceId deviceId);
91
92
93 /**
94 * Creates a new virtual link within the specified network.
95 *
Thomas Vachuska33979fd2015-07-31 11:41:14 -070096 * @param networkId network identifier
97 * @param src source connection point
98 * @param dst destination connection point
99 * @param realizedBy identifier of the tunnel using which this link is realized
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700100 * @return newly created virtual link
101 * @throws org.onlab.util.ItemNotFoundException if no such network found
102 */
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700103 VirtualLink createVirtualLink(NetworkId networkId,
104 ConnectPoint src, ConnectPoint dst,
105 TunnelId realizedBy);
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700106
107 // TODO: Discuss whether we should provide an alternate createVirtualLink
108 // which is backed by a Path instead; I'm leaning towards not doing that.
109
110 /**
111 * Removes the specified virtual link.
112 *
113 * @param networkId network identifier
114 * @param src source connection point
115 * @param dst destination connection point
116 * @throws org.onlab.util.ItemNotFoundException if no such network or link found
117 */
118 void removeVirtualLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst);
119
120 /**
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700121 * Creates a new virtual port on the specified device.
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700122 *
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700123 * @param networkId network identifier
124 * @param deviceId device identifier
125 * @param portNumber port number
126 * @param realizedBy underlying port using which this virtual port is realized
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700127 * @return newly created port
128 * @throws org.onlab.util.ItemNotFoundException if no such network or device found
129 */
130 VirtualPort createVirtualPort(NetworkId networkId, DeviceId deviceId,
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700131 PortNumber portNumber, Port realizedBy);
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700132
133 /**
134 * Removes the specified virtual port.
135 *
136 * @param networkId network identifier
137 * @param deviceId device identifier
138 * @param portNumber port number
139 * @throws org.onlab.util.ItemNotFoundException if no such network or port found
140 */
141 void removeVirtualPort(NetworkId networkId, DeviceId deviceId, PortNumber portNumber);
142
143}