Separate protos changes for device update changes in rw_core and voltctl
Change-Id: I3c354ab1fa77789bfd97c1a9e2780687b916a790
diff --git a/protos/voltha_protos/common.proto b/protos/voltha_protos/common.proto
index a0a4b81..25700f9 100644
--- a/protos/voltha_protos/common.proto
+++ b/protos/voltha_protos/common.proto
@@ -86,6 +86,7 @@
OPERATION_SUCCESS = 0;
OPERATION_FAILURE = 1;
OPERATION_UNSUPPORTED = 2;
+ OPERATION_IN_PROGRESS = 3;
}
// Return code
OperationReturnCode code = 1;
diff --git a/protos/voltha_protos/device.proto b/protos/voltha_protos/device.proto
index 142f8e9..8f9293a 100644
--- a/protos/voltha_protos/device.proto
+++ b/protos/voltha_protos/device.proto
@@ -7,6 +7,7 @@
package voltha;
import "google/protobuf/any.proto";
+import "google/protobuf/timestamp.proto";
import "voltha_protos/common.proto";
import "voltha_protos/meta.proto";
import "voltha_protos/openflow_13.proto";
@@ -222,6 +223,74 @@
repeated Port items = 1;
}
+// A complete device state
+message DeviceState {
+ common.AdminState.Types admin_state = 1;
+ common.OperStatus.Types oper_status = 2;
+ common.ConnectStatus.Types connect_status = 3;
+}
+
+// A device state change
+message DeviceStatesChange {
+ DeviceState previous = 1;
+ DeviceState current = 2;
+}
+
+// A device update filter
+message DeviceUpdateFilter {
+ // Device Id
+ string device_id = 1;
+
+ // Provide update starting from this timestamp, inclusive
+ google.protobuf.Timestamp from_timestamp = 2;
+
+ // Provide update starting to this timestamp, inclusive
+ google.protobuf.Timestamp to_timestamp = 3;
+
+ // The operation that triggered the update, e.g. portCreated
+ string operation = 4;
+
+ // The ID of that operation, e.g. log correlation ID
+ string operation_id = 5;
+
+ // Component initiating the request, e.g. openolt
+ string requested_by = 6;
+
+ // Operation status
+ common.OperationResp status = 7;
+}
+
+// A device update
+message DeviceUpdate {
+ // Device Id
+ string device_id = 1;
+
+ // Timestamp of the update
+ google.protobuf.Timestamp timestamp = 2;
+
+ // The operation that triggered the update, e.g. portCreated
+ string operation = 3;
+
+ // The ID of that operation, e.g. log correlation ID
+ string operation_id = 4;
+
+ // Component initiating the request, e.g. openolt
+ string requested_by = 5;
+
+ // State change, if any, as a result of that update
+ DeviceStatesChange state_change = 6;
+
+ // Operation status
+ common.OperationResp status = 7;
+
+ // A brief description to provide more context to this update
+ string description = 8;
+}
+
+message DeviceUpdates {
+ repeated DeviceUpdate items = 1;
+}
+
// A Physical Device instance
message Device {
// Voltha's device identifier
@@ -288,8 +357,6 @@
common.OperStatus.Types oper_status = 17 [(access) = READ_ONLY];
- string reason = 22 [(access) = READ_ONLY]; // Used in FAILED state
-
common.ConnectStatus.Types connect_status = 18 [(access) = READ_ONLY];
// TODO additional common attribute here
diff --git a/protos/voltha_protos/voltha.proto b/protos/voltha_protos/voltha.proto
index c2d5459..38b0224 100644
--- a/protos/voltha_protos/voltha.proto
+++ b/protos/voltha_protos/voltha.proto
@@ -330,6 +330,13 @@
};
}
+ // Get the device updates of a given device using a filter
+ rpc GetDeviceUpdates(DeviceUpdateFilter) returns(DeviceUpdates) {
+ option (google.api.http) = {
+ get: "/api/v1/deviceupdates/{id}/{filter}"
+ };
+ }
+
// Get more information on a given physical device
rpc GetDevice(common.ID) returns(Device) {
option (google.api.http) = {