Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 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 | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame^] | 19 | import org.onosproject.incubator.net.tunnel.TunnelId; |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 20 | import org.onosproject.net.ConnectPoint; |
| 21 | import org.onosproject.net.DeviceId; |
| 22 | import org.onosproject.net.Port; |
| 23 | import org.onosproject.net.PortNumber; |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 24 | |
| 25 | import java.util.Set; |
| 26 | |
| 27 | /** |
| 28 | * Service for managing the inventory of virtual networks. |
| 29 | */ |
| 30 | @Beta |
| 31 | public 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 Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame^] | 76 | * @param networkId network identifier |
| 77 | * @param deviceId device identifier |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 78 | * @return newly created device |
| 79 | * @throws org.onlab.util.ItemNotFoundException if no such network found |
| 80 | */ |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame^] | 81 | VirtualDevice createVirtualDevice(NetworkId networkId, DeviceId deviceId); |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 82 | |
| 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 Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame^] | 96 | * @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 Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 100 | * @return newly created virtual link |
| 101 | * @throws org.onlab.util.ItemNotFoundException if no such network found |
| 102 | */ |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame^] | 103 | VirtualLink createVirtualLink(NetworkId networkId, |
| 104 | ConnectPoint src, ConnectPoint dst, |
| 105 | TunnelId realizedBy); |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 106 | |
| 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 Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame^] | 121 | * Creates a new virtual port on the specified device. |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 122 | * |
Thomas Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame^] | 123 | * @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 Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 127 | * @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 Vachuska | 33979fd | 2015-07-31 11:41:14 -0700 | [diff] [blame^] | 131 | PortNumber portNumber, Port realizedBy); |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 132 | |
| 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 | } |