use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project netvirt by opendaylight.
the class NexthopManager method getEgressActions.
private List<Action> getEgressActions(String interfaceName, int actionKey) {
List<Action> actions = Collections.emptyList();
try {
GetEgressActionsForInterfaceInputBuilder egressAction = new GetEgressActionsForInterfaceInputBuilder().setIntfName(interfaceName).setActionKey(actionKey);
Future<RpcResult<GetEgressActionsForInterfaceOutput>> result = interfaceManager.getEgressActionsForInterface(egressAction.build());
RpcResult<GetEgressActionsForInterfaceOutput> rpcResult = result.get();
if (!rpcResult.isSuccessful()) {
LOG.warn("RPC Call to Get egress actions for interface {} returned with Errors {}", interfaceName, rpcResult.getErrors());
} else {
actions = rpcResult.getResult().getAction();
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Exception when egress actions for interface {}", interfaceName, e);
}
return actions;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project netvirt by opendaylight.
the class NexthopManager method buildBucketForDcGwLbGroup.
private Bucket buildBucketForDcGwLbGroup(String ipAddress, BigInteger dpnId, int index) {
List<Action> listAction = new ArrayList<>();
// ActionKey 0 goes to mpls label.
int actionKey = 1;
listAction.add(new ActionPushMpls().buildAction());
listAction.add(new ActionRegMove(actionKey++, FibConstants.NXM_REG_MAPPING.get(index), 0, 19).buildAction());
String tunnelInterfaceName = getTunnelInterfaceName(dpnId, new IpAddress(ipAddress.toCharArray()));
List<Action> egressActions = getEgressActions(tunnelInterfaceName, actionKey++);
if (!egressActions.isEmpty()) {
listAction.addAll(getEgressActions(tunnelInterfaceName, actionKey++));
} else {
// clear off actions if there is no egress actions.
listAction = Collections.emptyList();
}
return MDSALUtil.buildBucket(listAction, MDSALUtil.GROUP_WEIGHT, index, MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction13.
private static InstructionsBuilder createAppyActionInstruction13() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final DropActionBuilder drop = new DropActionBuilder();
ab.setAction(new DropActionCaseBuilder().setDropAction(drop.build()).build());
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction32.
private static InstructionsBuilder createAppyActionInstruction32() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
setTpSrcActionBuilder.setPort(new PortNumber(109));
ab.setAction(new SetTpSrcActionCaseBuilder().setSetTpSrcAction(setTpSrcActionBuilder.build()).build());
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method createAppyActionInstruction29.
private static InstructionsBuilder createAppyActionInstruction29() {
final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNwTtlActionBuilder setNwTtlActionBuilder = new SetNwTtlActionBuilder();
setNwTtlActionBuilder.setNwTtl((short) 1);
ab.setAction(new SetNwTtlActionCaseBuilder().setSetNwTtlAction(setNwTtlActionBuilder.build()).build());
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
Aggregations