2 * Copyright (c) 2015 Red Hat, Inc. and others. All rights reserved.
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
8 package org.opendaylight.ovsdb.openstack.netvirt;
10 import com.google.common.base.Optional;
11 import com.google.common.collect.ImmutableBiMap;
12 import com.google.common.util.concurrent.CheckedFuture;
14 import java.math.BigInteger;
15 import java.security.InvalidParameterException;
16 import java.util.ArrayList;
17 import java.util.List;
20 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
21 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
22 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
23 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
24 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
25 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
26 import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbTables;
27 import org.opendaylight.ovsdb.southbound.SouthboundConstants;
28 import org.opendaylight.ovsdb.southbound.SouthboundMapper;
29 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
30 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeInternal;
32 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
33 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentationBuilder;
34 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName;
35 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeProtocolBase;
36 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
37 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeRef;
38 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
39 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentationBuilder;
40 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
41 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntryBuilder;
42 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntry;
43 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntryBuilder;
44 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
45 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchExternalIds;
46 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIds;
47 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.Options;
48 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.OptionsBuilder;
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.OptionsKey;
50 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
51 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
52 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
53 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
54 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
55 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
56 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
57 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder;
58 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
59 import org.slf4j.Logger;
60 import org.slf4j.LoggerFactory;
63 * Utility class to wrap mdsal transactions.
65 * @author Sam Hague (shague@redhat.com)
67 public class MdsalUtils {
68 private static final Logger LOG = LoggerFactory.getLogger(MdsalUtils.class);
69 private static DataBroker databroker = null;
70 private static final int OVSDB_UPDATE_TIMEOUT = 500;
73 * Class constructor setting the data broker.
75 * @param dataBroker the {@link org.opendaylight.controller.md.sal.binding.api.DataBroker}
77 public MdsalUtils(DataBroker dataBroker) {
78 this.databroker = dataBroker;
82 * Executes delete as a blocking transaction.
84 * @param store {@link LogicalDatastoreType} which should be modified
85 * @param path {@link InstanceIdentifier} to read from
86 * @param <D> the data object type
87 * @return the result of the request
89 public static <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean delete(
90 final LogicalDatastoreType store, final InstanceIdentifier<D> path) {
91 boolean result = false;
92 final WriteTransaction transaction = databroker.newWriteOnlyTransaction();
93 transaction.delete(store, path);
94 CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
98 } catch (TransactionCommitFailedException e) {
99 LOG.warn("Failed to delete {} ", path, e);
105 * Executes merge as a blocking transaction.
107 * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified
108 * @param path {@link InstanceIdentifier} for path to read
109 * @param <D> the data object type
110 * @return the result of the request
112 public static <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean merge(
113 final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data) {
114 boolean result = false;
115 final WriteTransaction transaction = databroker.newWriteOnlyTransaction();
116 transaction.merge(logicalDatastoreType, path, data, true);
117 CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
121 } catch (TransactionCommitFailedException e) {
122 LOG.warn("Failed to merge {} ", path, e);
128 * Executes put as a blocking transaction.
130 * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified
131 * @param path {@link InstanceIdentifier} for path to read
132 * @param <D> the data object type
133 * @return the result of the request
135 public static <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean put(
136 final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data) {
137 boolean result = false;
138 final WriteTransaction transaction = databroker.newWriteOnlyTransaction();
139 transaction.put(logicalDatastoreType, path, data, true);
140 CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
144 } catch (TransactionCommitFailedException e) {
145 LOG.warn("Failed to put {} ", path, e);
151 * Executes read as a blocking transaction.
153 * @param store {@link LogicalDatastoreType} to read
154 * @param path {@link InstanceIdentifier} for path to read
155 * @param <D> the data object type
156 * @return the result as the data object requested
158 public static <D extends org.opendaylight.yangtools.yang.binding.DataObject> D read(
159 final LogicalDatastoreType store, final InstanceIdentifier<D> path) {
161 final ReadOnlyTransaction transaction = databroker.newReadOnlyTransaction();
162 Optional<D> optionalDataObject;
163 CheckedFuture<Optional<D>, ReadFailedException> future = transaction.read(store, path);
165 optionalDataObject = future.checkedGet();
166 if (optionalDataObject.isPresent()) {
167 result = optionalDataObject.get();
169 LOG.debug("{}: Failed to read {}",
170 Thread.currentThread().getStackTrace()[1], path);
172 } catch (ReadFailedException e) {
173 LOG.warn("Failed to read {} ", path, e);
179 public static ConnectionInfo getConnectionInfo(Node node) {
180 ConnectionInfo connectionInfo = null;
181 OvsdbNodeAugmentation ovsdbNodeAugmentation = node.getAugmentation(OvsdbNodeAugmentation.class);
182 if (ovsdbNodeAugmentation != null) {
183 connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
185 return connectionInfo;
188 public static String getOvsdbNodeUUID(Node node) {
189 String nodeUUID = null;
190 OvsdbNodeAugmentation ovsdbNodeAugmentation = node.getAugmentation(OvsdbNodeAugmentation.class);
191 if (ovsdbNodeAugmentation != null) {
192 // TODO replace with proper uuid and not the system-id
193 nodeUUID = getOsdbNodeExternalIdsValue(ovsdbNodeAugmentation, "system-id");
198 public static String getOsdbNodeExternalIdsValue(OvsdbNodeAugmentation ovsdbNodeAugmentation, String key) {
200 List<OpenvswitchExternalIds> pairs = ovsdbNodeAugmentation.getOpenvswitchExternalIds();
201 for (OpenvswitchExternalIds pair : pairs) {
202 if (pair.getKey().equals(key)) {
203 value = pair.getExternalIdValue();
209 public static boolean addBridge(Node ovsdbNode, String bridgeName, String target)
210 throws InterruptedException, InvalidParameterException {
211 boolean result = false;
213 LOG.info("Add Bridge: node: {}, bridgeName: {}, target: {}", ovsdbNode, bridgeName, target);
214 ConnectionInfo connectionInfo = getConnectionInfo(ovsdbNode);
215 if (connectionInfo != null) {
216 NodeBuilder bridgeNodeBuilder = new NodeBuilder();
217 InstanceIdentifier<Node> bridgeIid =
218 SouthboundMapper.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName));
219 NodeId bridgeNodeId = SouthboundMapper.createManagedNodeId(bridgeIid);
220 bridgeNodeBuilder.setNodeId(bridgeNodeId);
221 OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
222 ovsdbBridgeAugmentationBuilder.setControllerEntry(createControllerEntries(target));
223 ovsdbBridgeAugmentationBuilder.setBridgeName(new OvsdbBridgeName(bridgeName));
224 ovsdbBridgeAugmentationBuilder.setProtocolEntry(createMdsalProtocols());
225 ovsdbBridgeAugmentationBuilder.setFailMode(
226 SouthboundConstants.OVSDB_FAIL_MODE_MAP.inverse().get("secure"));
227 setManagedByForBridge(ovsdbBridgeAugmentationBuilder, connectionInfo);
228 bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
230 result = put(LogicalDatastoreType.CONFIGURATION, bridgeIid, bridgeNodeBuilder.build());
231 LOG.info("addBridge: result: {}", result);
233 throw new InvalidParameterException("Could not find ConnectionInfo");
238 public static boolean deleteBridge(Node ovsdbNode) {
239 boolean result = false;
240 InstanceIdentifier<Node> bridgeIid =
241 SouthboundMapper.createInstanceIdentifier(ovsdbNode.getNodeId());
243 result = delete(LogicalDatastoreType.CONFIGURATION, bridgeIid);
244 LOG.info("Delete bridge node: {}, bridgeName: {} result : {}", ovsdbNode, ovsdbNode.getNodeId(),result);
248 public static OvsdbBridgeAugmentation readBridge(Node node, String name) {
249 OvsdbBridgeAugmentation ovsdbBridgeAugmentation = null;
250 ConnectionInfo connectionInfo = getConnectionInfo(node);
251 if (connectionInfo != null) {
252 InstanceIdentifier<Node> bridgeIid =
253 SouthboundMapper.createInstanceIdentifier(connectionInfo,
254 new OvsdbBridgeName(name));
255 Node bridgeNode = read(LogicalDatastoreType.OPERATIONAL, bridgeIid);
256 if (bridgeNode != null) {
257 ovsdbBridgeAugmentation = bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
260 return ovsdbBridgeAugmentation;
263 public static Uuid getBridgeUuid(Node node, String name) {
265 OvsdbBridgeAugmentation ovsdbBridgeAugmentation = readBridge(node, name);
266 if (ovsdbBridgeAugmentation != null) {
267 uuid = ovsdbBridgeAugmentation.getBridgeUuid();
272 private static void setManagedByForBridge(OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder,
273 ConnectionInfo connectionInfo) {
274 InstanceIdentifier<Node> connectionNodePath = SouthboundMapper.createInstanceIdentifier(connectionInfo);
275 ovsdbBridgeAugmentationBuilder.setManagedBy(new OvsdbNodeRef(connectionNodePath));
278 private static void setControllerForBridge(Node ovsdbNode, String bridgeName, String targetString) {
279 ConnectionInfo connectionInfo = getConnectionInfo(ovsdbNode);
280 if (connectionInfo != null) {
281 for (ControllerEntry controllerEntry: createControllerEntries(targetString)) {
282 InstanceIdentifier<ControllerEntry> iid =
283 SouthboundMapper.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName))
284 .augmentation(OvsdbBridgeAugmentation.class)
285 .child(ControllerEntry.class, controllerEntry.getKey());
287 boolean result = put(LogicalDatastoreType.CONFIGURATION, iid, controllerEntry);
288 LOG.info("addController: result: {}", result);
293 private static List<ControllerEntry> createControllerEntries(String targetString) {
294 List<ControllerEntry> controllerEntries = new ArrayList<ControllerEntry>();
295 ControllerEntryBuilder controllerEntryBuilder = new ControllerEntryBuilder();
296 controllerEntryBuilder.setTarget(new Uri(targetString));
297 controllerEntries.add(controllerEntryBuilder.build());
298 return controllerEntries;
301 private static List<ProtocolEntry> createMdsalProtocols() {
302 List<ProtocolEntry> protocolList = new ArrayList<ProtocolEntry>();
303 ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
304 SouthboundConstants.OVSDB_PROTOCOL_MAP.inverse();
305 protocolList.add(new ProtocolEntryBuilder().
306 setProtocol((Class<? extends OvsdbBridgeProtocolBase>) mapper.get("OpenFlow13")).build());
310 public static long getDataPathId(Node node) {
312 String datapathId = getDatapathId(node);
313 if (datapathId != null) {
314 dpid = new BigInteger(datapathId.replaceAll(":", ""), 16).longValue();
319 public static String getDatapathId(Node node) {
320 String datapathId = null;
321 OvsdbBridgeAugmentation ovsdbBridgeAugmentation = node.getAugmentation(OvsdbBridgeAugmentation.class);
322 if (ovsdbBridgeAugmentation != null && ovsdbBridgeAugmentation.getDatapathId() != null) {
323 datapathId = node.getAugmentation(OvsdbBridgeAugmentation.class).getDatapathId().getValue();
328 public static String getDatapathId(OvsdbBridgeAugmentation ovsdbBridgeAugmentation) {
329 String datapathId = null;
330 if (ovsdbBridgeAugmentation != null && ovsdbBridgeAugmentation.getDatapathId() != null) {
331 datapathId = ovsdbBridgeAugmentation.getDatapathId().getValue();
336 public static OvsdbBridgeAugmentation getBridge(Node node, String name) {
337 OvsdbBridgeAugmentation bridge = node.getAugmentation(OvsdbBridgeAugmentation.class);
338 if (bridge != null) {
339 if (!bridge.getBridgeName().equals(name)) {
346 public static String extractBridgeName(Node node) {
347 return (node.getAugmentation(OvsdbBridgeAugmentation.class).getBridgeName().getValue());
350 public static OvsdbBridgeAugmentation extractBridgeAugmentation(Node node) {
351 return node.getAugmentation(OvsdbBridgeAugmentation.class);
354 public static List<Node> getAllBridgesOnOvsdbNode(Node node) {
359 * Method read ports from bridge node. Method will check if the provided node
360 * has the ports details, if not, it will read from Operational data store.
364 public static List<OvsdbTerminationPointAugmentation> getTerminationPointsOfBridge(Node node) {
365 List<OvsdbTerminationPointAugmentation> tpAugmentations = extractTerminationPointAugmentations( node);
366 if(tpAugmentations.isEmpty()){
367 tpAugmentations = readTerminationPointAugmentationFromDataStore(node);
369 return tpAugmentations;
372 public static OvsdbTerminationPointAugmentation extractTerminationPointAugmentation(Node bridgeNode, String portName) {
373 OvsdbBridgeAugmentation ovsdbBridgeAugmentation = bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
374 if (ovsdbBridgeAugmentation != null) {
375 List<TerminationPoint> terminationPoints = bridgeNode.getTerminationPoint();
376 for(TerminationPoint terminationPoint : terminationPoints) {
377 OvsdbTerminationPointAugmentation ovsdbTerminationPointAugmentation =
378 terminationPoint.getAugmentation( OvsdbTerminationPointAugmentation.class);
379 if (ovsdbTerminationPointAugmentation != null
380 && ovsdbTerminationPointAugmentation.getName().equals(portName)) {
381 return ovsdbTerminationPointAugmentation;
388 public static List<TerminationPoint> extractTerminationPoints(Node node) {
389 List<TerminationPoint> terminationPoints = new ArrayList<TerminationPoint>();
390 OvsdbBridgeAugmentation ovsdbBridgeAugmentation = node.getAugmentation(OvsdbBridgeAugmentation.class);
391 if (ovsdbBridgeAugmentation != null) {
392 terminationPoints.addAll(node.getTerminationPoint());
394 return terminationPoints;
397 public static List<OvsdbTerminationPointAugmentation> extractTerminationPointAugmentations( Node node ) {
398 List<OvsdbTerminationPointAugmentation> tpAugmentations = new ArrayList<OvsdbTerminationPointAugmentation>();
399 List<TerminationPoint> terminationPoints = node.getTerminationPoint();
400 if(terminationPoints != null && !terminationPoints.isEmpty()){
401 for(TerminationPoint tp : terminationPoints){
402 tpAugmentations.add(tp.getAugmentation(OvsdbTerminationPointAugmentation.class));
405 return tpAugmentations;
408 public static List<OvsdbTerminationPointAugmentation> readTerminationPointAugmentationFromDataStore( Node node ) {
409 InstanceIdentifier<Node> bridgeNodeIid = SouthboundMapper.createInstanceIdentifier(node.getNodeId());
410 Node operNode = read(LogicalDatastoreType.OPERATIONAL, bridgeNodeIid);
411 if(operNode != null){
412 return extractTerminationPointAugmentations(operNode);
414 return new ArrayList<OvsdbTerminationPointAugmentation>();
417 public static String getInterfaceExternalIdsValue(
418 OvsdbTerminationPointAugmentation terminationPointAugmentation,String key) {
420 List<InterfaceExternalIds> pairs = terminationPointAugmentation.getInterfaceExternalIds();
422 for (InterfaceExternalIds pair : pairs) {
423 if (pair.getKey().equals(key)) {
424 value = pair.getExternalIdValue();
431 public static Boolean addTerminationPoint(Node bridgeNode, String bridgeName, String portName) {
432 InstanceIdentifier<TerminationPoint> tpIid =
433 MdsalHelper.createTerminationPointInstanceIdentifier(bridgeNode, portName);
434 OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder =
435 new OvsdbTerminationPointAugmentationBuilder();
437 tpAugmentationBuilder.setName(portName);
438 tpAugmentationBuilder.setInterfaceType(InterfaceTypeInternal.class);
439 TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
440 tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
441 return put(LogicalDatastoreType.CONFIGURATION,tpIid,tpBuilder.build());
444 public static Boolean deleteTerminationPoint(Node bridgeNode, String portName) {
445 InstanceIdentifier<TerminationPoint> tpIid =
446 MdsalHelper.createTerminationPointInstanceIdentifier(bridgeNode, portName);
447 return delete(LogicalDatastoreType.CONFIGURATION,tpIid);
450 public static Boolean addTunnelTerminationPoint(Node bridgeNode, String bridgeName, String portName, String type,
451 Map<String, String> options) {
452 InstanceIdentifier<TerminationPoint> tpIid =
453 MdsalHelper.createTerminationPointInstanceIdentifier(bridgeNode, portName);
454 OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder =
455 new OvsdbTerminationPointAugmentationBuilder();
457 tpAugmentationBuilder.setName(portName);
458 tpAugmentationBuilder.setInterfaceType(MdsalHelper.OVSDB_INTERFACE_TYPE_MAP.get(type));
460 List<Options> optionsList = new ArrayList<Options>();
461 for(Map.Entry<String,String> entry : options.entrySet()){
462 OptionsBuilder optionsBuilder = new OptionsBuilder();
463 optionsBuilder.setKey(new OptionsKey(entry.getKey()));
464 optionsBuilder.setOption(entry.getKey());
465 optionsBuilder.setValue(entry.getValue());
466 optionsList.add(optionsBuilder.build());
468 tpAugmentationBuilder.setOptions(optionsList);
470 TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
471 tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
472 return put(LogicalDatastoreType.CONFIGURATION,tpIid,tpBuilder.build());
475 public static Boolean addPatchTerminationPoint(Node node, String bridgeName, String portName, String peerPortName) {
479 public static String getExternalId(Node node, OvsdbTables table, String key) {
483 public static String getOtherConfig(Node node, OvsdbTables table, String key) {
487 public static boolean addVlanToTp(long vlan) {
491 public static boolean isTunnel(OvsdbTerminationPointAugmentation port) {
492 return SouthboundMapper.createOvsdbInterfaceType(
493 port.getInterfaceType()).equals(NetworkHandler.NETWORK_TYPE_VXLAN)
494 || SouthboundMapper.createOvsdbInterfaceType(
495 port.getInterfaceType()).equals(NetworkHandler.NETWORK_TYPE_GRE);
498 public static String getOptionsValue(List<Options> options, String key) {
500 for (Options option : options) {
501 if (option.getKey().equals(key)) {
502 value = option.getValue();
508 private static Topology getOvsdbTopology() {
509 InstanceIdentifier<Topology> path = InstanceIdentifier
510 .create(NetworkTopology.class)
511 .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID));
513 Topology topology = read(LogicalDatastoreType.OPERATIONAL, path);