use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.add.lsp.args.Arguments in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method _addMDFlow.
/**
* Adds a flow.
*
* @param ci arguments: switchId flowType tableNum, e.g.: addMDFlow openflow:1 f1 42
*/
public void _addMDFlow(final CommandInterpreter ci) {
final NodeBuilder tn = createTestNode(ci.nextArgument());
final String flowtype = ci.nextArgument();
FlowBuilder tf;
if (flowtype.equals("fTM")) {
tf = createtablemiss();
} else {
tf = createTestFlow(tn, flowtype, ci.nextArgument());
}
writeFlow(ci, tf, tn);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.add.lsp.args.Arguments in project genius by opendaylight.
the class ItmTepInstanceRecoveryHandler method recoverTep.
private void recoverTep(String entityId) throws InterruptedException {
List<DPNTEPsInfo> tepsToRecover = new ArrayList<>();
DPNTEPsInfo dpnTepsToRecover = extractDPNTepsInfo(entityId);
if (dpnTepsToRecover == null) {
LOG.error("Please Enter appropriate arguments for Tep Recovery.");
return;
} else {
tepsToRecover.add(dpnTepsToRecover);
// Delete the transportZone and re create it
// Get the transport zone from the transport zone name
TransportZone oldTz = ItmUtils.getTransportZoneFromConfigDS(tzName, dataBroker);
if (oldTz != null) {
ItmTepRemoveWorker tepRemoveWorker = new ItmTepRemoveWorker(tepsToRecover, null, oldTz, dataBroker, imdsalApiManager, itmInternalTunnelDeleteWorker, dpntePsInfoCache);
LOG.trace("Deleting transportzone {}", tzName);
jobCoordinator.enqueueJob(tzName, tepRemoveWorker);
ItmTepAddWorker tepAddWorker = new ItmTepAddWorker(tepsToRecover, null, dataBroker, imdsalApiManager, itmConfig, itmInternalTunnelAddWorker, itmExternalTunnelAddWorker, dpntePsInfoCache);
LOG.trace("Re-creating transportzone {}", tzName);
jobCoordinator.enqueueJob(tzName, tepAddWorker);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.add.lsp.args.Arguments in project genius by opendaylight.
the class ItmTepInstanceRecoveryHandler method extractDPNTepsInfo.
private DPNTEPsInfo extractDPNTepsInfo(String entityId) {
String[] params = entityId.split(":");
if (params.length < 2) {
LOG.error("Not enough arguments..Exiting...");
return null;
} else if (params.length > 2) {
LOG.info("Ignoring extra parameter and proceeding...");
}
// ToDo:- Need to add more validations
this.tzName = params[0];
String ipAddress = params[1];
transportZone = ItmUtils.getTransportZoneFromConfigDS(tzName, dataBroker);
if (transportZone == null) {
LOG.error("Transportzone name {} is not valid.", tzName);
return null;
}
for (Subnets sub : transportZone.getSubnets()) {
if (sub.getVteps() == null || sub.getVteps().isEmpty()) {
LOG.error("Transport Zone {} subnet {} has no vteps", transportZone.getZoneName(), sub.getPrefix());
}
for (Vteps vtep : sub.getVteps()) {
if (ipAddress.equals(String.valueOf(vtep.getIpAddress().getValue()))) {
List<TzMembership> zones = ItmUtils.createTransportZoneMembership(tzName);
LOG.trace("Transportzone {} found match for tep {} to be recovered", transportZone.getZoneName(), ipAddress);
// OfTunnels is false byDefault
TunnelEndPoints tunnelEndPoints = ItmUtils.createTunnelEndPoints(vtep.getDpnId(), IpAddressBuilder.getDefaultInstance(ipAddress), vtep.getPortname(), false, sub.getVlanId(), sub.getPrefix(), sub.getGatewayIp(), zones, transportZone.getTunnelType(), itmConfig.getDefaultTunnelTos());
List<TunnelEndPoints> teps = new ArrayList<>();
teps.add(tunnelEndPoints);
return ItmUtils.createDPNTepInfo(vtep.getDpnId(), teps);
}
}
}
return null;
}
Aggregations