Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 3 | * |
| 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 | */ |
| 16 | package org.onosproject.incubator.net.virtual; |
| 17 | |
| 18 | import com.google.common.annotations.Beta; |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 19 | import org.onosproject.net.ConnectPoint; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | import org.onosproject.net.Port; |
| 22 | import org.onosproject.net.PortNumber; |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 23 | |
| 24 | import java.util.Set; |
| 25 | |
| 26 | /** |
| 27 | * Service for managing the inventory of virtual networks. |
| 28 | */ |
| 29 | @Beta |
| 30 | public 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 Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 75 | * @param networkId network identifier |
| 76 | * @param deviceId device identifier |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 77 | * @return newly created device |
| 78 | * @throws org.onlab.util.ItemNotFoundException if no such network found |
| 79 | */ |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 80 | VirtualDevice createVirtualDevice(NetworkId networkId, DeviceId deviceId); |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 81 | |
| 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 Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 95 | * @param networkId network identifier |
| 96 | * @param src source connection point |
| 97 | * @param dst destination connection point |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 98 | * @return newly created virtual link |
| 99 | * @throws org.onlab.util.ItemNotFoundException if no such network found |
| 100 | */ |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 101 | VirtualLink createVirtualLink(NetworkId networkId, |
Brian Stanke | 9a10897 | 2016-04-11 15:25:17 -0400 | [diff] [blame^] | 102 | ConnectPoint src, ConnectPoint dst); |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 103 | |
| 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 Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 118 | * Creates a new virtual port on the specified device. |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 119 | * |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 120 | * @param networkId network identifier |
Brian Stanke | 9a10897 | 2016-04-11 15:25:17 -0400 | [diff] [blame^] | 121 | * @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 Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 124 | * @return newly created port |
Brian Stanke | 9a10897 | 2016-04-11 15:25:17 -0400 | [diff] [blame^] | 125 | * @throws org.onlab.util.ItemNotFoundException if no such network or device is found |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 126 | */ |
| 127 | VirtualPort createVirtualPort(NetworkId networkId, DeviceId deviceId, |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame] | 128 | PortNumber portNumber, Port realizedBy); |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 129 | |
| 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 | } |