Use Topology Node in place of Inventory Node
[ovsdb.git] / openstack / net-virt / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / api / BridgeConfigurationManager.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 org.opendaylight.neutron.spi.NeutronNetwork;
14 import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
15 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
16
17 import java.util.List;
18
19 /**
20  * OpenStack Neutron with the Open vSwitch plugin relies on a typical bridge configuration that
21  * consists of br-int (Integration Bridge), br-net (Network bridge), br-ex (External bridge).
22  *
23  * This class ensures that the bridges on each {@link Node}
24  * are correctly configured for OpenStack Neutron
25  *
26  */
27 public interface BridgeConfigurationManager {
28
29     /**
30      * A helper function to get the UUID of a given Bridge
31      * @param node the {@link Node} where the bridge is configured
32      * @param bridgeName the name of the bridge
33      * @return the UUID of the bridge
34      */
35     public String getBridgeUuid(Node node, String bridgeName);
36
37     /**
38      * Checks for the existence of the Integration Bridge on a given Node
39      * @param node the {@link Node} where the bridge should be configured
40      * @return True if the bridge exists, False if it does not
41      */
42     public boolean isNodeNeutronReady(Node node);
43
44     /**
45      * Checks for the existence of the Network Bridge on a given Node
46      * @param node the {@link Node} where the bridge should be configured
47      * @return True if the bridge exists, False if it does not
48      */
49     public boolean isNodeOverlayReady(Node node);
50
51     /**
52      * Checks for the existence of the Network Bridge on a given Node
53      * @param node the {@link Node} where the bridge should be configured
54      * @return True if the bridge exists, False if it does not
55      */
56
57     /**
58      * Checks that a Node is ready for a Tunnel Network Provider
59      * For OpenFlow 1.0 the Integration, Network Bridge and corresponding patch ports are required
60      * For OpenFlow 1.3 only the Integration Bridge is required
61      * @param node the {@link Node} where the bridge is configured
62      * @return True or False
63      */
64     public boolean isNodeTunnelReady(Node node);
65
66     /* Determine if internal network is ready for vlan network types.
67      * - OF 1.0 requires br-int, br-net, a patch connecting them and
68      * physical device added to br-net.
69      * - OF 1.3 requires br-int and physical device added to br-int.
70      */
71
72     /**
73      * Checks that a Node is ready for a VLAN Network Provider for the given Network
74      * For OpenFlow 1.0 the Integration Bridge, Network Bridge, patch ports and a physical device connected to the
75      * Network Bridge are required.
76      * For OpenFlow 1.3 the Integration Bridge is required and must have a physical device connected.
77      * @param node the {@link Node} where the bridge is configured
78      * @param network the {@link org.opendaylight.neutron.spi.NeutronNetwork}
79      * @return True or False
80      */
81     public boolean isNodeVlanReady(Node node, NeutronNetwork network);
82
83     /**
84      * A helper function to determine if a port exists on a given bridge
85      * @param node the {@link Node} where the bridge is configured
86      * @param bridge the {@link org.opendaylight.ovsdb.schema.openvswitch.Bridge} to query
87      * @param portName the name of the port to search for
88      * @return True if the port exists, otherwise False
89      */
90     public boolean isPortOnBridge (Node node, Bridge bridge, String portName);
91
92
93     /**
94      * Returns true if the bridges required for the provider network type are created
95      * If the bridges are not created, this method will attempt to create them
96      * @param node the {@link Node} to query
97      * @param network the {@link org.opendaylight.neutron.spi.NeutronNetwork}
98      * @return True or False
99      */
100     public boolean createLocalNetwork(Node node, NeutronNetwork network);
101
102     /**
103      * Prepares the given Node for Neutron Networking by creating the Integration Bridge
104      * @param node the {@link Node} to prepare
105      */
106     public void prepareNode(Node node);
107
108     /**
109      * Returns the physical interface mapped to the given neutron physical network.
110      * @param node
111      * @param physicalNetwork
112      * @return
113      */
114     public String getPhysicalInterfaceName (Node node, String physicalNetwork);
115
116     /** Returns all physical interfaces configured in the bridge mapping
117      * Bridge mappings will be of the following format:
118      * @param node the {@link Node} to query
119      * @return a List in the format {eth1, eth2} given bridge_mappings=physnet1:eth1,physnet2:eth2
120      */
121     public List<String> getAllPhysicalInterfaceNames(Node node);
122 }