Added meter and table transition instructions to flows REST API.

Change-Id: If9d3f61020fab3a91009e3f067b04bd19bbc52d1
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java b/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
index ccc2623..b108f7e 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/EncodeInstructionCodecHelper.java
@@ -260,6 +260,12 @@
                 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;
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java
index da74121..6ec5a67 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/TrafficTreatmentCodec.java
@@ -49,6 +49,13 @@
             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()) {