use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation in project genius by opendaylight.
the class InterfacemgrProvider method getParentRefNameForInterface.
@Override
public String getParentRefNameForInterface(String interfaceName) {
String parentRefName = null;
String dpnId = getDpidForInterface(interfaceName, null);
OvsdbTerminationPointAugmentation ovsdbTp = getTerminationPoint(interfaceName);
if (ovsdbTp != null) {
if (dpnId == null) {
LOG.error("Got NULL dpnId when looking for TP with external ID {}", interfaceName);
return null;
}
parentRefName = getPortNameForInterface(dpnId, ovsdbTp.getName());
LOG.debug("Building parent ref for interface {}, using parentRefName {} acquired by external ID", interfaceName, parentRefName);
} else {
LOG.debug("Skipping parent ref for interface {}, as there is no termination point that references " + "this interface yet.", interfaceName);
}
return parentRefName;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation in project genius by opendaylight.
the class InterfacemgrProvider method getPortsOnBridge.
@Override
public /**
* Get all termination points on a given DPN.
* This API uses read on Operational DS. If there are perf issues in cluster
* setup, we can consider caching later.
*
* @param dpnId
* Datapath Node Identifier
*
* @return If the data at the supplied path exists, returns a list of all termination point
* Augmentations
*/
List<OvsdbTerminationPointAugmentation> getPortsOnBridge(BigInteger dpnId) {
List<OvsdbTerminationPointAugmentation> ports = new ArrayList<>();
List<TerminationPoint> portList = interfaceMetaUtils.getTerminationPointsOnBridge(dpnId);
for (TerminationPoint ovsPort : portList) {
if (ovsPort.getAugmentation(OvsdbTerminationPointAugmentation.class) != null) {
ports.add(ovsPort.getAugmentation(OvsdbTerminationPointAugmentation.class));
}
}
LOG.debug("Found {} ports on bridge {}", ports.size(), dpnId);
return ports;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation in project genius by opendaylight.
the class IfmCLIUtil method getPortDetails.
private static String getPortDetails(OvsdbTerminationPointAugmentation port) {
if (SouthboundUtils.isInterfaceTypeTunnel(port.getInterfaceType())) {
String remoteIp = UNSET;
String localIp = UNSET;
String key = UNSET;
for (Options portOption : port.getOptions()) {
switch(portOption.getOption()) {
case "local_ip":
localIp = portOption.getValue();
break;
case "remote_ip":
remoteIp = portOption.getValue();
break;
case "key":
key = portOption.getValue();
break;
default:
break;
}
}
return String.format(TP_VXLAN_OUTPUT_FORMAT_LINE1, localIp, remoteIp, key);
}
return String.format(TP_OUTPUT_FORMAT_LINE2, UNSET);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation in project genius by opendaylight.
the class ShowOvsPorts method doExecute.
@Override
protected Object doExecute() {
LOG.debug("Executing show ovs-ports command");
List<OvsdbTerminationPointAugmentation> ports = interfaceManager.getPortsOnBridge(dpnId);
if (!ports.isEmpty()) {
IfmCLIUtil.showBridgePortsHeader(session, dpnId);
}
for (OvsdbTerminationPointAugmentation port : ports) {
IfmCLIUtil.showBridgePortsOutput(session, port);
}
return null;
}
Aggregations