More southbound migration for netvirt
[ovsdb.git] / openstack / net-virt / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / api / TenantNetworkManager.java
1 /*
2  * Copyright (C) 2014 Red Hat, Inc.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  *
8  *  Authors : Dave Tucker
9  */
10
11 package org.opendaylight.ovsdb.openstack.netvirt.api;
12
13 import java.util.List;
14 import org.opendaylight.neutron.spi.NeutronNetwork;
15 import org.opendaylight.neutron.spi.NeutronPort;
16 import org.opendaylight.ovsdb.schema.openvswitch.Interface;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIds;
19 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
20
21 /**
22  * Open vSwitch isolates Tenant Networks using VLANs on the Integration Bridge
23  * This class manages the provisioning of these VLANs
24  */
25 public interface TenantNetworkManager {
26
27     /**
28      * Get the VLAN assigned to the provided Network
29      * @param node the {Node} to query
30      * @param networkId the Neutron Network ID
31      * @return the assigned VLAN ID or 0 in case of an error
32      */
33     public int getInternalVlan(Node node, String networkId);
34
35     /**
36      * Reclaim the assigned VLAN for the given Network
37      * @param node the {Node} to query
38      * @param network the Neutron Network ID
39      */
40     public void reclaimInternalVlan(Node node, NeutronNetwork network);
41
42     /**
43      * Configures the VLAN for a Tenant Network
44      * @param node the {Node} to configure
45      * @param portUUID the UUID of the port to configure
46      * @param network the Neutron Network ID
47      */
48     public void programInternalVlan(Node node, String portUUID, NeutronNetwork network);
49
50     /**
51      * Check is the given network is present on a Node
52      * @param node the {Node} to query
53      * @param segmentationId the Neutron Segementation ID
54      * @return True or False
55      */
56     public boolean isTenantNetworkPresentInNode(Node node, String segmentationId);
57
58     /**
59      * Get the Neutron Network ID for a given Segmentation ID
60      */
61     public String getNetworkId (String segmentationId);
62
63     /**
64      * Get the {@link org.opendaylight.neutron.spi.NeutronNetwork} for a given Interface
65      */
66     public NeutronNetwork getTenantNetwork(Interface intf);
67
68     /**
69      * Network Created Callback
70      */
71     public int networkCreated (Node node, String networkId);
72
73     /**
74      * Network Deleted Callback
75      */
76     public void networkDeleted(String id);
77
78     NeutronNetwork getTenantNetwork(OvsdbTerminationPointAugmentation terminationPointAugmentation);
79     public NeutronPort getTenantPort(OvsdbTerminationPointAugmentation terminationPointAugmentation);
80 }