Error notification Message modelling 93/2793/1
authorPrasanna Huddar <prasanna.huddar@ericsson.com>
Sat, 16 Nov 2013 16:11:30 +0000 (21:41 +0530)
committerPrasanna Huddar <prasanna.huddar@ericsson.com>
Sat, 16 Nov 2013 16:12:56 +0000 (21:42 +0530)
Signed-off-by: Prasanna Huddar <prasanna.huddar@ericsson.com>
Change-Id: I10ed41a1c1c00f9f387d8d99eec47f769eac5967

opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/FlowProgrammerAdapter.xtend
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-error.yang [new file with mode: 0644]
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-service.yang
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/NoficationTest.java

index 15f0685..2eae511 100644 (file)
@@ -13,6 +13,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.Swit
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeErrorNotification
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeExperimenterErrorNotification
 import org.opendaylight.yangtools.yang.common.RpcResult
 import org.slf4j.LoggerFactory
 
@@ -137,4 +139,12 @@ class FlowProgrammerAdapter implements IPluginInFlowProgrammerService, SalFlowLi
         // NOOP : Not supported by AD SAL
     }
     
+     override onNodeErrorNotification(NodeErrorNotification notification) {
+        // NOOP : Not supported by AD SAL
+    }
+    
+     override onNodeExperimenterErrorNotification(
+                NodeExperimenterErrorNotification notification) {
+        // NOOP : Not supported by AD SAL
+    }
 }
diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-error.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-error.yang
new file mode 100644 (file)
index 0000000..171f956
--- /dev/null
@@ -0,0 +1,60 @@
+module flow-errors {
+       namespace "urn:opendaylight:flow:errors";
+    prefix error;
+    
+    revision "2013-11-16" {
+        description "Initial revision of error";
+    }
+
+    typedef error-type {
+        type enumeration {
+            enum hello-failed;
+            enum bad-request;
+            enum bad-action;
+            enum bad-instruction;
+            enum bad-match;
+            enum flow-mod-failed;
+            enum group-mod-failed;
+            enum port-mod-failed;
+            enum table-mod-failed;
+            enum meter-mod-failed;
+            enum queue-op-failed;
+            enum switch-config-failed;
+            enum role-request-failed;
+            enum table-features-failed;
+            enum experimenter;
+        }
+    }
+    
+    grouping error-message {
+        leaf type {
+            type error-type;
+        }
+        
+        leaf code {
+            type uint16;        
+        }
+        
+        leaf data {
+            type string;
+        }
+    }
+    
+    grouping experimenter-error-message {
+        leaf type {
+            type error-type;
+        }
+        
+        leaf exp-type {
+            type uint16;        
+        }
+        
+        leaf experimenter-id {
+            type uint32;        
+        }
+        
+        leaf data {
+            type string;
+        }
+    }   
+}
\ No newline at end of file
index f858919..df0b252 100644 (file)
@@ -7,6 +7,7 @@ module sal-flow {
     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
     import opendaylight-flow-types {prefix types;revision-date "2013-10-26";}
     import flow-capable-transaction {prefix tr;}
+    import flow-errors {prefix error;}
 
     revision "2013-08-19" {
         description "Initial revision of flow service";
@@ -93,4 +94,12 @@ module sal-flow {
     notification switch-flow-removed {
         uses node-flow-removed;
     }
+    
+    notification node-error-notification {
+        uses error:error-message;
+    }
+    
+    notification node-experimenter-error-notification {
+        uses error:experimenter-error-message;
+    }
 }
\ No newline at end of file
index 1627243..6fec180 100644 (file)
@@ -18,6 +18,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.Flow
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAddedBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeErrorNotification;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeExperimenterErrorNotification;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SwitchFlowRemoved;
 import org.opendaylight.yangtools.concepts.Registration;
@@ -205,5 +207,18 @@ public class NoficationTest extends AbstractTest {
             
         }
 
+        @Override
+        public void onNodeErrorNotification(NodeErrorNotification notification) {
+            // TODO Auto-generated method stub
+            
+        }
+
+        @Override
+        public void onNodeExperimenterErrorNotification(
+                NodeExperimenterErrorNotification notification) {
+            // TODO Auto-generated method stub
+            
+        }
+
     }
 }