VOL-3501 RPC Event Handling

Change-Id: Iba411e598a1de901ebfb233a4c39f3a62da2c4c3
diff --git a/protos/voltha_protos/events.proto b/protos/voltha_protos/events.proto
index e33b45c..4dd8347 100644
--- a/protos/voltha_protos/events.proto
+++ b/protos/voltha_protos/events.proto
@@ -8,6 +8,7 @@
 import "voltha_protos/meta.proto";
 import "google/api/annotations.proto";
 import "google/protobuf/timestamp.proto";
+import "voltha_protos/common.proto";
 
 message ConfigEventType {
     enum Types {
@@ -35,26 +36,26 @@
  * Struct to convey a dictionary of metric metadata.
  */
 message MetricMetaData {
-    string title = 1;   // Metric group or individual metric name
-    double ts = 2;      // UTC time-stamp of data (seconds since epoch) of
-                        // when the metric or metric group was collected.
-                        // If this is a 15-min historical group, it is the
-                        // time of the collection and reporting, not the
-                        // start or end of the 15-min group interval.
+    string title = 1; // Metric group or individual metric name
+    double ts = 2; // UTC time-stamp of data (seconds since epoch) of
+    // when the metric or metric group was collected.
+    // If this is a 15-min historical group, it is the
+    // time of the collection and reporting, not the
+    // start or end of the 15-min group interval.
 
     string logical_device_id = 3; // The logical device ID of the VOLTHA
-                                  // (equivalent to the DPID that ONOS has
-                                  // for the VOLTHA device without the
-                                  //  'of:' prefix
-    string serial_no = 4;         // The OLT, ONU, ... device serial number
-    string device_id = 5;         // The OLT, ONU, ... physical device ID
+    // (equivalent to the DPID that ONOS has
+    // for the VOLTHA device without the
+    //  'of:' prefix
+    string serial_no = 4; // The OLT, ONU, ... device serial number
+    string device_id = 5; // The OLT, ONU, ... physical device ID
 
     map<string, string> context = 6; // Name value pairs that provide additional
-                                     // context information on the metrics being
-                                     // reported.
+    // context information on the metrics being
+    // reported.
 
-    string uuid = 7;               // Transaction identifier used to match On
-                                   // Demand gRPC requests with kafka responses
+    string uuid = 7; // Transaction identifier used to match On
+    // Demand gRPC requests with kafka responses
 }
 
 /*
@@ -99,8 +100,8 @@
     KpiEventType.Types type = 1;
 
     // Fields used when for slice:
-    double ts = 2;  // UTC time-stamp of data in slice mode (seconds since epoch)
-                    // of the time this entire KpiEvent was published to the kafka bus
+    double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch)
+    // of the time this entire KpiEvent was published to the kafka bus
 
     repeated MetricInformation slice_data = 3;
 }
@@ -122,6 +123,34 @@
     map<string, string> context = 4;
 
 }
+/*
+ * Describes the events specific to an RPC request
+ */
+message RPCEvent {
+    // RPC name
+    string rpc = 1;
+
+    // The operation id of that request.  Can be a log correlation ID
+    string operation_id = 2;
+
+    // Identifies the service name originating the event
+    string service = 3;
+
+    // Identifies the stack originating the event
+    string stack_id = 4;
+
+    // Identifies the resource upon which the action is taken, e.g. device_id
+    string resource_id = 5;
+
+    // Textual explanation of the event
+    string description = 6;
+
+    // Key/Value storage for extra information that may give context to the event
+    map<string, string> context = 7;
+
+    // Status of the RPC Event
+    common.OperationResp status = 8;
+}
 
 /*
  * Identify the area of the system impacted by the event.
@@ -156,13 +185,13 @@
  * Identify the type of event
 */
 message EventType {
-   enum Types {
-       CONFIG_EVENT = 0;
-       KPI_EVENT    = 1;
-       KPI_EVENT2   = 2;
-       DEVICE_EVENT = 3;
-
-   }
+    enum Types {
+        CONFIG_EVENT = 0;
+        KPI_EVENT = 1;
+        KPI_EVENT2 = 2;
+        DEVICE_EVENT = 3;
+        RPC_EVENT = 4;
+    }
 }
 
 /*
@@ -200,8 +229,6 @@
     // If the source entity that reported this event doesn't send the 
     // reported_ts, this shall be set to the same value as raised_ts.
     google.protobuf.Timestamp reported_ts = 7;
-
-
 }
 
 /*
@@ -217,14 +244,17 @@
         ConfigEvent config_event = 2;
 
         // Refers to KpiEvent
-        KpiEvent    kpi_event = 3;
+        KpiEvent kpi_event = 3;
 
         // Refers to KpiEvent2
-        KpiEvent2   kpi_event2 = 4;
+        KpiEvent2 kpi_event2 = 4;
 
         // Refers to DeviceEvent
         DeviceEvent device_event = 5;
 
+        // Refers to an RPC Event
+        RPCEvent rpc_event = 6;
+
         // Add other event types here.
 
     }