Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


Where to find MeterIdInstruction in openflow-protocol-api

asked 2015-09-22 03:37:19 -0700

Denis gravatar image

I'm missing the MeterIdInstruction class in openflow-protocol-api (0.7.0-SNAPSHOT). In openflow-protocol-api (0.5.4-SNAPSHOT) the file exists. Does anyone know, where it has been moved, or was it replaced by another class ? If it was replaced by another, how can I assign a meter to a flow, if not using MeterIdInstruction. Any pointer to updated tutorials (for odl-lithium) and dealing with meters and flows are greatly appreciated.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-10-01 11:27:02 -0700

arthurc gravatar image

updated 2015-10-01 12:19:57 -0700

When creating flows in Lithium-SR1, I've been doing something along the lines of:

FlowBuilder flowBuilder = new FlowBuilder()...;
Meter meter = new MeterBuilder().setMeterId(1).build();
MeterCase meterCase = new MeterCaseBuilder().setMeter(meter).build();
Instruction meterInstruction = new InstructionBuilder().setOrder(0).setInstruction(meterCase).build();
Instructions instructions = new InstructionsBuilder().setInstruction(ImmutableList.of(meterInstruction)).build();

Of course, this is incomplete as you'll likely want more to your flow than that. Just focused on the meter aspects. Getting the imports right can be a bit of a trick as some class names are reused in the ODL hierarchy. In my case, I'm getting the MeterCaseBuilder() from here. You can dig around in that hierarchy for other items referenced.

import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.MeterCaseBuilder;

Hopefully that points you in a functional direction.

edit flag offensive delete publish link more


Yeah the point was, i was looking in a old version of testcode.. there MeterIdInstruction was used for this case. In newer versions MeterCase is used, just like in your example. Thanks anyway!

Denis ( 2015-10-03 03:15:39 -0700 )edit
Login/Signup to Answer

Question Tools



Asked: 2015-09-22 03:37:19 -0700

Seen: 161 times

Last updated: Oct 01 '15