VOL-2224 Event Filtering mechanism

         This commit contains the changes that are required to migrate
         from alarm filtering to event filtering. Changes are done in the
         proto messages as well as the RPCs

         Note: This patchset and the patchset for voltha-go needs to be merged
               as close to as possible otherwise there will be compilation errors

Change-Id: I48c09a8b3d5320e302a30be52da6fede7010e856
diff --git a/protos/voltha_protos/voltha.proto b/protos/voltha_protos/voltha.proto
index f560702..fc06dc3 100644
--- a/protos/voltha_protos/voltha.proto
+++ b/protos/voltha_protos/voltha.proto
@@ -43,31 +43,32 @@
 }
 
 
-message AlarmFilterRuleKey {
-    option (common.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
+message EventFilterRuleKey {
 
-    enum AlarmFilterRuleKey {
-        id = 0;
-        type = 1;
-        severity = 2;
-        resource_id = 3;
-        category = 4;
-        device_id = 5;
+    enum EventFilterRuleType {
+        filter_all = 0;
+        category = 1;
+        sub_category = 2;
+        kpi_event_type = 3;
+        config_event_type = 4;
+        device_event_type = 5;
     }
 }
 
-message AlarmFilterRule {
-    AlarmFilterRuleKey.AlarmFilterRuleKey key = 1;
+message EventFilterRule {
+    EventFilterRuleKey.EventFilterRuleType key = 1;
     string value = 2;
 }
-message AlarmFilter {
+message EventFilter {
     string id = 1 [(access) = READ_ONLY];
-
-    repeated AlarmFilterRule rules = 2;
+    bool enable = 2;
+    string device_id = 3;
+    string event_type = 4;
+    repeated EventFilterRule rules = 5;
 }
 
-message AlarmFilters {
-    repeated AlarmFilter filters = 1;
+message EventFilters {
+    repeated EventFilter filters = 1;
 }
 
 // CoreInstance represents a core instance.  It is data held in memory when a core
@@ -104,7 +105,7 @@
 
     repeated DeviceGroup device_groups = 6 [(child_node) = {key: "id"}];
 
-    repeated AlarmFilter alarm_filters = 7 [(child_node) = {key: "id"}];
+    repeated EventFilter event_filters = 7 [(child_node) = {key: "id"}];
 
     repeated
         omci.MibDeviceData omci_mib_database = 28
@@ -542,35 +543,37 @@
         };
     }
 
-    rpc CreateAlarmFilter(AlarmFilter) returns(AlarmFilter) {
+    rpc CreateEventFilter(EventFilter) returns(EventFilter) {
         option (google.api.http) = {
-            post: "/api/v1/alarm_filters"
+            post: "/api/v1/event_filters"
             body: "*"
         };
     }
 
-    rpc GetAlarmFilter(common.ID) returns(AlarmFilter) {
+    // Get all filters present for a device
+    rpc GetEventFilter(common.ID) returns(EventFilters) {
         option (google.api.http) = {
-            get: "/api/v1/alarm_filters/{id}"
+            get: "/api/v1/event_filters/{id}"
         };
     }
 
-    rpc UpdateAlarmFilter(AlarmFilter) returns(AlarmFilter) {
+    rpc UpdateEventFilter(EventFilter) returns(EventFilter) {
         option (google.api.http) = {
-            put: "/api/v1/alarm_filters/{id}"
+            put: "/api/v1/event_filters/{id}"
             body: "*"
         };
     }
 
-    rpc DeleteAlarmFilter(common.ID) returns(google.protobuf.Empty) {
+    rpc DeleteEventFilter(EventFilter) returns(google.protobuf.Empty) {
         option (google.api.http) = {
-            delete: "/api/v1/alarm_filters/{id}"
+            delete: "/api/v1/event_filters/{id}"
         };
     }
 
-    rpc ListAlarmFilters(google.protobuf.Empty) returns(AlarmFilters) {
+    // Get all the filters present
+    rpc ListEventFilters(google.protobuf.Empty) returns(EventFilters) {
         option (google.api.http) = {
-            get: "/api/v1/alarm_filters"
+            get: "/api/v1/event_filters"
         };
     }