VOL-3248 Support for SetExtValue API
This commits adds a new SetExtValue API in the VOLTHA
core.
Change-Id: I2dd022cee9b22dd1d34f53420d5d75e68d440975
diff --git a/protos/voltha_protos/ext_config.proto b/protos/voltha_protos/ext_config.proto
new file mode 100644
index 0000000..47113e9
--- /dev/null
+++ b/protos/voltha_protos/ext_config.proto
@@ -0,0 +1,70 @@
+// Copyright (c) 2020 Open Networking Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+syntax = "proto3";
+
+option go_package = "github.com/opencord/voltha-protos/v3/go/ext/config";
+
+package config;
+
+option java_package = "org.opencord.voltha";
+
+message AlarmConfig {
+ oneof config {
+ OnuItuPonAlarm onu_itu_pon_alarm_config = 1;
+ }
+}
+
+message OnuItuPonAlarm {
+ enum AlarmID {
+ RDI_ERRORS = 0; // RDI errors
+ }
+
+ enum AlarmReportingCondition {
+ RATE_THRESHOLD = 0; // The alarm is triggered if the stats delta value between samples crosses the configured threshold boundary
+ RATE_RANGE = 1; // The alarm is triggered if the stats delta value between samples deviates from the configured range
+ VALUE_THRESHOLD = 2; // The alarm is raised if the stats sample value becomes greater than this level. The alarm is cleared when the host read the stats
+ }
+
+ message SoakTime {
+ fixed32 active_soak_time = 1;
+ fixed32 clear_soak_time = 2;
+ }
+
+ message RateThresholdConfig {
+ fixed64 rate_threshold_rising = 1;
+ fixed64 rate_threshold_falling = 2;
+ SoakTime soak_time = 3;
+ }
+
+ message RateRangeConfig {
+ fixed64 rate_range_lower = 1;
+ fixed64 rate_range_upper = 2;
+ SoakTime soak_time = 3;
+ }
+
+ message ValueThresholdConfig {
+ fixed64 threshold_limit = 1;
+ SoakTime soak_time = 2;
+ }
+
+ fixed32 pon_ni = 1;
+ fixed32 onu_id = 2;
+ AlarmID alarm_id = 3;
+ AlarmReportingCondition alarm_reporting_condition = 4;
+ oneof config {
+ RateThresholdConfig rate_threshold_config = 5;
+ RateRangeConfig rate_range_config = 6;
+ ValueThresholdConfig value_threshold_config = 7;
+ }
+}
diff --git a/protos/voltha_protos/openolt.proto b/protos/voltha_protos/openolt.proto
index 8c4c559..6a38963 100644
--- a/protos/voltha_protos/openolt.proto
+++ b/protos/voltha_protos/openolt.proto
@@ -22,6 +22,7 @@
import "google/api/annotations.proto";
import public "voltha_protos/tech_profile.proto";
import public "voltha_protos/common.proto";
+import "voltha_protos/ext_config.proto";
service Openolt {
@@ -188,7 +189,7 @@
};
}
- rpc OnuItuPonAlarmSet(OnuItuPonAlarm) returns (Empty) {
+ rpc OnuItuPonAlarmSet(config.OnuItuPonAlarm) returns (Empty) {
option (google.api.http) = {
post: "/v1/OnuItuPonAlarmSet"
body: "*"
@@ -447,50 +448,6 @@
fixed32 tech_profile_id = 15;
}
-message OnuItuPonAlarm {
- enum AlarmID {
- RDI_ERRORS = 0; // RDI errors
- }
-
- enum AlarmReportingCondition {
- RATE_THRESHOLD = 0; // The alarm is triggered if the stats delta value between samples crosses the configured threshold boundary
- RATE_RANGE = 1; // The alarm is triggered if the stats delta value between samples deviates from the configured range
- VALUE_THRESHOLD = 2; // The alarm is raised if the stats sample value becomes greater than this level. The alarm is cleared when the host read the stats
- }
-
- message SoakTime {
- fixed32 active_soak_time = 1;
- fixed32 clear_soak_time = 2;
- }
-
- message RateThresholdConfig {
- fixed64 rate_threshold_rising = 1;
- fixed64 rate_threshold_falling = 2;
- SoakTime soak_time = 3;
- }
-
- message RateRangeConfig {
- fixed64 rate_range_lower = 1;
- fixed64 rate_range_upper = 2;
- SoakTime soak_time = 3;
- }
-
- message ValueThresholdConfig {
- fixed64 threshold_limit = 1;
- SoakTime soak_time = 2;
- }
-
- fixed32 pon_ni = 1;
- fixed32 onu_id = 2;
- AlarmID alarm_id = 3;
- AlarmReportingCondition alarm_reporting_condition = 4;
- oneof config {
- RateThresholdConfig rate_threshold_config = 5;
- RateRangeConfig rate_range_config = 6;
- ValueThresholdConfig value_threshold_config = 7;
- }
-}
-
message SerialNumber {
bytes vendor_id = 1;
bytes vendor_specific = 2;
diff --git a/protos/voltha_protos/voltha.proto b/protos/voltha_protos/voltha.proto
index e6d9fdd..53e97d1 100644
--- a/protos/voltha_protos/voltha.proto
+++ b/protos/voltha_protos/voltha.proto
@@ -23,6 +23,7 @@
import "voltha_protos/omci_mib_db.proto";
import "voltha_protos/omci_alarm_db.proto";
+import "voltha_protos/ext_config.proto";
option java_package = "org.opencord.voltha";
option java_outer_classname = "VolthaProtos";
@@ -97,6 +98,13 @@
TestResponseResult result = 1;
}
+message ValueSet {
+ string id = 1;
+ oneof value{
+ config.AlarmConfig alarm_config = 2;
+ }
+}
+
// Voltha represents the Voltha cluster data. Each Core instance will hold a subset of
// the entire cluster. However, some items (e.g. adapters) will be held by all cores
// for better performance
@@ -602,6 +610,11 @@
get: "/api/v1/GetExtValue"
};
}
+ rpc SetExtValue(ValueSet) returns(google.protobuf.Empty) {
+ option (google.api.http) = {
+ get: "/api/v1/SetExtValue"
+ };
+ }
// omci start and stop cli implementation
rpc StartOmciTestAction(OmciTestRequest) returns(TestResponse) {