Konstantinos Kanonakis
Committed by Gerrit Code Review

Added meter and table transition instructions to flows REST API.

Change-Id: If9d3f61020fab3a91009e3f067b04bd19bbc52d1
......@@ -260,6 +260,12 @@ public final class EncodeInstructionCodecHelper {
result.put(InstructionCodec.METER_ID, meterInstruction.meterId().toString());
break;
case TABLE:
final Instructions.TableTypeTransition tableTransitionInstruction =
(Instructions.TableTypeTransition) instruction;
result.put(InstructionCodec.TABLE_ID, tableTransitionInstruction.tableId().toString());
break;
case QUEUE:
final Instructions.SetQueueInstruction setQueueInstruction =
(Instructions.SetQueueInstruction) instruction;
......
......@@ -49,6 +49,13 @@ public final class TrafficTreatmentCodec extends JsonCodec<TrafficTreatment> {
jsonInstructions.add(instructionCodec.encode(instruction, context));
}
if (treatment.metered() != null) {
jsonInstructions.add(instructionCodec.encode(treatment.metered(), context));
}
if (treatment.tableTransition() != null) {
jsonInstructions.add(instructionCodec.encode(treatment.tableTransition(), context));
}
final ArrayNode jsonDeferred = result.putArray("deferred");
for (final Instruction instruction : treatment.deferred()) {
......