blob: a7fbe1333fb748ec529a3d5fda6124e93ced6d0f [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;
Brian Stanke7a81b532016-06-14 15:43:51 -040019import org.onlab.packet.IpAddress;
20import org.onlab.packet.MacAddress;
21import org.onlab.packet.VlanId;
Thomas Vachuska7b438af2015-07-07 09:52:07 -070022import org.onosproject.net.ConnectPoint;
23import org.onosproject.net.DeviceId;
Brian Stanke7a81b532016-06-14 15:43:51 -040024import org.onosproject.net.HostId;
25import org.onosproject.net.HostLocation;
Thomas Vachuska7b438af2015-07-07 09:52:07 -070026import org.onosproject.net.PortNumber;
Thomas Vachuska7b438af2015-07-07 09:52:07 -070027
28import java.util.Set;
29
30/**
31 * Service for managing the inventory of virtual networks.
32 */
33@Beta
34public interface VirtualNetworkAdminService extends VirtualNetworkService {
35
36 /**
37 * Registers the specified, externally generated tenant identifier.
38 *
39 * @param tenantId tenant identifier
40 */
41 void registerTenantId(TenantId tenantId);
42
43 /**
44 * Unregisters the specified, externally generated tenant identifier.
45 *
46 * @param tenantId tenant identifier
47 * @throws IllegalStateException if there are networks still owned by this tenant
48 */
49 void unregisterTenantId(TenantId tenantId);
50
51 /**
52 * Returns the set of tenant identifiers known to the system.
53 *
54 * @return set of known tenant identifiers
55 */
56 Set<TenantId> getTenantIds();
57
58
59 /**
60 * Creates a new virtual network for the specified tenant.
61 *
62 * @param tenantId tenant identifier
63 * @return newly created virtual network
64 */
65 VirtualNetwork createVirtualNetwork(TenantId tenantId);
66
67 /**
68 * Removes the specified virtual network and all its devices and links.
69 *
70 * @param networkId network identifier
71 */
72 void removeVirtualNetwork(NetworkId networkId);
73
74
75 /**
76 * Creates a new virtual device within the specified network. The device id
77 * must be unique within the bounds of the network.
78 *
Thomas Vachuska33979fd2015-07-31 11:41:14 -070079 * @param networkId network identifier
80 * @param deviceId device identifier
Brian Stanke7a81b532016-06-14 15:43:51 -040081 * @return newly created virtual device
Thomas Vachuska7b438af2015-07-07 09:52:07 -070082 * @throws org.onlab.util.ItemNotFoundException if no such network found
83 */
Thomas Vachuska33979fd2015-07-31 11:41:14 -070084 VirtualDevice createVirtualDevice(NetworkId networkId, DeviceId deviceId);
Thomas Vachuska7b438af2015-07-07 09:52:07 -070085
86 /**
87 * Removes the specified virtual device and all its ports and affiliated links.
88 *
89 * @param networkId network identifier
90 * @param deviceId device identifier
91 * @throws org.onlab.util.ItemNotFoundException if no such network or device found
92 */
93 void removeVirtualDevice(NetworkId networkId, DeviceId deviceId);
94
Brian Stanke7a81b532016-06-14 15:43:51 -040095 /**
96 * Creates a new virtual host within the specified network. The host id
97 * must be unique within the bounds of the network.
98 *
99 * @param networkId network identifier
100 * @param hostId host identifier
101 * @param mac mac address
102 * @param vlan vlan identifier
103 * @param location host location
104 * @param ips set of ip addresses
105 * @return newly created virtual host
106 * @throws org.onlab.util.ItemNotFoundException if no such network found
107 */
108 VirtualHost createVirtualHost(NetworkId networkId, HostId hostId, MacAddress mac,
109 VlanId vlan, HostLocation location, Set<IpAddress> ips);
110
111 /**
112 * Removes the specified virtual host.
113 *
114 * @param networkId network identifier
115 * @param hostId host identifier
116 * @throws org.onlab.util.ItemNotFoundException if no such network or host found
117 */
118 void removeVirtualHost(NetworkId networkId, HostId hostId);
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700119
120 /**
121 * Creates a new virtual link within the specified network.
122 *
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700123 * @param networkId network identifier
124 * @param src source connection point
125 * @param dst destination connection point
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700126 * @return newly created virtual link
127 * @throws org.onlab.util.ItemNotFoundException if no such network found
128 */
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700129 VirtualLink createVirtualLink(NetworkId networkId,
Brian Stanke9a108972016-04-11 15:25:17 -0400130 ConnectPoint src, ConnectPoint dst);
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700131
132 // TODO: Discuss whether we should provide an alternate createVirtualLink
133 // which is backed by a Path instead; I'm leaning towards not doing that.
134
135 /**
136 * Removes the specified virtual link.
137 *
138 * @param networkId network identifier
139 * @param src source connection point
140 * @param dst destination connection point
141 * @throws org.onlab.util.ItemNotFoundException if no such network or link found
142 */
143 void removeVirtualLink(NetworkId networkId, ConnectPoint src, ConnectPoint dst);
144
145 /**
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700146 * Creates a new virtual port on the specified device.
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700147 *
Thomas Vachuska33979fd2015-07-31 11:41:14 -0700148 * @param networkId network identifier
Brian Stanke9a108972016-04-11 15:25:17 -0400149 * @param deviceId virtual device identifier
150 * @param portNumber virtual port number
151 * @param realizedBy underlying physical port using which this virtual port is realized
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700152 * @return newly created port
Brian Stanke9a108972016-04-11 15:25:17 -0400153 * @throws org.onlab.util.ItemNotFoundException if no such network or device is found
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700154 */
155 VirtualPort createVirtualPort(NetworkId networkId, DeviceId deviceId,
Yoonseon Han6c603892016-09-01 11:52:21 -0700156 PortNumber portNumber, ConnectPoint realizedBy);
157
158 /**
159 * Binds an existing virtual port on the specified device.
160 *
161 * @param networkId network identifier
162 * @param deviceId virtual device identifier
163 * @param portNumber virtual port number
164 * @param realizedBy underlying physical port using which this virtual port is realized
165 * @throws org.onlab.util.ItemNotFoundException if no such network or device is found
166 */
167 void bindVirtualPort(NetworkId networkId, DeviceId deviceId,
168 PortNumber portNumber, ConnectPoint realizedBy);
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700169
170 /**
171 * Removes the specified virtual port.
172 *
173 * @param networkId network identifier
174 * @param deviceId device identifier
175 * @param portNumber port number
176 * @throws org.onlab.util.ItemNotFoundException if no such network or port found
177 */
178 void removeVirtualPort(NetworkId networkId, DeviceId deviceId, PortNumber portNumber);
Thomas Vachuska7b438af2015-07-07 09:52:07 -0700179}