Added clear insturctions in both API and CLI
diff --git a/cli/cli/c_actions.py b/cli/cli/c_actions.py
index befea2b..9a4e9d4 100755
--- a/cli/cli/c_actions.py
+++ b/cli/cli/c_actions.py
@@ -70,6 +70,7 @@
else:
''
def renameActions(actions):
+
actions = actions.replace('GOTO_TABLE','GOTO')
actions = actions.replace('WRITE_ACTIONS','WRITE')
actions = actions.replace('APPLY_ACTIONS','APPLY')
@@ -82,6 +83,7 @@
actions = actions.replace('SET_DL_DST','DST_MAC')
actions = actions.replace('SET_NW_SRC','SRC_IP')
actions = actions.replace('SET_NW_DST','DST_IP')
+ actions = actions.replace('CLEAR_ACTIONS: {CLEAR_ACTIONS: True}','CLEAR_ACTIONS')
return actions
diff --git a/cli/cli/desc/version200/policy.py b/cli/cli/desc/version200/policy.py
index b253ff1..57c29ae 100644
--- a/cli/cli/desc/version200/policy.py
+++ b/cli/cli/desc/version200/policy.py
@@ -47,14 +47,14 @@
},
{
'token' : 'policy-type',
- 'no-supported' : False,
+ 'optional-for-no' : True,
'short-help' : 'Set type of policy',
'doc' : 'policy|policy',
'completion' : 'complete-object-field',
},
{
'field' : 'policy-type',
- 'no-supported' : False,
+ 'optional-for-no' : True,
'type' : 'enum',
'values' : ('tunnel-flow','loadbalanced','avoid','deny'),
'completion' : 'complete-object-field',
diff --git a/src/main/java/net/floodlightcontroller/core/web/serializers/OFFlowStatsEntryModSerializer.java b/src/main/java/net/floodlightcontroller/core/web/serializers/OFFlowStatsEntryModSerializer.java
index 5619702..cbd78c6 100644
--- a/src/main/java/net/floodlightcontroller/core/web/serializers/OFFlowStatsEntryModSerializer.java
+++ b/src/main/java/net/floodlightcontroller/core/web/serializers/OFFlowStatsEntryModSerializer.java
@@ -112,13 +112,19 @@
jGen.writeStartObject();
List<OFAction> actions = null;
for (OFInstruction instruction: instructions){
-
if(instruction.getType().equals(OFInstructionType.APPLY_ACTIONS)){
actions = ((OFInstructionApplyActions)instruction).getActions();
}
else if(instruction.getType().equals(OFInstructionType.WRITE_ACTIONS)){
actions = ((OFInstructionWriteActions)instruction).getActions();
}
+ else if(instruction.getType().equals(OFInstructionType.CLEAR_ACTIONS)){
+ jGen.writeFieldName(instruction.getType().name());
+ jGen.writeStartObject();
+ jGen.writeStringField(instruction.getType().name(), "True");
+ jGen.writeEndObject();
+ continue;
+ }
else if(instruction.getType().equals(OFInstructionType.GOTO_TABLE)){
jGen.writeFieldName(instruction.getType().name());