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 { ...@@ -260,6 +260,12 @@ public final class EncodeInstructionCodecHelper {
260 result.put(InstructionCodec.METER_ID, meterInstruction.meterId().toString()); 260 result.put(InstructionCodec.METER_ID, meterInstruction.meterId().toString());
261 break; 261 break;
262 262
263 + case TABLE:
264 + final Instructions.TableTypeTransition tableTransitionInstruction =
265 + (Instructions.TableTypeTransition) instruction;
266 + result.put(InstructionCodec.TABLE_ID, tableTransitionInstruction.tableId().toString());
267 + break;
268 +
263 case QUEUE: 269 case QUEUE:
264 final Instructions.SetQueueInstruction setQueueInstruction = 270 final Instructions.SetQueueInstruction setQueueInstruction =
265 (Instructions.SetQueueInstruction) instruction; 271 (Instructions.SetQueueInstruction) instruction;
......
...@@ -49,6 +49,13 @@ public final class TrafficTreatmentCodec extends JsonCodec<TrafficTreatment> { ...@@ -49,6 +49,13 @@ public final class TrafficTreatmentCodec extends JsonCodec<TrafficTreatment> {
49 jsonInstructions.add(instructionCodec.encode(instruction, context)); 49 jsonInstructions.add(instructionCodec.encode(instruction, context));
50 } 50 }
51 51
52 + if (treatment.metered() != null) {
53 + jsonInstructions.add(instructionCodec.encode(treatment.metered(), context));
54 + }
55 + if (treatment.tableTransition() != null) {
56 + jsonInstructions.add(instructionCodec.encode(treatment.tableTransition(), context));
57 + }
58 +
52 final ArrayNode jsonDeferred = result.putArray("deferred"); 59 final ArrayNode jsonDeferred = result.putArray("deferred");
53 60
54 for (final Instruction instruction : treatment.deferred()) { 61 for (final Instruction instruction : treatment.deferred()) {
......