[VOL:3643] support of some OLT device metrics over the Device Management Interface
1. Following metrices are supported :
METRIC_FAN_SPEED
METRIC_CPU_USAGE_PERCENTAGE
METRIC_RAM_USAGE_PERCENTAGE
METRIC_DISK_USAGE_PERCENTAGE
METRIC_INNER_SURROUNDING_TEMP
2. Following DMI APIs are implemented:
ListMetrics
UpdateMetricsConfiguration
GetMetric
SetMsgBusEndpoint
GetMsgBusEndpoint
3. Updated docs/source/DMI_Server_README.md
Change-Id: I11f988ff972b8a8682012c7aeea88ba61afb82ba
diff --git a/docs/source/DMI_Server_README.md b/docs/source/DMI_Server_README.md
old mode 100644
new mode 100755
index 84d3e94..0fb41ff
--- a/docs/source/DMI_Server_README.md
+++ b/docs/source/DMI_Server_README.md
@@ -1,103 +1,273 @@
-# Device Management Server simulator
-The device management server can be tested using grpc curl (https://github.com/fullstorydev/grpcurl)
-Below is the output of a run for some of the implemented RPCs (172.17.0.2 is the IP address of the BBSim docker)
-```sh
-$ grpcurl -plaintext 172.17.0.2:50075 list dmi.NativeHWManagementService
-dmi.NativeHWManagementService.GetHWComponentInfo
-dmi.NativeHWManagementService.GetLoggingEndpoint
-dmi.NativeHWManagementService.GetManagedDevices
-dmi.NativeHWManagementService.GetMsgBusEndpoint
-dmi.NativeHWManagementService.GetPhysicalInventory
-dmi.NativeHWManagementService.SetHWComponentInfo
-dmi.NativeHWManagementService.SetLoggingEndpoint
-dmi.NativeHWManagementService.SetMsgBusEndpoint
-dmi.NativeHWManagementService.StartManagingDevice
-dmi.NativeHWManagementService.StopManagingDevice
-```
-```sh
-$ grpcurl -plaintext -d '{"name": "SomeOlt","uri": {"uri":"XXX.YYY.ZZZ.AAA"}}' 172.17.0.2:50075 dmi.NativeHWManagementService/StartManagingDevice
-{
- "status": "OK",
- "deviceUuid": {
- "uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"
- }
-}
-```
-```sh
-$ grpcurl -plaintext -d '{"device_uuid": {"uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"}}' 172.17.0.2:50075 dmi.NativeHWManagementService.GetPhysicalInventory
-{
- "status": "OK",
- "inventory": {
- "lastChange": "1970-01-01T00:00:00Z",
- "root": {
- "name": "BBSim-BBSIM_OLT_0",
- "children": [
- {
- "name": "cage-0",
- "class": "COMPONENT_TYPE_CONTAINER",
- "description": "cage",
- "parent": "BBSim-BBSIM_OLT_0",
- "children": [
- {
- "name": "sfp-0",
- "class": "COMPONENT_TYPE_TRANSCEIVER",
- "description": "XGS-PON",
- "parent": "cage-0",
- "uuid": {
- "uuid": "788ba741-507f-37b1-8e47-4a389460873b"
- }
- }
- ],
- "uuid": {
- "uuid": "6bfab16e-8003-3e18-9143-8933df64aa52"
- }
- }
- ],
- "serialNum": "BBSIM_OLT_0",
- "mfgName": "BBSim",
- "uri": {
- "uri": "XXX.YYY.ZZZ.AAA"
- },
- "uuid": {
- "uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"
- },
- "state": {
- }
- }
- }
-}
-```
-```sh
-$ grpcurl -plaintext -d '{"device_uuid": {"uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"},"component_uuid":{"uuid":"788ba741-507f-37b1-8e47-4a389460873b"}}' 172.17.0.2:50075 dmi.NativeHWManagementService.GetHWComponentInfo
-{
- "status": "OK",
- "component": {
- "name": "sfp-0",
- "class": "COMPONENT_TYPE_TRANSCEIVER",
- "description": "XGS-PON",
- "parent": "cage-0",
- "uuid": {
- "uuid": "788ba741-507f-37b1-8e47-4a389460873b"
- }
- }
-}
-```
-```sh
-$ grpcurl -plaintext -d '{}' 172.17.0.2:50075 dmi.NativeHWManagementService.GetMsgBusEndpoint
-ERROR:
- Code: Unimplemented
- Message: rpc GetMsgBusEndpoint not implemented
-```
-```sh
-$ grpcurl -plaintext -d '{}' 172.17.0.2:50075 dmi.NativeHWManagementService/GetManagedDevices
-{
- "devices": [
- {
- "name": "BBSim-BBSIM_OLT_0",
- "uri": {
- "uri": "XXX.YYY.ZZZ.AAA"
- }
- }
- ]
-}
-```
\ No newline at end of file
+# Device Management Server simulator
+The device management server can be tested using grpc curl (https://github.com/fullstorydev/grpcurl)
+Below is the output of a run for some of the implemented RPCs (172.17.0.2 is the IP address of the BBSim docker)
+### List NativeHWManagementService APIs:
+```sh
+$ grpcurl -plaintext 172.17.0.2:50075 list dmi.NativeHWManagementService
+dmi.NativeHWManagementService.GetHWComponentInfo
+dmi.NativeHWManagementService.GetLoggingEndpoint
+dmi.NativeHWManagementService.GetManagedDevices
+dmi.NativeHWManagementService.GetMsgBusEndpoint
+dmi.NativeHWManagementService.GetPhysicalInventory
+dmi.NativeHWManagementService.SetHWComponentInfo
+dmi.NativeHWManagementService.SetLoggingEndpoint
+dmi.NativeHWManagementService.SetMsgBusEndpoint
+dmi.NativeHWManagementService.StartManagingDevice
+dmi.NativeHWManagementService.StopManagingDevice
+```
+### StartManagingDevice API
+```sh
+$ grpcurl -plaintext -d '{"name": "SomeOlt","uri": {"uri":"XXX.YYY.ZZZ.AAA"}}' 172.17.0.2:50075 dmi.NativeHWManagementService/StartManagingDevice
+{
+ "status": "OK",
+ "deviceUuid": {
+ "uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"
+ }
+}
+```
+### GetPhysicalInventory API
+```sh
+$ grpcurl -plaintext -d '{"device_uuid": {"uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"}}' 172.17.0.2:50075 dmi.NativeHWManagementService.GetPhysicalInventory
+{
+ "status": "OK",
+ "inventory": {
+ "lastChange": "1970-01-01T00:00:00Z",
+ "root": {
+ "name": "BBSim-BBSIM_OLT_0",
+ "children": [
+ {
+ "name": "cage-0",
+ "class": "COMPONENT_TYPE_CONTAINER",
+ "description": "cage",
+ "parent": "BBSim-BBSIM_OLT_0",
+ "children": [
+ {
+ "name": "sfp-0",
+ "class": "COMPONENT_TYPE_TRANSCEIVER",
+ "description": "XGS-PON",
+ "parent": "cage-0",
+ "uuid": {
+ "uuid": "788ba741-507f-37b1-8e47-4a389460873b"
+ }
+ }
+ ],
+ "uuid": {
+ "uuid": "6bfab16e-8003-3e18-9143-8933df64aa52"
+ }
+ },
+ {
+ "name": "Thermal/Fans/System Fan/1",
+ "class": "COMPONENT_TYPE_FAN",
+ "description": "bbsim-fan",
+ "serialNum": "bbsim-fan-serial-1",
+ "mfgName": "bbsim-fan",
+ "uuid": {
+ "uuid": "2f4b639c-80a9-340f-b8d8-4ad06580b3cf"
+ },
+ "state": {
+
+ }
+ },
+ {
+ "name": "Thermal/Fans/System Fan/2",
+ "class": "COMPONENT_TYPE_FAN",
+ "description": "bbsim-fan",
+ "serialNum": "bbsim-fan-serial-2",
+ "mfgName": "bbsim-fan",
+ "uuid": {
+ "uuid": "4fb1a981-5697-3813-955d-fbb2a2908b2f"
+ },
+ "state": {
+
+ }
+ },
+ {
+ "name": "Systems/1/Disk/0",
+ "class": "COMPONENT_TYPE_STORAGE",
+ "description": "bbsim-disk",
+ "serialNum": "bbsim-disk-serial-0",
+ "mfgName": "bbsim-disk",
+ "uuid": {
+ "uuid": "b1d63346-c0b9-3a29-a4e6-e047efff9ddf"
+ },
+ "state": {
+
+ }
+ },
+ {
+ "name": "Systems/1/Processors/0",
+ "class": "COMPONENT_TYPE_CPU",
+ "description": "bbsim-cpu",
+ "serialNum": "bbsim-cpu-serial-0",
+ "mfgName": "bbsim-cpu",
+ "uuid": {
+ "uuid": "0bcbe296-9855-3218-9479-9c501073773f"
+ },
+ "state": {
+
+ }
+ },
+ {
+ "name": "Systems/1/Memory/0",
+ "class": "COMPONENT_TYPE_MEMORY",
+ "description": "bbsim-ram",
+ "serialNum": "bbsim-ram-serial-0",
+ "mfgName": "bbsim-ram",
+ "uuid": {
+ "uuid": "78cd16fd-73d1-3aad-8f13-644ed3101c63"
+ },
+ "state": {
+
+ }
+ },
+ {
+ "name": "Systems/1/Sensor/0",
+ "class": "COMPONENT_TYPE_SENSOR",
+ "description": "bbsim-istemp",
+ "serialNum": "bbsim-sensor-istemp-serial-0",
+ "mfgName": "bbsim-istemp",
+ "uuid": {
+ "uuid": "b9ada337-63a1-3991-96f5-95416dec1bf0"
+ },
+ "state": {
+
+ }
+ }
+ ],
+ "serialNum": "BBSIM_OLT_0",
+ "mfgName": "BBSim",
+ "uri": {
+ "uri": "XXX.YYY.ZZZ.AAA"
+ },
+ "uuid": {
+ "uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"
+ },
+ "state": {
+
+ }
+ }
+ }
+}
+
+```
+### GetHWComponentInfo API
+```sh
+$ grpcurl -plaintext -d '{"device_uuid": {"uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"},"component_uuid":{"uuid":"788ba741-507f-37b1-8e47-4a389460873b"}}' 172.17.0.2:50075 dmi.NativeHWManagementService.GetHWComponentInfo
+{
+ "status": "OK",
+ "component": {
+ "name": "sfp-0",
+ "class": "COMPONENT_TYPE_TRANSCEIVER",
+ "description": "XGS-PON",
+ "parent": "cage-0",
+ "uuid": {
+ "uuid": "788ba741-507f-37b1-8e47-4a389460873b"
+ }
+ }
+}
+```
+### List NativeMetricsManagementService APIs
+``` sh
+$ grpcurl -plaintext 172.17.0.2:50075 list dmi.NativeMetricsManagementService
+dmi.NativeMetricsManagementService.GetMetric
+dmi.NativeMetricsManagementService.ListMetrics
+dmi.NativeMetricsManagementService.UpdateMetricsConfiguration
+```
+### SetMsgBusEndpoint API
+```sh
+$ grpcurl -plaintext -d '{"msgbus_endpoint":"10.0.2.15:9092"}' 172.17.0.2:50075 dmi.NativeHWManagementService.SetMsgBusEndpoint
+{
+ "status": "OK"
+}
+```
+### GetMsgBusEndpoint API
+```sh
+$ grpcurl -plaintext 172.17.0.2:50075 dmi.NativeHWManagementService.GetMsgBusEndpoint
+{
+ "status": "OK",
+ "msgbusEndpoint": "10.0.2.15:9092"
+}
+```
+### GetManagedDevices API
+```sh
+$ grpcurl -plaintext -d '{}' 172.17.0.2:50075 dmi.NativeHWManagementService/GetManagedDevices
+{
+ "devices": [
+ {
+ "name": "BBSim-BBSIM_OLT_0",
+ "uri": {
+ "uri": "XXX.YYY.ZZZ.AAA"
+ }
+ }
+ ]
+}
+```
+### GetMetric API for FAN speed
+For FAN speed, metric_id must be set to 1 in grpc curl since enum value is 1.
+```sh
+$ grpcurl -plaintext -d '{"meta_data": {"device_uuid": {"uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"},"component_uuid":{"uuid":"788ba741-507f-37b1-8e47-4a389460873b"}}, "metric_id": "1"}' 172.17.0.2:50075 dmi.NativeMetricsManagementService.GetMetric
+{
+ "status": "OK",
+ "metric": {
+ "metricId": "METRIC_FAN_SPEED",
+ "metricMetadata": {
+ "deviceUuid": {
+ "uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"
+ },
+ "componentUuid": {
+ "uuid": "788ba741-507f-37b1-8e47-4a389460873b"
+ },
+ "componentName": "sfp-0"
+ },
+ "value": {
+ "value": 3245,
+ "type": "SENSOR_VALUE_TYPE_RPM",
+ "scale": "SENSOR_VALUE_SCALE_UNITS",
+ "timestamp": "2020-11-20T13:10:32.843964713Z"
+ }
+ }
+}
+```
+### UpdateMetricsConfiguration API
+``` sh
+$ grpcurl -plaintext -d '{"device_uuid": {"uuid": "5295a1d5-a121-372e-b8dc-6f7eda83f0ba"}, "changes":{"metrics":{"metric_id":"1", "is_configured": "true", "poll_interval":"20"}}}' 172.17.0.2:50075 dmi.NativeMetricsManagementService.UpdateMetricsConfiguration
+{
+ "status": "OK"
+}
+```
+### ListMetrics API
+``` sh
+$ grpcurl -plaintext -d '{"uuid": {"uuid":"5295a1d5-a121-372e-b8dc-6f7eda83f0ba"}}' 172.17.0.2:50075 dmi.NativeMetricsManagementService.ListMetrics
+{
+ "status": "OK",
+ "metrics": {
+ "metrics": [
+ {
+ "metricId": "METRIC_RAM_USAGE_PERCENTAGE",
+ "isConfigured": true,
+ "pollInterval": 60
+ },
+ {
+ "metricId": "METRIC_DISK_USAGE_PERCENTAGE",
+ "isConfigured": true,
+ "pollInterval": 60
+ },
+ {
+ "metricId": "METRIC_INNER_SURROUNDING_TEMP",
+ "isConfigured": true,
+ "pollInterval": 10
+ },
+ {
+ "metricId": "METRIC_CPU_USAGE_PERCENTAGE",
+ "isConfigured": true,
+ "pollInterval": 5
+ },
+ {
+ "metricId": "METRIC_FAN_SPEED",
+ "isConfigured": true,
+ "pollInterval": 10
+ }
+ ]
+ }
+}
+```
diff --git a/go.mod b/go.mod
old mode 100644
new mode 100755
index 63e9eb3..b17d79c
--- a/go.mod
+++ b/go.mod
@@ -18,7 +18,7 @@
github.com/looplab/fsm v0.1.0
github.com/olekukonko/tablewriter v0.0.4
github.com/opencord/cordctl v0.0.0-20190909161711-01e9c1f04bf4
- github.com/opencord/device-management-interface v0.9.1-0.20200930105820-188a84f483b3
+ github.com/opencord/device-management-interface v0.9.5
github.com/opencord/omci-sim v0.0.5
github.com/opencord/voltha-protos/v4 v4.0.2
github.com/pkg/errors v0.8.1 // indirect
diff --git a/go.sum b/go.sum
index 6adc8a6..9ed635a 100644
--- a/go.sum
+++ b/go.sum
@@ -31,11 +31,9 @@
github.com/frankban/quicktest v1.7.2 h1:2QxQoC1TS09S7fhCPsrvqYdvP1H5M1P1ih5ABm3BTYk=
github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
-github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
@@ -47,7 +45,6 @@
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
-github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
@@ -90,8 +87,8 @@
github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA=
github.com/opencord/cordctl v0.0.0-20190909161711-01e9c1f04bf4 h1:Odib2px8tyALzdbyztAAqdxmpmQ/pJahJ7uz8kN/rvk=
github.com/opencord/cordctl v0.0.0-20190909161711-01e9c1f04bf4/go.mod h1:/+3S0pwQUy7HeKnH0KfKp5W6hmh/LdZzuZTNT/m7vA4=
-github.com/opencord/device-management-interface v0.9.1-0.20200930105820-188a84f483b3 h1:B5mxBmXaNWbiqvD5BRssHvUhJFUc8GMcf/Sa/u7ECls=
-github.com/opencord/device-management-interface v0.9.1-0.20200930105820-188a84f483b3/go.mod h1:G1owSqGBGaqllrwtjxfLTsy9EDsGhdhmqkJM3XOnPD0=
+github.com/opencord/device-management-interface v0.9.5 h1:sBnkLLYdZHeaVscmh6SXR5jzlTfUTBPiAi8LspHGjwk=
+github.com/opencord/device-management-interface v0.9.5/go.mod h1:G1owSqGBGaqllrwtjxfLTsy9EDsGhdhmqkJM3XOnPD0=
github.com/opencord/omci-sim v0.0.5 h1:vC6EsdOrPj6w/lRiwCR+Rcx9JRfrKJDR9YwNvfZdvzQ=
github.com/opencord/omci-sim v0.0.5/go.mod h1:ToOkj7hkHgoet9XQDadKMhYqgA7qItZsi2j1Pk/mX6Y=
github.com/opencord/voltha-protos/v4 v4.0.2 h1:SI25ljqftc8Tc28CgfqSE4IGCLJ5MgCmBQlE96hl9X8=
@@ -126,9 +123,7 @@
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20191002035440-2ec189313ef0 h1:2mqDk8w/o6UmeUCu5Qiq2y7iMf6anbx+YA8d1JFoFrs=
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -142,7 +137,6 @@
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
@@ -151,13 +145,11 @@
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c h1:hrpEMCZ2O7DR5gC1n2AJGVhrwiEjOi35+jxtIuZpTMo=
@@ -176,7 +168,6 @@
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -190,11 +181,8 @@
gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM=
gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU=
gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8=
-gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.3 h1:fvjTMHxHEw/mxHbtzPi3JCcKXQRAnQTBRo6YCJSVHKI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/internal/bbsim/dmiserver/dmi_api_server.go b/internal/bbsim/dmiserver/dmi_api_server.go
old mode 100644
new mode 100755
index e90f852..3fed692
--- a/internal/bbsim/dmiserver/dmi_api_server.go
+++ b/internal/bbsim/dmiserver/dmi_api_server.go
@@ -17,6 +17,7 @@
package dmiserver
import (
+ "context"
"net"
"github.com/opencord/bbsim/internal/common"
@@ -39,7 +40,10 @@
uuid string
ponTransceiverUuids []string
ponTransceiverCageUuids []string
- components []*dmi.Component
+ root *dmi.Component
+ metricChannel chan interface{}
+ kafkaEndpoint string
+ mPublisherCancelFunc context.CancelFunc
}
var dmiServ DmiAPIServer
@@ -70,6 +74,10 @@
go func() { _ = grpcServer.Serve(lis) }()
logger.Debugf("DMI grpc Server listening on %v", address)
+ //buffer upto 100 metrics
+ dms.metricChannel = make(chan interface{}, 100)
+
+ StartMetricGenerator(dms)
return grpcServer, nil
}
diff --git a/internal/bbsim/dmiserver/dmi_events_mgmt.go b/internal/bbsim/dmiserver/dmi_events_mgmt.go
old mode 100644
new mode 100755
index 6db9e84..3fc3416
--- a/internal/bbsim/dmiserver/dmi_events_mgmt.go
+++ b/internal/bbsim/dmiserver/dmi_events_mgmt.go
@@ -28,7 +28,7 @@
//empty events
events := []*dmi.EventCfg{{}}
return &dmi.ListEventsResponse{
- Status: dmi.Status_OK,
+ Status: dmi.Status_OK_STATUS,
Reason: dmi.Reason_UNDEFINED_REASON,
Events: &dmi.EventsCfg{
Items: events,
@@ -40,6 +40,6 @@
func (dms *DmiAPIServer) UpdateEventsConfiguration(ctx context.Context, req *dmi.EventsConfigurationRequest) (*dmi.EventsConfigurationResponse, error) {
logger.Debugf("UpdateEventsConfiguration called with request %+v", req)
return &dmi.EventsConfigurationResponse{
- Status: dmi.Status_OK,
+ Status: dmi.Status_OK_STATUS,
}, nil
}
diff --git a/internal/bbsim/dmiserver/dmi_hw_mgmt.go b/internal/bbsim/dmiserver/dmi_hw_mgmt.go
old mode 100644
new mode 100755
index ba5a0c4..30c27f0
--- a/internal/bbsim/dmiserver/dmi_hw_mgmt.go
+++ b/internal/bbsim/dmiserver/dmi_hw_mgmt.go
@@ -20,6 +20,8 @@
"context"
"fmt"
+ "github.com/Shopify/sarama"
+
"github.com/golang/protobuf/ptypes/empty"
"github.com/golang/protobuf/ptypes/timestamp"
"github.com/opencord/bbsim/internal/bbsim/devices"
@@ -94,11 +96,44 @@
components = append(components, &cage)
}
- dms.components = components
+ // create the fans
+ numFans := 2
+ fans := make([]*dmi.Component, numFans)
+
+ for i := 0; i < numFans; i++ {
+ fans[i] = createFanComponent(i + 1)
+ }
+ components = append(components, fans...)
+
+ // Create 1 disk, 1 Processor and 1 ram
+ components = append(components, createDiskComponent(0))
+ components = append(components, createProcessorComponent(0))
+ components = append(components, createMemoryComponent(0))
+ components = append(components, createInnerSurroundingTempComponentSensor(0))
+
+ // create the root component
+ dms.root = &dmi.Component{
+ Name: dms.deviceName,
+ Class: 0,
+ Description: "",
+ Parent: "",
+ ParentRelPos: 0,
+ Children: components,
+ SerialNum: dms.deviceSerial,
+ MfgName: common.Config.Olt.Vendor,
+ IsFru: false,
+ Uri: &dmi.Uri{
+ Uri: dms.ipAddress,
+ },
+ Uuid: &dmi.Uuid{
+ Uuid: dms.uuid,
+ },
+ State: &dmi.ComponentState{},
+ }
logger.Debugf("Generated UUID for the uri %s is %s", dms.ipAddress, dms.uuid)
response := &dmi.StartManagingDeviceResponse{
- Status: dmi.Status_OK,
+ Status: dmi.Status_OK_STATUS,
DeviceUuid: &dmi.Uuid{
Uuid: dms.uuid,
},
@@ -113,6 +148,101 @@
return nil
}
+func createFanComponent(fanIdx int) *dmi.Component {
+ fanName := fmt.Sprintf("Thermal/Fans/System Fan/%d", fanIdx)
+ fanSerial := fmt.Sprintf("bbsim-fan-serial-%d", fanIdx)
+ return &dmi.Component{
+ Name: fanName,
+ Class: dmi.ComponentType_COMPONENT_TYPE_FAN,
+ Description: "bbsim-fan",
+ Parent: "",
+ ParentRelPos: 0,
+ SerialNum: fanSerial,
+ MfgName: "bbsim-fan",
+ IsFru: false,
+ Uuid: &dmi.Uuid{
+ Uuid: getUUID(fanName),
+ },
+ State: &dmi.ComponentState{},
+ }
+}
+
+func createProcessorComponent(cpuIdx int) *dmi.Component {
+ cpuName := fmt.Sprintf("Systems/1/Processors/%d", cpuIdx)
+ cpuSerial := fmt.Sprintf("bbsim-cpu-serial-%d", cpuIdx)
+ return &dmi.Component{
+ Name: cpuName,
+ Class: dmi.ComponentType_COMPONENT_TYPE_CPU,
+ Description: "bbsim-cpu",
+ Parent: "",
+ ParentRelPos: 0,
+ SerialNum: cpuSerial,
+ MfgName: "bbsim-cpu",
+ IsFru: false,
+ Uuid: &dmi.Uuid{
+ Uuid: getUUID(cpuName),
+ },
+ State: &dmi.ComponentState{},
+ }
+}
+
+func createMemoryComponent(memIdx int) *dmi.Component {
+ memName := fmt.Sprintf("Systems/1/Memory/%d", memIdx)
+ memSerial := fmt.Sprintf("bbsim-ram-serial-%d", memIdx)
+ return &dmi.Component{
+ Name: memName,
+ Class: dmi.ComponentType_COMPONENT_TYPE_MEMORY,
+ Description: "bbsim-ram",
+ Parent: "",
+ ParentRelPos: 0,
+ SerialNum: memSerial,
+ MfgName: "bbsim-ram",
+ IsFru: false,
+ Uuid: &dmi.Uuid{
+ Uuid: getUUID(memName),
+ },
+ State: &dmi.ComponentState{},
+ }
+}
+
+func createDiskComponent(diskIdx int) *dmi.Component {
+ diskName := fmt.Sprintf("Systems/1/Disk/%d", diskIdx)
+ diskSerial := fmt.Sprintf("bbsim-disk-serial-%d", diskIdx)
+ return &dmi.Component{
+ Name: diskName,
+ Class: dmi.ComponentType_COMPONENT_TYPE_STORAGE,
+ Description: "bbsim-disk",
+ Parent: "",
+ ParentRelPos: 0,
+ SerialNum: diskSerial,
+ MfgName: "bbsim-disk",
+ IsFru: false,
+ Uuid: &dmi.Uuid{
+ Uuid: getUUID(diskName),
+ },
+ State: &dmi.ComponentState{},
+ }
+}
+
+func createInnerSurroundingTempComponentSensor(sensorIdx int) *dmi.Component {
+ sensorName := fmt.Sprintf("Systems/1/Sensor/%d", sensorIdx)
+ sensorSerial := fmt.Sprintf("bbsim-sensor-istemp-serial-%d", sensorIdx)
+ return &dmi.Component{
+ Name: sensorName,
+ Class: dmi.ComponentType_COMPONENT_TYPE_SENSOR,
+ Description: "bbsim-istemp",
+ Parent: "",
+ ParentRelPos: 0,
+ SerialNum: sensorSerial,
+ MfgName: "bbsim-istemp",
+ IsFru: false,
+ Uuid: &dmi.Uuid{
+ Uuid: getUUID(sensorName),
+ },
+ State: &dmi.ComponentState{},
+ }
+}
+
//StopManagingDevice stops management of a device and cleans up any context and caches for that device
func (dms *DmiAPIServer) StopManagingDevice(context.Context, *dmi.StopManagingDeviceRequest) (*dmi.StopManagingDeviceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "rpc StopManagingDevice not implemented")
@@ -138,7 +268,7 @@
logger.Errorf("Requested uuid =%s, uuid of existing device = %s", req.DeviceUuid.Uuid, dms.uuid)
// Wrong uuid, return error
errResponse := &dmi.PhysicalInventoryResponse{
- Status: dmi.Status_ERROR,
+ Status: dmi.Status_ERROR_STATUS,
Reason: dmi.Reason_UNKNOWN_DEVICE,
Inventory: &dmi.Hardware{},
}
@@ -147,30 +277,13 @@
}
response := &dmi.PhysicalInventoryResponse{
- Status: dmi.Status_OK,
+ Status: dmi.Status_OK_STATUS,
Inventory: &dmi.Hardware{
LastChange: ×tamp.Timestamp{
Seconds: 0,
Nanos: 0,
},
- Root: &dmi.Component{
- Name: dms.deviceName,
- Class: 0,
- Description: "",
- Parent: "",
- ParentRelPos: 0,
- Children: dms.components,
- SerialNum: dms.deviceSerial,
- MfgName: common.Config.Olt.Vendor,
- IsFru: false,
- Uri: &dmi.Uri{
- Uri: dms.ipAddress,
- },
- Uuid: &dmi.Uuid{
- Uuid: dms.uuid,
- },
- State: &dmi.ComponentState{},
- },
+ Root: dms.root,
},
}
return sendResponseBackOnStream(stream, response)
@@ -179,7 +292,6 @@
//Contains tells whether arr contains element.
func Contains(arr []string, element string) bool {
for _, item := range arr {
- logger.Debugf("Checking in Contains slice elem = %v str = %s", item, element)
if element == item {
return true
}
@@ -188,29 +300,47 @@
}
func findComponent(l []*dmi.Component, compUUID string) *dmi.Component {
+ var foundComp *dmi.Component
+
for _, comp := range l {
logger.Debugf("findComponent slice comp = %v compUUID = %s", comp, compUUID)
if comp.Uuid.Uuid == compUUID {
return comp
}
- for _, child := range comp.GetChildren() {
- logger.Debugf("findComponent Child slice comp = %v compUUID = %s", comp, compUUID)
- if child.Uuid.Uuid == compUUID {
- return child
- }
+ foundComp = findComponent(comp.GetChildren(), compUUID)
+ if foundComp != nil {
+ return foundComp
}
}
return nil
}
+func findComponentsOfType(l []*dmi.Component, compType dmi.ComponentType) []*dmi.Component {
+ var comps []*dmi.Component
+ findComponents(l, compType, &comps)
+ return comps
+}
+
+func findComponents(l []*dmi.Component, compType dmi.ComponentType, collector *[]*dmi.Component) {
+
+ for _, comp := range l {
+ if comp.Class == compType {
+ *collector = append(*collector, comp)
+ //logger.Debugf("Added collector = %v", *collector)
+ }
+
+ findComponents(comp.GetChildren(), compType, collector)
+ }
+}
+
func sendGetHWComponentResponse(c *dmi.Component, stream dmi.NativeHWManagementService_GetHWComponentInfoServer) error {
- apiStatus := dmi.Status_OK
+ apiStatus := dmi.Status_OK_STATUS
reason := dmi.Reason_UNDEFINED_REASON
if c == nil {
- apiStatus = dmi.Status_ERROR
+ apiStatus = dmi.Status_ERROR_STATUS
reason = dmi.Reason_UNKNOWN_DEVICE
}
@@ -240,18 +370,9 @@
return status.Errorf(codes.Internal, "stream to send is nil, can not send response from gRPC server")
}
- componentFound := Contains(dms.ponTransceiverUuids, req.ComponentUuid.Uuid)
- if !componentFound {
- componentFound = Contains(dms.ponTransceiverCageUuids, req.ComponentUuid.Uuid)
- }
-
- if req.DeviceUuid.Uuid != dms.uuid || !componentFound {
- // Wrong uuid, return error
- return sendGetHWComponentResponse(nil, stream)
- }
-
// Search for the component and return it
- c := findComponent(dms.components, req.ComponentUuid.Uuid)
+ c := findComponent(dms.root.Children, req.ComponentUuid.Uuid)
+
return sendGetHWComponentResponse(c, stream)
}
@@ -266,18 +387,55 @@
}
//GetLoggingEndpoint gets the configured location to which the logs are being shipped
-func (dms *DmiAPIServer) GetLoggingEndpoint(context.Context, *dmi.Uuid) (*dmi.GetLoggingEndpointResponse, error) {
+func (dms *DmiAPIServer) GetLoggingEndpoint(context.Context, *dmi.HardwareID) (*dmi.GetLoggingEndpointResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "rpc GetLoggingEndpoint not implemented")
}
//SetMsgBusEndpoint sets the location of the Message Bus to which events and metrics are shipped
-func (dms *DmiAPIServer) SetMsgBusEndpoint(context.Context, *dmi.SetMsgBusEndpointRequest) (*dmi.SetRemoteEndpointResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "rpc SetMsgBusEndpoint not implemented")
+func (dms *DmiAPIServer) SetMsgBusEndpoint(ctx context.Context, request *dmi.SetMsgBusEndpointRequest) (*dmi.SetRemoteEndpointResponse, error) {
+ logger.Debugf("SetMsgBusEndpoint() invoked with request: %+v and context: %v", request, ctx)
+ if request == nil || request.MsgbusEndpoint == "" {
+ return &dmi.SetRemoteEndpointResponse{Status: dmi.Status_ERROR_STATUS, Reason: dmi.Reason_KAFKA_ENDPOINT_ERROR},
+ status.Errorf(codes.FailedPrecondition, "request is nil")
+ }
+ olt := devices.GetOLT()
+ dms.kafkaEndpoint = request.MsgbusEndpoint
+
+ // close the old publisher
+ if dms.mPublisherCancelFunc != nil {
+ dms.mPublisherCancelFunc()
+ }
+
+ // initialize a new publisher
+ var nCtx context.Context
+ nCtx, dms.mPublisherCancelFunc = context.WithCancel(context.Background())
+ // initialize a publisher
+ if err := InitializeDMKafkaPublishers(sarama.NewAsyncProducer, olt.ID, dms.kafkaEndpoint); err == nil {
+ // start a go routine which will read from channel and publish on kafka
+ go DMKafkaPublisher(nCtx, dms.metricChannel, "dm.metrics")
+ } else {
+ logger.Errorf("Failed to start kafka publisher: %v", err)
+ return &dmi.SetRemoteEndpointResponse{Status: dmi.Status_ERROR_STATUS, Reason: dmi.Reason_KAFKA_ENDPOINT_ERROR}, err
+ }
+
+ return &dmi.SetRemoteEndpointResponse{Status: dmi.Status_OK_STATUS, Reason: dmi.Reason_UNDEFINED_REASON}, nil
}
//GetMsgBusEndpoint gets the configured location to which the events and metrics are being shipped
func (dms *DmiAPIServer) GetMsgBusEndpoint(context.Context, *empty.Empty) (*dmi.GetMsgBusEndpointResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "rpc GetMsgBusEndpoint not implemented")
+ logger.Debugf("GetMsgBusEndpoint() invoked")
+ if dms.kafkaEndpoint != "" {
+ return &dmi.GetMsgBusEndpointResponse{
+ Status: dmi.Status_OK_STATUS,
+ Reason: dmi.Reason_UNDEFINED_REASON,
+ MsgbusEndpoint: dms.kafkaEndpoint,
+ }, nil
+ }
+ return &dmi.GetMsgBusEndpointResponse{
+ Status: dmi.Status_ERROR_STATUS,
+ Reason: dmi.Reason_KAFKA_ENDPOINT_ERROR,
+ MsgbusEndpoint: "",
+ }, nil
}
//GetManagedDevices returns an object containing a list of devices managed by this entity
@@ -297,3 +455,35 @@
return &retResponse, nil
}
+
+//GetLogLevel Gets the configured log level for a certain entity on a certain device.
+func (dms *DmiAPIServer) GetLogLevel(context.Context, *dmi.GetLogLevelRequest) (*dmi.GetLogLevelResponse, error) {
+ return &dmi.GetLogLevelResponse{
+ Status: dmi.Status_OK_STATUS,
+ DeviceUuid: &dmi.Uuid{
+ Uuid: dms.uuid,
+ },
+ LogLevels: []*dmi.EntitiesLogLevel{},
+ }, nil
+}
+
+// SetLogLevel Sets the log level of the device, for each given entity to a certain level.
+func (dms *DmiAPIServer) SetLogLevel(context.Context, *dmi.SetLogLevelRequest) (*dmi.SetLogLevelResponse, error) {
+ return &dmi.SetLogLevelResponse{
+ Status: dmi.Status_OK_STATUS,
+ DeviceUuid: &dmi.Uuid{
+ Uuid: dms.uuid,
+ },
+ }, nil
+}
+
+// GetLoggableEntities Gets the entities of a device on which log can be configured.
+func (dms *DmiAPIServer) GetLoggableEntities(context.Context, *dmi.GetLoggableEntitiesRequest) (*dmi.GetLogLevelResponse, error) {
+ return &dmi.GetLogLevelResponse{
+ Status: dmi.Status_OK_STATUS,
+ DeviceUuid: &dmi.Uuid{
+ Uuid: dms.uuid,
+ },
+ LogLevels: []*dmi.EntitiesLogLevel{},
+ }, nil
+}
diff --git a/internal/bbsim/dmiserver/dmi_kafka_producer.go b/internal/bbsim/dmiserver/dmi_kafka_producer.go
new file mode 100755
index 0000000..9ee0172
--- /dev/null
+++ b/internal/bbsim/dmiserver/dmi_kafka_producer.go
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2018-present 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.
+ */
+
+package dmiserver
+
+import (
+ "context"
+ "encoding/json"
+ "strconv"
+ "time"
+
+ "github.com/Shopify/sarama"
+ log "github.com/sirupsen/logrus"
+)
+
+var metricsProducer sarama.AsyncProducer
+
+// InitializeDMKafkaPublishers initializes metrics kafka publisher
+func InitializeDMKafkaPublishers(NewAsyncProducer func([]string, *sarama.Config) (sarama.AsyncProducer, error), oltID int, msgBusEndPoint string) error {
+ var err error
+ sarama.Logger = log.New()
+ // producer config
+ config := sarama.NewConfig()
+ config.Producer.Retry.Max = 5
+ config.Metadata.Retry.Max = 10
+ config.Metadata.Retry.Backoff = 10 * time.Second
+ config.ClientID = "BBSim-OLT-Metrics-" + strconv.Itoa(oltID)
+
+ metricsProducer, err = NewAsyncProducer([]string{msgBusEndPoint}, config)
+ return err
+}
+
+// DMKafkaPublisher receives messages on ch and publish them to kafka on topic
+func DMKafkaPublisher(ctx context.Context, ch chan interface{}, topic string) {
+ defer log.Debugf("DMKafkaPublisher stopped")
+loop:
+ for {
+ select {
+ case metric := <-ch:
+ log.Tracef("Writing to kafka topic(%s): %v", topic, metric)
+ jsonMet, err := json.Marshal(metric)
+ if err != nil {
+ log.Errorf("Failed to get json metric %v", err)
+ continue
+ }
+ metricsProducer.Input() <- &sarama.ProducerMessage{
+ Topic: topic,
+ Value: sarama.ByteEncoder(jsonMet),
+ }
+ case <-ctx.Done():
+ log.Infof("Stopping DM Kafka Publisher for topic %s", topic)
+ break loop
+ }
+ }
+}
diff --git a/internal/bbsim/dmiserver/dmi_metrics_generator.go b/internal/bbsim/dmiserver/dmi_metrics_generator.go
new file mode 100755
index 0000000..f7bbd03
--- /dev/null
+++ b/internal/bbsim/dmiserver/dmi_metrics_generator.go
@@ -0,0 +1,346 @@
+/*
+ * Copyright 2018-present 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.
+ */
+
+package dmiserver
+
+import (
+ "math/rand"
+ "sync"
+ "time"
+
+ "github.com/golang/protobuf/ptypes"
+ dmi "github.com/opencord/device-management-interface/go/dmi"
+)
+
+// MetricTriggerConfig is the configuration of a metric and the time at which it will be exported
+type MetricTriggerConfig struct {
+ cfg dmi.MetricConfig
+ t time.Time
+}
+
+//DmiMetricsGenerator has the attributes for generating metrics
+type DmiMetricsGenerator struct {
+ apiSrv *DmiAPIServer
+ configuredMetrics map[dmi.MetricNames]MetricTriggerConfig
+ access sync.Mutex
+}
+
+var dmiMG DmiMetricsGenerator
+
+//StartMetricGenerator starts the metric generator
+func StartMetricGenerator(apiSrv *DmiAPIServer) {
+
+ // Seed the rand for use later on
+ rand.Seed(time.Now().UnixNano())
+
+ dmiMG = DmiMetricsGenerator{
+ apiSrv: apiSrv,
+ }
+ dmiMG.configuredMetrics = make(map[dmi.MetricNames]MetricTriggerConfig)
+
+ // Add CPU usage as a default Metric reported every 60 secs
+ cpuMetricConfig := dmi.MetricConfig{
+ MetricId: dmi.MetricNames_METRIC_CPU_USAGE_PERCENTAGE,
+ IsConfigured: true,
+ PollInterval: 60,
+ }
+ dmiMG.configuredMetrics[dmi.MetricNames_METRIC_CPU_USAGE_PERCENTAGE] = MetricTriggerConfig{
+ cfg: cpuMetricConfig,
+ t: time.Unix(0, 0),
+ }
+
+ // Add FAN speed metric as a default Metric reported every 120 secs
+ fanSpeedMetricConfig := dmi.MetricConfig{
+ MetricId: dmi.MetricNames_METRIC_FAN_SPEED,
+ IsConfigured: true,
+ PollInterval: 120,
+ }
+ dmiMG.configuredMetrics[dmi.MetricNames_METRIC_FAN_SPEED] = MetricTriggerConfig{
+ cfg: fanSpeedMetricConfig,
+ t: time.Unix(0, 0),
+ }
+
+ // Add RAM usage percentage metric reported every 60 seconds
+ ramUsageMetricConfig := dmi.MetricConfig{
+ MetricId: dmi.MetricNames_METRIC_RAM_USAGE_PERCENTAGE,
+ IsConfigured: false,
+ PollInterval: 60,
+ }
+ dmiMG.configuredMetrics[dmi.MetricNames_METRIC_RAM_USAGE_PERCENTAGE] = MetricTriggerConfig{
+ cfg: ramUsageMetricConfig,
+ t: time.Unix(0, 0),
+ }
+
+ // Add DISK usage percentage metric reported every 60 seconds
+ diskUsageMetricConfig := dmi.MetricConfig{
+ MetricId: dmi.MetricNames_METRIC_DISK_USAGE_PERCENTAGE,
+ IsConfigured: false,
+ PollInterval: 60,
+ }
+ dmiMG.configuredMetrics[dmi.MetricNames_METRIC_DISK_USAGE_PERCENTAGE] = MetricTriggerConfig{
+ cfg: diskUsageMetricConfig,
+ t: time.Unix(0, 0),
+ }
+ // Add Inner Surrounding TEMP usage percentage metric reported every 120 seconds
+ innerTempUsageMetricConfig := dmi.MetricConfig{
+ MetricId: dmi.MetricNames_METRIC_INNER_SURROUNDING_TEMP,
+ IsConfigured: true,
+ PollInterval: 120,
+ }
+ dmiMG.configuredMetrics[dmi.MetricNames_METRIC_INNER_SURROUNDING_TEMP] = MetricTriggerConfig{
+ cfg: innerTempUsageMetricConfig,
+ t: time.Unix(0, 0),
+ }
+
+ go func() {
+ for {
+ c := make(map[dmi.MetricNames]MetricTriggerConfig)
+
+ dmiMG.access.Lock()
+ for k, v := range dmiMG.configuredMetrics {
+ c[k] = v
+ }
+ dmiMG.access.Unlock()
+
+ now := time.Now()
+ // For all the supported metrics
+ for k, v := range c {
+ if dmiMG.apiSrv.root == nil || dmiMG.apiSrv.root.Children == nil {
+ // inventory might not yet be created or somehow disappeared
+ break
+ }
+
+ if k == dmi.MetricNames_METRIC_CPU_USAGE_PERCENTAGE && v.cfg.IsConfigured {
+ if now.Before(v.t) {
+ continue
+ }
+ updateConfiguredMetrics(now, dmi.MetricNames_METRIC_CPU_USAGE_PERCENTAGE, &v)
+
+ // Get the CPUs
+ for _, cpu := range findComponentsOfType(dmiMG.apiSrv.root.Children, dmi.ComponentType_COMPONENT_TYPE_CPU) {
+ m := generateCPUUsageMetric(cpu, dmiMG.apiSrv)
+ logger.Debugf("Got metric %v", m)
+ sendOutMetric(m, dmiMG.apiSrv)
+ }
+ } else if k == dmi.MetricNames_METRIC_FAN_SPEED && v.cfg.IsConfigured {
+ if now.Before(v.t) {
+ continue
+ }
+ updateConfiguredMetrics(now, dmi.MetricNames_METRIC_FAN_SPEED, &v)
+
+ // Get the FANs
+ for _, fan := range findComponentsOfType(dmiMG.apiSrv.root.Children, dmi.ComponentType_COMPONENT_TYPE_FAN) {
+ m := generateFanSpeedMetric(fan, dmiMG.apiSrv)
+ logger.Debugf("Got metric %v", m)
+ sendOutMetric(m, dmiMG.apiSrv)
+ }
+ } else if k == dmi.MetricNames_METRIC_RAM_USAGE_PERCENTAGE && v.cfg.IsConfigured {
+ if now.Before(v.t) {
+ continue
+ }
+ updateConfiguredMetrics(now, dmi.MetricNames_METRIC_RAM_USAGE_PERCENTAGE, &v)
+ // Get the RAM
+ for _, ram := range findComponentsOfType(dmiMG.apiSrv.root.Children, dmi.ComponentType_COMPONENT_TYPE_MEMORY) {
+ m := generateRAMUsageMetric(ram, dmiMG.apiSrv)
+ logger.Debugf("Got metric for ram usage percentage %v", m)
+ sendOutMetric(m, dmiMG.apiSrv)
+ }
+ } else if k == dmi.MetricNames_METRIC_DISK_USAGE_PERCENTAGE && v.cfg.IsConfigured {
+ if now.Before(v.t) {
+ continue
+ }
+ updateConfiguredMetrics(now, dmi.MetricNames_METRIC_DISK_USAGE_PERCENTAGE, &v)
+ // Get the DISK
+ for _, disk := range findComponentsOfType(dmiMG.apiSrv.root.Children, dmi.ComponentType_COMPONENT_TYPE_STORAGE) {
+ m := generateDiskUsageMetric(disk, dmiMG.apiSrv)
+ logger.Debugf("Got metric for disk usage percentage %v", m)
+ sendOutMetric(m, dmiMG.apiSrv)
+ }
+ } else if k == dmi.MetricNames_METRIC_INNER_SURROUNDING_TEMP && v.cfg.IsConfigured {
+ if now.Before(v.t) {
+ continue
+ }
+ updateConfiguredMetrics(now, dmi.MetricNames_METRIC_INNER_SURROUNDING_TEMP, &v)
+ // Get the INNER SURROUNDING TEMPERATURE
+ for _, isTemp := range findComponentsOfType(dmiMG.apiSrv.root.Children, dmi.ComponentType_COMPONENT_TYPE_SENSOR) {
+ m := generateInnerSurroundingTempMetric(isTemp, dmiMG.apiSrv)
+ logger.Debugf("Got metric for inner surrounding temperature %v", m)
+ sendOutMetric(m, dmiMG.apiSrv)
+ }
+ }
+ }
+ time.Sleep(1 * time.Second)
+ }
+ }()
+}
+
+func sendOutMetric(metric interface{}, apiSrv *DmiAPIServer) {
+ select {
+ case apiSrv.metricChannel <- metric:
+ default:
+ logger.Debugf("Channel not ready dropping Metric")
+ }
+}
+
+func updateConfiguredMetrics(curr time.Time, typ dmi.MetricNames, old *MetricTriggerConfig) {
+ dmiMG.access.Lock()
+ dmiMG.configuredMetrics[typ] = MetricTriggerConfig{
+ cfg: old.cfg,
+ t: curr.Add(time.Second * time.Duration(old.cfg.PollInterval)),
+ }
+ dmiMG.access.Unlock()
+}
+
+func updateMetricIDAndMetaData(id dmi.MetricNames, c *dmi.Component, apiSrv *DmiAPIServer, m *dmi.Metric) *dmi.Metric {
+ m.MetricId = id
+ m.MetricMetadata = &dmi.MetricMetaData{
+ DeviceUuid: &dmi.Uuid{
+ Uuid: apiSrv.uuid,
+ },
+ ComponentUuid: c.Uuid,
+ ComponentName: c.Name,
+ }
+ return m
+}
+
+func generateCPUUsageMetric(cpu *dmi.Component, apiSrv *DmiAPIServer) *dmi.Metric {
+ var met dmi.Metric
+ met = *updateMetricIDAndMetaData(dmi.MetricNames_METRIC_CPU_USAGE_PERCENTAGE, cpu, apiSrv, &met)
+ met.Value = &dmi.ComponentSensorData{
+ Value: generateRand(1, 20),
+ Type: dmi.SensorValueType_SENSOR_VALUE_TYPE_OTHER,
+ Scale: dmi.SensorValueScale_SENSOR_VALUE_SCALE_UNITS,
+ Timestamp: ptypes.TimestampNow(),
+ }
+ return &met
+}
+
+func generateFanSpeedMetric(fan *dmi.Component, apiSrv *DmiAPIServer) *dmi.Metric {
+ var met dmi.Metric
+ met = *updateMetricIDAndMetaData(dmi.MetricNames_METRIC_FAN_SPEED, fan, apiSrv, &met)
+ met.Value = &dmi.ComponentSensorData{
+ Value: generateRand(3000, 4000),
+ Type: dmi.SensorValueType_SENSOR_VALUE_TYPE_RPM,
+ Scale: dmi.SensorValueScale_SENSOR_VALUE_SCALE_UNITS,
+ Timestamp: ptypes.TimestampNow(),
+ }
+ return &met
+}
+
+// return a random number RAND which is: lValue < RAND < hValue
+func generateRand(lValue, hValue int32) int32 {
+ if lValue >= hValue {
+ return 0
+ }
+
+ diff := hValue - lValue
+
+ randVal := rand.Int31n(diff)
+
+ return lValue + randVal
+}
+
+//UpdateMetricConfig Adds/Updates the passed metric configuration
+func UpdateMetricConfig(newCfg *dmi.MetricConfig) {
+ dmiMG.access.Lock()
+ dmiMG.configuredMetrics[newCfg.GetMetricId()] = MetricTriggerConfig{
+ cfg: *newCfg,
+ t: time.Unix(0, 0),
+ }
+ dmiMG.access.Unlock()
+ logger.Infof("Metric updated %v", newCfg)
+}
+
+func generateRAMUsageMetric(ram *dmi.Component, apiSrv *DmiAPIServer) *dmi.Metric {
+ var met dmi.Metric
+ met = *updateMetricIDAndMetaData(dmi.MetricNames_METRIC_RAM_USAGE_PERCENTAGE, ram, apiSrv, &met)
+ met.Value = &dmi.ComponentSensorData{
+ Value: generateRand(1, 8),
+ Type: dmi.SensorValueType_SENSOR_VALUE_TYPE_OTHER,
+ Scale: dmi.SensorValueScale_SENSOR_VALUE_SCALE_GIGA,
+ Timestamp: ptypes.TimestampNow(),
+ }
+ return &met
+}
+
+func generateDiskUsageMetric(disk *dmi.Component, apiSrv *DmiAPIServer) *dmi.Metric {
+ var met dmi.Metric
+ met = *updateMetricIDAndMetaData(dmi.MetricNames_METRIC_DISK_USAGE_PERCENTAGE, disk, apiSrv, &met)
+ met.Value = &dmi.ComponentSensorData{
+ Value: generateRand(50, 500),
+ Type: dmi.SensorValueType_SENSOR_VALUE_TYPE_OTHER,
+ Scale: dmi.SensorValueScale_SENSOR_VALUE_SCALE_GIGA,
+ Timestamp: ptypes.TimestampNow(),
+ }
+ return &met
+}
+
+func generateInnerSurroundingTempMetric(istemp *dmi.Component, apiSrv *DmiAPIServer) *dmi.Metric {
+ var met dmi.Metric
+ met = *updateMetricIDAndMetaData(dmi.MetricNames_METRIC_INNER_SURROUNDING_TEMP, istemp, apiSrv, &met)
+ met.Value = &dmi.ComponentSensorData{
+ Value: generateRand(30, 40),
+ Type: dmi.SensorValueType_SENSOR_VALUE_TYPE_CELSIUS,
+ Scale: dmi.SensorValueScale_SENSOR_VALUE_SCALE_UNITS,
+ Timestamp: ptypes.TimestampNow(),
+ }
+ return &met
+}
+
+// get the metrics list
+func getMetricsList() []*dmi.MetricConfig {
+ components := make(map[dmi.MetricNames]MetricTriggerConfig)
+ dmiMG.access.Lock()
+
+ for key, value := range dmiMG.configuredMetrics {
+ components[key] = value
+ }
+
+ dmiMG.access.Unlock()
+
+ var toRet []*dmi.MetricConfig
+ for _, v := range components {
+ metricConfig := v.cfg
+ toRet = append(toRet, &metricConfig)
+ }
+ logger.Debugf("Metrics list %+v", toRet)
+ return toRet
+}
+
+func getMetric(comp *dmi.Component, metricID dmi.MetricNames) *dmi.Metric {
+ switch metricID {
+ case dmi.MetricNames_METRIC_FAN_SPEED:
+ metric := generateFanSpeedMetric(comp, dmiMG.apiSrv)
+ return metric
+
+ case dmi.MetricNames_METRIC_CPU_USAGE_PERCENTAGE:
+ metric := generateCPUUsageMetric(comp, dmiMG.apiSrv)
+ return metric
+
+ case dmi.MetricNames_METRIC_RAM_USAGE_PERCENTAGE:
+ metric := generateRAMUsageMetric(comp, dmiMG.apiSrv)
+ return metric
+
+ case dmi.MetricNames_METRIC_DISK_USAGE_PERCENTAGE:
+ metric := generateDiskUsageMetric(comp, dmiMG.apiSrv)
+ return metric
+
+ case dmi.MetricNames_METRIC_INNER_SURROUNDING_TEMP:
+ metric := generateInnerSurroundingTempMetric(comp, dmiMG.apiSrv)
+ return metric
+ }
+ return nil
+}
diff --git a/internal/bbsim/dmiserver/dmi_metrics_mgmt.go b/internal/bbsim/dmiserver/dmi_metrics_mgmt.go
old mode 100644
new mode 100755
index 51b5dcc..3f33941
--- a/internal/bbsim/dmiserver/dmi_metrics_mgmt.go
+++ b/internal/bbsim/dmiserver/dmi_metrics_mgmt.go
@@ -19,16 +19,19 @@
import (
"context"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
+
dmi "github.com/opencord/device-management-interface/go/dmi"
)
//ListMetrics lists the supported metrics for the passed device.
func (dms *DmiAPIServer) ListMetrics(ctx context.Context, req *dmi.HardwareID) (*dmi.ListMetricsResponse, error) {
logger.Debugf("ListMetrics invoked with request %+v", req)
- //return empty list of metrics for now
- metrics := []*dmi.MetricConfig{{}}
+ metrics := getMetricsList()
+
return &dmi.ListMetricsResponse{
- Status: dmi.Status_OK,
+ Status: dmi.Status_OK_STATUS,
Reason: 0,
Metrics: &dmi.MetricsConfig{
Metrics: metrics,
@@ -39,18 +42,50 @@
//UpdateMetricsConfiguration updates the configuration of the list of metrics in the request
func (dms *DmiAPIServer) UpdateMetricsConfiguration(ctx context.Context, req *dmi.MetricsConfigurationRequest) (*dmi.MetricsConfigurationResponse, error) {
logger.Debugf("UpdateMetricConfiguration invoked with request %+v", req)
+
+ if req == nil || req.Operation == nil {
+ return &dmi.MetricsConfigurationResponse{
+ Status: dmi.Status_UNDEFINED_STATUS,
+ Reason: dmi.Reason_UNDEFINED_REASON,
+ }, status.Errorf(codes.FailedPrecondition, "request is nil")
+ }
+
+ switch x := req.Operation.(type) {
+ case *dmi.MetricsConfigurationRequest_Changes:
+ for _, chMetric := range x.Changes.Metrics {
+ UpdateMetricConfig(chMetric)
+ }
+ case *dmi.MetricsConfigurationRequest_ResetToDefault:
+ logger.Debugf("To be implemented later")
+ case nil:
+ // The field is not set.
+ logger.Debugf("Update request operation type is nil")
+ return &dmi.MetricsConfigurationResponse{
+ Status: dmi.Status_UNDEFINED_STATUS,
+ }, nil
+ }
+
return &dmi.MetricsConfigurationResponse{
- Status: dmi.Status_OK,
+ Status: dmi.Status_OK_STATUS,
}, nil
}
//GetMetric gets the instantenous value of a metric
func (dms *DmiAPIServer) GetMetric(ctx context.Context, req *dmi.GetMetricRequest) (*dmi.GetMetricResponse, error) {
logger.Debugf("GetMetric invoked with request %+v", req)
- return &dmi.GetMetricResponse{
- Status: dmi.Status_OK,
- Reason: dmi.Reason_UNDEFINED_REASON,
- Metric: &dmi.Metric{},
- }, nil
+ if req == nil || req.GetMetricId() < 0 {
+ return &dmi.GetMetricResponse{
+ Status: dmi.Status_ERROR_STATUS,
+ Reason: dmi.Reason_UNDEFINED_REASON,
+ Metric: &dmi.Metric{},
+ }, status.Errorf(codes.FailedPrecondition, "request is nil")
+ }
+ comp := findComponent(dms.root.Children, req.MetaData.ComponentUuid.Uuid)
+ metric := getMetric(comp, req.GetMetricId())
+ return &dmi.GetMetricResponse{
+ Status: dmi.Status_OK_STATUS,
+ Reason: dmi.Reason_UNDEFINED_REASON,
+ Metric: metric,
+ }, nil
}
diff --git a/internal/bbsim/dmiserver/dmi_sw_mgmt.go b/internal/bbsim/dmiserver/dmi_sw_mgmt.go
old mode 100644
new mode 100755
index 0d24d9d..a1186d3
--- a/internal/bbsim/dmiserver/dmi_sw_mgmt.go
+++ b/internal/bbsim/dmiserver/dmi_sw_mgmt.go
@@ -27,7 +27,7 @@
// TODO: Make this more interesting by taking values from BBSim if available
logger.Debugf("GetSoftwareVersion invoked with for device %+v", req)
return &dmi.GetSoftwareVersionInformationResponse{
- Status: dmi.Status_OK,
+ Status: dmi.Status_OK_STATUS,
Reason: dmi.Reason_UNDEFINED_REASON,
Info: &dmi.SoftwareVersionInformation{
ActiveVersions: []*dmi.ImageVersion{{
@@ -46,7 +46,7 @@
func (dms *DmiAPIServer) DownloadImage(req *dmi.DownloadImageRequest, stream dmi.NativeSoftwareManagementService_DownloadImageServer) error {
logger.Debugf("DownloadImage invoked with request %+v", req)
err := stream.Send(&dmi.ImageStatus{
- Status: dmi.Status_OK,
+ Status: dmi.Status_OK_STATUS,
State: dmi.ImageStatus_COPYING_IMAGE,
})
if err != nil {
@@ -61,7 +61,7 @@
func (dms *DmiAPIServer) ActivateImage(req *dmi.HardwareID, stream dmi.NativeSoftwareManagementService_ActivateImageServer) error {
logger.Debugf("ActivateImage invoked with request %+v", req)
err := stream.Send(&dmi.ImageStatus{
- Status: dmi.Status_OK,
+ Status: dmi.Status_OK_STATUS,
State: dmi.ImageStatus_ACTIVATION_COMPLETE,
})
@@ -77,7 +77,7 @@
func (dms *DmiAPIServer) RevertToStandbyImage(req *dmi.HardwareID, stream dmi.NativeSoftwareManagementService_RevertToStandbyImageServer) error {
logger.Debugf("RevertToStandbyImage invoked with request %+v", req)
err := stream.Send(&dmi.ImageStatus{
- Status: dmi.Status_OK,
+ Status: dmi.Status_OK_STATUS,
State: dmi.ImageStatus_ACTIVATION_COMPLETE,
})
@@ -87,3 +87,9 @@
}
return nil
}
+
+// UpdateStartupConfiguration API can be used to let the devices pickup their properitary configuration which they need at startup.
+func (dms *DmiAPIServer) UpdateStartupConfiguration(*dmi.ConfigRequest, dmi.NativeSoftwareManagementService_UpdateStartupConfigurationServer) error {
+ logger.Debugf("UpdateStartupConfiguration invoked")
+ return nil
+}
diff --git a/vendor/github.com/opencord/device-management-interface/go/dmi/commons.pb.go b/vendor/github.com/opencord/device-management-interface/go/dmi/commons.pb.go
index 2f90bd5..1b3b9da 100644
--- a/vendor/github.com/opencord/device-management-interface/go/dmi/commons.pb.go
+++ b/vendor/github.com/opencord/device-management-interface/go/dmi/commons.pb.go
@@ -24,20 +24,20 @@
const (
Status_UNDEFINED_STATUS Status = 0
- Status_OK Status = 1
- Status_ERROR Status = 2
+ Status_OK_STATUS Status = 1
+ Status_ERROR_STATUS Status = 2
)
var Status_name = map[int32]string{
0: "UNDEFINED_STATUS",
- 1: "OK",
- 2: "ERROR",
+ 1: "OK_STATUS",
+ 2: "ERROR_STATUS",
}
var Status_value = map[string]int32{
"UNDEFINED_STATUS": 0,
- "OK": 1,
- "ERROR": 2,
+ "OK_STATUS": 1,
+ "ERROR_STATUS": 2,
}
func (x Status) String() string {
@@ -60,17 +60,23 @@
Reason_LOGGING_ENDPOINT_ERROR Reason = 5
Reason_LOGGING_ENDPOINT_PROTOCOL_ERROR Reason = 6
Reason_KAFKA_ENDPOINT_ERROR Reason = 7
+ Reason_UNKNOWN_LOG_ENTITY Reason = 8
+ Reason_ERROR_FETCHING_CONFIG Reason = 9
+ Reason_INVALID_CONFIG Reason = 10
)
var Reason_name = map[int32]string{
- 0: "UNDEFINED_REASON",
- 1: "UNKNOWN_DEVICE",
- 2: "INTERNAL_ERROR",
- 3: "WRONG_METRIC",
- 4: "WRONG_EVENT",
- 5: "LOGGING_ENDPOINT_ERROR",
- 6: "LOGGING_ENDPOINT_PROTOCOL_ERROR",
- 7: "KAFKA_ENDPOINT_ERROR",
+ 0: "UNDEFINED_REASON",
+ 1: "UNKNOWN_DEVICE",
+ 2: "INTERNAL_ERROR",
+ 3: "WRONG_METRIC",
+ 4: "WRONG_EVENT",
+ 5: "LOGGING_ENDPOINT_ERROR",
+ 6: "LOGGING_ENDPOINT_PROTOCOL_ERROR",
+ 7: "KAFKA_ENDPOINT_ERROR",
+ 8: "UNKNOWN_LOG_ENTITY",
+ 9: "ERROR_FETCHING_CONFIG",
+ 10: "INVALID_CONFIG",
}
var Reason_value = map[string]int32{
@@ -82,6 +88,9 @@
"LOGGING_ENDPOINT_ERROR": 5,
"LOGGING_ENDPOINT_PROTOCOL_ERROR": 6,
"KAFKA_ENDPOINT_ERROR": 7,
+ "UNKNOWN_LOG_ENTITY": 8,
+ "ERROR_FETCHING_CONFIG": 9,
+ "INVALID_CONFIG": 10,
}
func (x Reason) String() string {
@@ -92,31 +101,73 @@
return fileDescriptor_74aedf0dda1205d8, []int{1}
}
+//Log Level
+type LogLevel int32
+
+const (
+ LogLevel_TRACE LogLevel = 0
+ LogLevel_DEBUG LogLevel = 1
+ LogLevel_INFO LogLevel = 2
+ LogLevel_WARN LogLevel = 3
+ LogLevel_ERROR LogLevel = 4
+)
+
+var LogLevel_name = map[int32]string{
+ 0: "TRACE",
+ 1: "DEBUG",
+ 2: "INFO",
+ 3: "WARN",
+ 4: "ERROR",
+}
+
+var LogLevel_value = map[string]int32{
+ "TRACE": 0,
+ "DEBUG": 1,
+ "INFO": 2,
+ "WARN": 3,
+ "ERROR": 4,
+}
+
+func (x LogLevel) String() string {
+ return proto.EnumName(LogLevel_name, int32(x))
+}
+
+func (LogLevel) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_74aedf0dda1205d8, []int{2}
+}
+
func init() {
proto.RegisterEnum("dmi.Status", Status_name, Status_value)
proto.RegisterEnum("dmi.Reason", Reason_name, Reason_value)
+ proto.RegisterEnum("dmi.LogLevel", LogLevel_name, LogLevel_value)
}
func init() { proto.RegisterFile("dmi/commons.proto", fileDescriptor_74aedf0dda1205d8) }
var fileDescriptor_74aedf0dda1205d8 = []byte{
- // 285 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xcd, 0x4e, 0xf2, 0x40,
- 0x18, 0x85, 0xf9, 0xf9, 0xe8, 0x17, 0x5f, 0x8d, 0x8e, 0x13, 0x62, 0x8c, 0x1b, 0x17, 0xee, 0x48,
- 0xa0, 0x31, 0xac, 0x8c, 0xab, 0x4a, 0x07, 0xd2, 0x14, 0xdf, 0x21, 0xd3, 0x01, 0x12, 0x37, 0x4d,
- 0x69, 0x47, 0x9c, 0xc5, 0xcc, 0x10, 0x3a, 0x70, 0x85, 0x5e, 0x98, 0x41, 0x71, 0xa1, 0x6e, 0x9f,
- 0x93, 0xe7, 0x9c, 0xe4, 0xc0, 0x65, 0x65, 0x74, 0x58, 0x3a, 0x63, 0x9c, 0xad, 0x07, 0x9b, 0xad,
- 0xf3, 0x8e, 0xb6, 0x2b, 0xa3, 0x7b, 0xf7, 0x10, 0x64, 0xbe, 0xf0, 0xbb, 0x9a, 0x76, 0x81, 0xcc,
- 0x31, 0x66, 0xe3, 0x04, 0x59, 0x9c, 0x67, 0x32, 0x92, 0xf3, 0x8c, 0x34, 0x68, 0x00, 0x2d, 0x9e,
- 0x92, 0x26, 0x3d, 0x81, 0x0e, 0x13, 0x82, 0x0b, 0xd2, 0xea, 0xbd, 0x37, 0x21, 0x10, 0xaa, 0xa8,
- 0x9d, 0xfd, 0xe9, 0x08, 0x16, 0x65, 0x1c, 0x49, 0x83, 0x52, 0x38, 0x9f, 0x63, 0x8a, 0x7c, 0x89,
- 0x79, 0xcc, 0x16, 0xc9, 0x88, 0x91, 0xe6, 0x81, 0x25, 0x28, 0x99, 0xc0, 0x68, 0x9a, 0x1f, 0x8b,
- 0x28, 0x81, 0xb3, 0xa5, 0xe0, 0x38, 0xc9, 0x9f, 0x99, 0x14, 0xc9, 0x88, 0xb4, 0xe9, 0x05, 0x9c,
- 0x7e, 0x11, 0xb6, 0x60, 0x28, 0xc9, 0x3f, 0x7a, 0x03, 0x57, 0x53, 0x3e, 0x99, 0x24, 0x07, 0x84,
- 0xf1, 0x8c, 0x27, 0x28, 0x8f, 0x7a, 0x87, 0xde, 0xc1, 0xed, 0x9f, 0x6c, 0x26, 0xb8, 0xe4, 0x23,
- 0xfe, 0xbd, 0x11, 0xd0, 0x6b, 0xe8, 0xa6, 0xd1, 0x38, 0x8d, 0x7e, 0xeb, 0xff, 0x9f, 0x1e, 0x5f,
- 0x1e, 0xd6, 0xda, 0xbf, 0xed, 0x56, 0x83, 0xd2, 0x99, 0xd0, 0x6d, 0x94, 0x2d, 0xdd, 0xb6, 0x0a,
- 0x2b, 0xb5, 0xd7, 0xa5, 0xea, 0x9b, 0xc2, 0x16, 0x6b, 0x65, 0x94, 0xf5, 0x7d, 0x6d, 0xbd, 0xda,
- 0xbe, 0x16, 0xa5, 0x0a, 0xf7, 0xc3, 0x70, 0xed, 0xc2, 0xca, 0xe8, 0x55, 0xf0, 0x79, 0xe1, 0xf0,
- 0x23, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x8a, 0xc7, 0x97, 0x57, 0x01, 0x00, 0x00,
+ // 373 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xcf, 0x6f, 0xd3, 0x30,
+ 0x14, 0xc7, 0xdb, 0xb4, 0x0b, 0xed, 0xe3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, 0xfc, 0x0c, 0x7f, 0x80,
+ 0xf7, 0xff, 0xf5, 0xee, 0xa4, 0x50, 0x22, 0x14, 0xd3, 0x1f, 0x3e, 0x7e, 0x03, 0xe7, 0x29, 0x89,
+ 0x53, 0xf2, 0xef, 0xf8, 0x13, 0x7c, 0x01, 0x78, 0xda, 0x32, 0x13, 0x4e, 0xa1, 0x98, 0xfa, 0x8a,
+ 0x56, 0xf8, 0x2d, 0xbc, 0x1e, 0x03, 0xc7, 0x54, 0x85, 0x9f, 0x9d, 0x3d, 0x14, 0x3c, 0x66, 0x09,
+ 0x5a, 0x8f, 0x21, 0xb6, 0x24, 0x63, 0xd1, 0xc4, 0x60, 0x73, 0x03, 0xab, 0xcc, 0xb6, 0x99, 0x3e,
+ 0xea, 0x9f, 0x78, 0x0d, 0x67, 0x4a, 0x92, 0x90, 0xa2, 0x99, 0x2b, 0x23, 0x7a, 0x5b, 0x24, 0x68,
+ 0x8e, 0x57, 0xb0, 0x64, 0x3c, 0x16, 0xc8, 0x73, 0xd5, 0x8e, 0x48, 0x8e, 0x16, 0xae, 0x3d, 0xee,
+ 0xb1, 0xbc, 0xfd, 0xf4, 0xed, 0x63, 0xdb, 0x0d, 0x3f, 0x1e, 0xef, 0xaf, 0x6a, 0x6b, 0x02, 0xfb,
+ 0xa0, 0xfb, 0xda, 0xee, 0x9b, 0xa0, 0xd1, 0xc7, 0xae, 0xd6, 0x97, 0xa6, 0xea, 0xab, 0x56, 0x1b,
+ 0xdd, 0x0f, 0x97, 0x5d, 0x3f, 0xe8, 0xfd, 0xf7, 0xaa, 0xd6, 0xc1, 0xf1, 0x3a, 0x68, 0x6d, 0xd0,
+ 0x98, 0xee, 0xde, 0x3f, 0x1d, 0xf6, 0xfa, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc8, 0xb6, 0xed,
+ 0xcf, 0xed, 0x01, 0x00, 0x00,
}
diff --git a/vendor/github.com/opencord/device-management-interface/go/dmi/hw_management_service.pb.go b/vendor/github.com/opencord/device-management-interface/go/dmi/hw_management_service.pb.go
index b50ff9b..dded8f3 100644
--- a/vendor/github.com/opencord/device-management-interface/go/dmi/hw_management_service.pb.go
+++ b/vendor/github.com/opencord/device-management-interface/go/dmi/hw_management_service.pb.go
@@ -776,6 +776,304 @@
return ""
}
+type EntitiesLogLevel struct {
+ LogLevel LogLevel `protobuf:"varint,1,opt,name=logLevel,proto3,enum=dmi.LogLevel" json:"logLevel,omitempty"`
+ Entities []string `protobuf:"bytes,2,rep,name=entities,proto3" json:"entities,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *EntitiesLogLevel) Reset() { *m = EntitiesLogLevel{} }
+func (m *EntitiesLogLevel) String() string { return proto.CompactTextString(m) }
+func (*EntitiesLogLevel) ProtoMessage() {}
+func (*EntitiesLogLevel) Descriptor() ([]byte, []int) {
+ return fileDescriptor_eae902e73066286d, []int{15}
+}
+
+func (m *EntitiesLogLevel) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_EntitiesLogLevel.Unmarshal(m, b)
+}
+func (m *EntitiesLogLevel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_EntitiesLogLevel.Marshal(b, m, deterministic)
+}
+func (m *EntitiesLogLevel) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EntitiesLogLevel.Merge(m, src)
+}
+func (m *EntitiesLogLevel) XXX_Size() int {
+ return xxx_messageInfo_EntitiesLogLevel.Size(m)
+}
+func (m *EntitiesLogLevel) XXX_DiscardUnknown() {
+ xxx_messageInfo_EntitiesLogLevel.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EntitiesLogLevel proto.InternalMessageInfo
+
+func (m *EntitiesLogLevel) GetLogLevel() LogLevel {
+ if m != nil {
+ return m.LogLevel
+ }
+ return LogLevel_TRACE
+}
+
+func (m *EntitiesLogLevel) GetEntities() []string {
+ if m != nil {
+ return m.Entities
+ }
+ return nil
+}
+
+type SetLogLevelRequest struct {
+ DeviceUuid *Uuid `protobuf:"bytes,1,opt,name=device_uuid,json=deviceUuid,proto3" json:"device_uuid,omitempty"`
+ Loglevels []*EntitiesLogLevel `protobuf:"bytes,2,rep,name=loglevels,proto3" json:"loglevels,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *SetLogLevelRequest) Reset() { *m = SetLogLevelRequest{} }
+func (m *SetLogLevelRequest) String() string { return proto.CompactTextString(m) }
+func (*SetLogLevelRequest) ProtoMessage() {}
+func (*SetLogLevelRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_eae902e73066286d, []int{16}
+}
+
+func (m *SetLogLevelRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_SetLogLevelRequest.Unmarshal(m, b)
+}
+func (m *SetLogLevelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_SetLogLevelRequest.Marshal(b, m, deterministic)
+}
+func (m *SetLogLevelRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_SetLogLevelRequest.Merge(m, src)
+}
+func (m *SetLogLevelRequest) XXX_Size() int {
+ return xxx_messageInfo_SetLogLevelRequest.Size(m)
+}
+func (m *SetLogLevelRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_SetLogLevelRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SetLogLevelRequest proto.InternalMessageInfo
+
+func (m *SetLogLevelRequest) GetDeviceUuid() *Uuid {
+ if m != nil {
+ return m.DeviceUuid
+ }
+ return nil
+}
+
+func (m *SetLogLevelRequest) GetLoglevels() []*EntitiesLogLevel {
+ if m != nil {
+ return m.Loglevels
+ }
+ return nil
+}
+
+type SetLogLevelResponse struct {
+ DeviceUuid *Uuid `protobuf:"bytes,1,opt,name=device_uuid,json=deviceUuid,proto3" json:"device_uuid,omitempty"`
+ Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=dmi.Status" json:"status,omitempty"`
+ Reason Reason `protobuf:"varint,3,opt,name=reason,proto3,enum=dmi.Reason" json:"reason,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *SetLogLevelResponse) Reset() { *m = SetLogLevelResponse{} }
+func (m *SetLogLevelResponse) String() string { return proto.CompactTextString(m) }
+func (*SetLogLevelResponse) ProtoMessage() {}
+func (*SetLogLevelResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_eae902e73066286d, []int{17}
+}
+
+func (m *SetLogLevelResponse) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_SetLogLevelResponse.Unmarshal(m, b)
+}
+func (m *SetLogLevelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_SetLogLevelResponse.Marshal(b, m, deterministic)
+}
+func (m *SetLogLevelResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_SetLogLevelResponse.Merge(m, src)
+}
+func (m *SetLogLevelResponse) XXX_Size() int {
+ return xxx_messageInfo_SetLogLevelResponse.Size(m)
+}
+func (m *SetLogLevelResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_SetLogLevelResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SetLogLevelResponse proto.InternalMessageInfo
+
+func (m *SetLogLevelResponse) GetDeviceUuid() *Uuid {
+ if m != nil {
+ return m.DeviceUuid
+ }
+ return nil
+}
+
+func (m *SetLogLevelResponse) GetStatus() Status {
+ if m != nil {
+ return m.Status
+ }
+ return Status_UNDEFINED_STATUS
+}
+
+func (m *SetLogLevelResponse) GetReason() Reason {
+ if m != nil {
+ return m.Reason
+ }
+ return Reason_UNDEFINED_REASON
+}
+
+type GetLogLevelRequest struct {
+ DeviceUuid *Uuid `protobuf:"bytes,1,opt,name=device_uuid,json=deviceUuid,proto3" json:"device_uuid,omitempty"`
+ Entities []string `protobuf:"bytes,2,rep,name=entities,proto3" json:"entities,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *GetLogLevelRequest) Reset() { *m = GetLogLevelRequest{} }
+func (m *GetLogLevelRequest) String() string { return proto.CompactTextString(m) }
+func (*GetLogLevelRequest) ProtoMessage() {}
+func (*GetLogLevelRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_eae902e73066286d, []int{18}
+}
+
+func (m *GetLogLevelRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_GetLogLevelRequest.Unmarshal(m, b)
+}
+func (m *GetLogLevelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_GetLogLevelRequest.Marshal(b, m, deterministic)
+}
+func (m *GetLogLevelRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_GetLogLevelRequest.Merge(m, src)
+}
+func (m *GetLogLevelRequest) XXX_Size() int {
+ return xxx_messageInfo_GetLogLevelRequest.Size(m)
+}
+func (m *GetLogLevelRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_GetLogLevelRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_GetLogLevelRequest proto.InternalMessageInfo
+
+func (m *GetLogLevelRequest) GetDeviceUuid() *Uuid {
+ if m != nil {
+ return m.DeviceUuid
+ }
+ return nil
+}
+
+func (m *GetLogLevelRequest) GetEntities() []string {
+ if m != nil {
+ return m.Entities
+ }
+ return nil
+}
+
+type GetLogLevelResponse struct {
+ DeviceUuid *Uuid `protobuf:"bytes,1,opt,name=device_uuid,json=deviceUuid,proto3" json:"device_uuid,omitempty"`
+ LogLevels []*EntitiesLogLevel `protobuf:"bytes,2,rep,name=logLevels,proto3" json:"logLevels,omitempty"`
+ Status Status `protobuf:"varint,3,opt,name=status,proto3,enum=dmi.Status" json:"status,omitempty"`
+ Reason Reason `protobuf:"varint,4,opt,name=reason,proto3,enum=dmi.Reason" json:"reason,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *GetLogLevelResponse) Reset() { *m = GetLogLevelResponse{} }
+func (m *GetLogLevelResponse) String() string { return proto.CompactTextString(m) }
+func (*GetLogLevelResponse) ProtoMessage() {}
+func (*GetLogLevelResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_eae902e73066286d, []int{19}
+}
+
+func (m *GetLogLevelResponse) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_GetLogLevelResponse.Unmarshal(m, b)
+}
+func (m *GetLogLevelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_GetLogLevelResponse.Marshal(b, m, deterministic)
+}
+func (m *GetLogLevelResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_GetLogLevelResponse.Merge(m, src)
+}
+func (m *GetLogLevelResponse) XXX_Size() int {
+ return xxx_messageInfo_GetLogLevelResponse.Size(m)
+}
+func (m *GetLogLevelResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_GetLogLevelResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_GetLogLevelResponse proto.InternalMessageInfo
+
+func (m *GetLogLevelResponse) GetDeviceUuid() *Uuid {
+ if m != nil {
+ return m.DeviceUuid
+ }
+ return nil
+}
+
+func (m *GetLogLevelResponse) GetLogLevels() []*EntitiesLogLevel {
+ if m != nil {
+ return m.LogLevels
+ }
+ return nil
+}
+
+func (m *GetLogLevelResponse) GetStatus() Status {
+ if m != nil {
+ return m.Status
+ }
+ return Status_UNDEFINED_STATUS
+}
+
+func (m *GetLogLevelResponse) GetReason() Reason {
+ if m != nil {
+ return m.Reason
+ }
+ return Reason_UNDEFINED_REASON
+}
+
+type GetLoggableEntitiesRequest struct {
+ DeviceUuid *Uuid `protobuf:"bytes,1,opt,name=device_uuid,json=deviceUuid,proto3" json:"device_uuid,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *GetLoggableEntitiesRequest) Reset() { *m = GetLoggableEntitiesRequest{} }
+func (m *GetLoggableEntitiesRequest) String() string { return proto.CompactTextString(m) }
+func (*GetLoggableEntitiesRequest) ProtoMessage() {}
+func (*GetLoggableEntitiesRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_eae902e73066286d, []int{20}
+}
+
+func (m *GetLoggableEntitiesRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_GetLoggableEntitiesRequest.Unmarshal(m, b)
+}
+func (m *GetLoggableEntitiesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_GetLoggableEntitiesRequest.Marshal(b, m, deterministic)
+}
+func (m *GetLoggableEntitiesRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_GetLoggableEntitiesRequest.Merge(m, src)
+}
+func (m *GetLoggableEntitiesRequest) XXX_Size() int {
+ return xxx_messageInfo_GetLoggableEntitiesRequest.Size(m)
+}
+func (m *GetLoggableEntitiesRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_GetLoggableEntitiesRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_GetLoggableEntitiesRequest proto.InternalMessageInfo
+
+func (m *GetLoggableEntitiesRequest) GetDeviceUuid() *Uuid {
+ if m != nil {
+ return m.DeviceUuid
+ }
+ return nil
+}
+
func init() {
proto.RegisterType((*PhysicalInventoryRequest)(nil), "dmi.PhysicalInventoryRequest")
proto.RegisterType((*PhysicalInventoryResponse)(nil), "dmi.PhysicalInventoryResponse")
@@ -792,62 +1090,80 @@
proto.RegisterType((*GetLoggingEndpointResponse)(nil), "dmi.GetLoggingEndpointResponse")
proto.RegisterType((*SetMsgBusEndpointRequest)(nil), "dmi.SetMsgBusEndpointRequest")
proto.RegisterType((*GetMsgBusEndpointResponse)(nil), "dmi.GetMsgBusEndpointResponse")
+ proto.RegisterType((*EntitiesLogLevel)(nil), "dmi.EntitiesLogLevel")
+ proto.RegisterType((*SetLogLevelRequest)(nil), "dmi.SetLogLevelRequest")
+ proto.RegisterType((*SetLogLevelResponse)(nil), "dmi.SetLogLevelResponse")
+ proto.RegisterType((*GetLogLevelRequest)(nil), "dmi.GetLogLevelRequest")
+ proto.RegisterType((*GetLogLevelResponse)(nil), "dmi.GetLogLevelResponse")
+ proto.RegisterType((*GetLoggableEntitiesRequest)(nil), "dmi.GetLoggableEntitiesRequest")
}
func init() { proto.RegisterFile("dmi/hw_management_service.proto", fileDescriptor_eae902e73066286d) }
var fileDescriptor_eae902e73066286d = []byte{
- // 797 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcf, 0x4e, 0xdb, 0x4e,
- 0x10, 0x96, 0x09, 0x02, 0x65, 0xf8, 0x11, 0x7e, 0xb8, 0x15, 0x4a, 0x8c, 0x0a, 0xc8, 0x55, 0xd5,
- 0xbf, 0xc4, 0x28, 0x9c, 0xaa, 0x5e, 0x2a, 0x28, 0x4d, 0x50, 0x09, 0x42, 0x76, 0x51, 0xa4, 0x5e,
- 0x22, 0xc7, 0x9e, 0x38, 0x2b, 0xc5, 0xbb, 0xa9, 0xbd, 0x0e, 0xe2, 0x25, 0x7a, 0x68, 0x7b, 0xad,
- 0xd4, 0x07, 0xe9, 0x5b, 0xb4, 0x0f, 0x54, 0x79, 0xd7, 0x4e, 0x42, 0x62, 0x03, 0x42, 0x41, 0xea,
- 0xcd, 0xde, 0xf9, 0xf6, 0x9b, 0x99, 0x6f, 0x77, 0x66, 0x07, 0xb6, 0x5d, 0x9f, 0x18, 0xbd, 0x8b,
- 0xb6, 0x6f, 0x53, 0xdb, 0x43, 0x1f, 0x29, 0x6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 0x66, 0x70, 0xca, 0x19, 0x7a, 0x4b, 0x0c, 0xbd, 0x2a, 0x86, 0x12, 0x1f, 0x9e,
+ 0x7d, 0xf5, 0xfd, 0x97, 0x3e, 0x15, 0x97, 0xf1, 0xb0, 0x3d, 0xe2, 0x61, 0x87, 0x4f, 0x90, 0x8d,
+ 0xf8, 0xd4, 0xeb, 0xa8, 0x9e, 0xf2, 0x64, 0xfe, 0x2f, 0xf7, 0x09, 0x65, 0x02, 0xa7, 0x63, 0x77,
+ 0x84, 0x9d, 0xd9, 0x51, 0xc7, 0xe7, 0x1d, 0x2f, 0xa4, 0xc3, 0x3b, 0x52, 0xc2, 0xa3, 0x7f, 0x03,
+ 0x00, 0x00, 0xff, 0xff, 0x3a, 0x27, 0xf3, 0x9c, 0x15, 0x0f, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -885,11 +1201,22 @@
// Sets the location to which logs need to be shipped
SetLoggingEndpoint(ctx context.Context, in *SetLoggingEndpointRequest, opts ...grpc.CallOption) (*SetRemoteEndpointResponse, error)
// Gets the configured location to which the logs are being shipped
- GetLoggingEndpoint(ctx context.Context, in *Uuid, opts ...grpc.CallOption) (*GetLoggingEndpointResponse, error)
+ GetLoggingEndpoint(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (*GetLoggingEndpointResponse, error)
// Sets the location of the Message Bus to which events and metrics are shipped
SetMsgBusEndpoint(ctx context.Context, in *SetMsgBusEndpointRequest, opts ...grpc.CallOption) (*SetRemoteEndpointResponse, error)
// Gets the configured location to which the events and metrics are being shipped
GetMsgBusEndpoint(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetMsgBusEndpointResponse, error)
+ // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
+ // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
+ // interface, package etc.
+ GetLoggableEntities(ctx context.Context, in *GetLoggableEntitiesRequest, opts ...grpc.CallOption) (*GetLogLevelResponse, error)
+ // Sets the log level of the device, for each given entity to a certain level.
+ // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
+ // no entity in the list it's assumed that the caller wants to set that level for all the entities.
+ SetLogLevel(ctx context.Context, in *SetLogLevelRequest, opts ...grpc.CallOption) (*SetLogLevelResponse, error)
+ // Gets the configured log level for a certain entity on a certain device.
+ // If no entity is specified in the request all the entities with their log level should be returned.
+ GetLogLevel(ctx context.Context, in *GetLogLevelRequest, opts ...grpc.CallOption) (*GetLogLevelResponse, error)
}
type nativeHWManagementServiceClient struct {
@@ -1032,7 +1359,7 @@
return out, nil
}
-func (c *nativeHWManagementServiceClient) GetLoggingEndpoint(ctx context.Context, in *Uuid, opts ...grpc.CallOption) (*GetLoggingEndpointResponse, error) {
+func (c *nativeHWManagementServiceClient) GetLoggingEndpoint(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (*GetLoggingEndpointResponse, error) {
out := new(GetLoggingEndpointResponse)
err := c.cc.Invoke(ctx, "/dmi.NativeHWManagementService/GetLoggingEndpoint", in, out, opts...)
if err != nil {
@@ -1059,6 +1386,33 @@
return out, nil
}
+func (c *nativeHWManagementServiceClient) GetLoggableEntities(ctx context.Context, in *GetLoggableEntitiesRequest, opts ...grpc.CallOption) (*GetLogLevelResponse, error) {
+ out := new(GetLogLevelResponse)
+ err := c.cc.Invoke(ctx, "/dmi.NativeHWManagementService/GetLoggableEntities", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *nativeHWManagementServiceClient) SetLogLevel(ctx context.Context, in *SetLogLevelRequest, opts ...grpc.CallOption) (*SetLogLevelResponse, error) {
+ out := new(SetLogLevelResponse)
+ err := c.cc.Invoke(ctx, "/dmi.NativeHWManagementService/SetLogLevel", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *nativeHWManagementServiceClient) GetLogLevel(ctx context.Context, in *GetLogLevelRequest, opts ...grpc.CallOption) (*GetLogLevelResponse, error) {
+ out := new(GetLogLevelResponse)
+ err := c.cc.Invoke(ctx, "/dmi.NativeHWManagementService/GetLogLevel", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
// NativeHWManagementServiceServer is the server API for NativeHWManagementService service.
type NativeHWManagementServiceServer interface {
// Initializes context for a device and sets up required states
@@ -1084,11 +1438,22 @@
// Sets the location to which logs need to be shipped
SetLoggingEndpoint(context.Context, *SetLoggingEndpointRequest) (*SetRemoteEndpointResponse, error)
// Gets the configured location to which the logs are being shipped
- GetLoggingEndpoint(context.Context, *Uuid) (*GetLoggingEndpointResponse, error)
+ GetLoggingEndpoint(context.Context, *HardwareID) (*GetLoggingEndpointResponse, error)
// Sets the location of the Message Bus to which events and metrics are shipped
SetMsgBusEndpoint(context.Context, *SetMsgBusEndpointRequest) (*SetRemoteEndpointResponse, error)
// Gets the configured location to which the events and metrics are being shipped
GetMsgBusEndpoint(context.Context, *empty.Empty) (*GetMsgBusEndpointResponse, error)
+ // Gets the entities of a device on which log can be configured. A few are expected, like OS, PON Management etc.
+ // In general an entity is any item within an hardware system that can emit logs, e.g. service, process, subsystem,
+ // interface, package etc.
+ GetLoggableEntities(context.Context, *GetLoggableEntitiesRequest) (*GetLogLevelResponse, error)
+ // Sets the log level of the device, for each given entity to a certain level.
+ // If only one EntitiesLogLevel is provided for the device and that request contains only a log level with
+ // no entity in the list it's assumed that the caller wants to set that level for all the entities.
+ SetLogLevel(context.Context, *SetLogLevelRequest) (*SetLogLevelResponse, error)
+ // Gets the configured log level for a certain entity on a certain device.
+ // If no entity is specified in the request all the entities with their log level should be returned.
+ GetLogLevel(context.Context, *GetLogLevelRequest) (*GetLogLevelResponse, error)
}
func RegisterNativeHWManagementServiceServer(s *grpc.Server, srv NativeHWManagementServiceServer) {
@@ -1231,7 +1596,7 @@
}
func _NativeHWManagementService_GetLoggingEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(Uuid)
+ in := new(HardwareID)
if err := dec(in); err != nil {
return nil, err
}
@@ -1243,7 +1608,7 @@
FullMethod: "/dmi.NativeHWManagementService/GetLoggingEndpoint",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(NativeHWManagementServiceServer).GetLoggingEndpoint(ctx, req.(*Uuid))
+ return srv.(NativeHWManagementServiceServer).GetLoggingEndpoint(ctx, req.(*HardwareID))
}
return interceptor(ctx, in, info, handler)
}
@@ -1284,6 +1649,60 @@
return interceptor(ctx, in, info, handler)
}
+func _NativeHWManagementService_GetLoggableEntities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetLoggableEntitiesRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(NativeHWManagementServiceServer).GetLoggableEntities(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/dmi.NativeHWManagementService/GetLoggableEntities",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(NativeHWManagementServiceServer).GetLoggableEntities(ctx, req.(*GetLoggableEntitiesRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _NativeHWManagementService_SetLogLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(SetLogLevelRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(NativeHWManagementServiceServer).SetLogLevel(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/dmi.NativeHWManagementService/SetLogLevel",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(NativeHWManagementServiceServer).SetLogLevel(ctx, req.(*SetLogLevelRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _NativeHWManagementService_GetLogLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetLogLevelRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(NativeHWManagementServiceServer).GetLogLevel(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/dmi.NativeHWManagementService/GetLogLevel",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(NativeHWManagementServiceServer).GetLogLevel(ctx, req.(*GetLogLevelRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
var _NativeHWManagementService_serviceDesc = grpc.ServiceDesc{
ServiceName: "dmi.NativeHWManagementService",
HandlerType: (*NativeHWManagementServiceServer)(nil),
@@ -1316,6 +1735,18 @@
MethodName: "GetMsgBusEndpoint",
Handler: _NativeHWManagementService_GetMsgBusEndpoint_Handler,
},
+ {
+ MethodName: "GetLoggableEntities",
+ Handler: _NativeHWManagementService_GetLoggableEntities_Handler,
+ },
+ {
+ MethodName: "SetLogLevel",
+ Handler: _NativeHWManagementService_SetLogLevel_Handler,
+ },
+ {
+ MethodName: "GetLogLevel",
+ Handler: _NativeHWManagementService_GetLogLevel_Handler,
+ },
},
Streams: []grpc.StreamDesc{
{
diff --git a/vendor/github.com/opencord/device-management-interface/go/dmi/sw_management_service.pb.go b/vendor/github.com/opencord/device-management-interface/go/dmi/sw_management_service.pb.go
index f3ef3e6..c3c2718 100644
--- a/vendor/github.com/opencord/device-management-interface/go/dmi/sw_management_service.pb.go
+++ b/vendor/github.com/opencord/device-management-interface/go/dmi/sw_management_service.pb.go
@@ -171,45 +171,148 @@
return nil
}
+type ConfigRequest struct {
+ DeviceUuid *Uuid `protobuf:"bytes,1,opt,name=device_uuid,json=deviceUuid,proto3" json:"device_uuid,omitempty"`
+ // Location of the configuration file, authentication (user/pass) if any should be in the url string
+ // The config_url would contain the protocol, credentials, the IP address/DNS of the server and the path of the file
+ // e.g. sftp://download_user:download_pass@192.168.0.1:22/OLT-configs/config-v1.2.3.xml
+ ConfigUrl string `protobuf:"bytes,2,opt,name=config_url,json=configUrl,proto3" json:"config_url,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ConfigRequest) Reset() { *m = ConfigRequest{} }
+func (m *ConfigRequest) String() string { return proto.CompactTextString(m) }
+func (*ConfigRequest) ProtoMessage() {}
+func (*ConfigRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_000929e4bec891d7, []int{3}
+}
+
+func (m *ConfigRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ConfigRequest.Unmarshal(m, b)
+}
+func (m *ConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ConfigRequest.Marshal(b, m, deterministic)
+}
+func (m *ConfigRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ConfigRequest.Merge(m, src)
+}
+func (m *ConfigRequest) XXX_Size() int {
+ return xxx_messageInfo_ConfigRequest.Size(m)
+}
+func (m *ConfigRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_ConfigRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ConfigRequest proto.InternalMessageInfo
+
+func (m *ConfigRequest) GetDeviceUuid() *Uuid {
+ if m != nil {
+ return m.DeviceUuid
+ }
+ return nil
+}
+
+func (m *ConfigRequest) GetConfigUrl() string {
+ if m != nil {
+ return m.ConfigUrl
+ }
+ return ""
+}
+
+type ConfigResponse struct {
+ Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=dmi.Status" json:"status,omitempty"`
+ Reason Reason `protobuf:"varint,2,opt,name=reason,proto3,enum=dmi.Reason" json:"reason,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ConfigResponse) Reset() { *m = ConfigResponse{} }
+func (m *ConfigResponse) String() string { return proto.CompactTextString(m) }
+func (*ConfigResponse) ProtoMessage() {}
+func (*ConfigResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_000929e4bec891d7, []int{4}
+}
+
+func (m *ConfigResponse) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ConfigResponse.Unmarshal(m, b)
+}
+func (m *ConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ConfigResponse.Marshal(b, m, deterministic)
+}
+func (m *ConfigResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ConfigResponse.Merge(m, src)
+}
+func (m *ConfigResponse) XXX_Size() int {
+ return xxx_messageInfo_ConfigResponse.Size(m)
+}
+func (m *ConfigResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_ConfigResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ConfigResponse proto.InternalMessageInfo
+
+func (m *ConfigResponse) GetStatus() Status {
+ if m != nil {
+ return m.Status
+ }
+ return Status_UNDEFINED_STATUS
+}
+
+func (m *ConfigResponse) GetReason() Reason {
+ if m != nil {
+ return m.Reason
+ }
+ return Reason_UNDEFINED_REASON
+}
+
func init() {
proto.RegisterType((*SoftwareVersionInformation)(nil), "dmi.SoftwareVersionInformation")
proto.RegisterType((*GetSoftwareVersionInformationResponse)(nil), "dmi.GetSoftwareVersionInformationResponse")
proto.RegisterType((*DownloadImageRequest)(nil), "dmi.DownloadImageRequest")
+ proto.RegisterType((*ConfigRequest)(nil), "dmi.ConfigRequest")
+ proto.RegisterType((*ConfigResponse)(nil), "dmi.ConfigResponse")
}
func init() { proto.RegisterFile("dmi/sw_management_service.proto", fileDescriptor_000929e4bec891d7) }
var fileDescriptor_000929e4bec891d7 = []byte{
- // 458 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c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af, 0x21, 0x9c, 0xe5, 0x04,
+ 0x1b, 0x8b, 0x28, 0x53, 0xe4, 0x7e, 0x25, 0x85, 0xf2, 0x3f, 0x27, 0x72, 0x8c, 0x1d, 0x0b, 0x84,
+ 0x0f, 0x76, 0x30, 0x7f, 0xf3, 0xf3, 0xe0, 0xf5, 0xe5, 0xfc, 0x59, 0xc6, 0xcc, 0x4d, 0xb1, 0x18,
+ 0xa6, 0x92, 0x47, 0x32, 0xa7, 0x22, 0x95, 0x8a, 0x44, 0xde, 0x0f, 0x67, 0xdb, 0x77, 0xe5, 0x8c,
+ 0x09, 0x43, 0xd5, 0x12, 0xa7, 0x34, 0x2a, 0xc7, 0x51, 0x26, 0x23, 0xc2, 0xd9, 0xe2, 0xc0, 0x3d,
+ 0x15, 0xe3, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xd0, 0x0a, 0x81, 0x87, 0x04, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -235,6 +338,8 @@
// Marks the image in the Standby as Active and reboots the device, so that it boots from that image which was in the standby.
// This API is to be used if operator wants to go back to the previous software
RevertToStandbyImage(ctx context.Context, in *HardwareID, opts ...grpc.CallOption) (NativeSoftwareManagementService_RevertToStandbyImageClient, error)
+ // This API can be used to let the devices pickup their properitary configuration which they need at startup.
+ UpdateStartupConfiguration(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (NativeSoftwareManagementService_UpdateStartupConfigurationClient, error)
}
type nativeSoftwareManagementServiceClient struct {
@@ -350,6 +455,38 @@
return m, nil
}
+func (c *nativeSoftwareManagementServiceClient) UpdateStartupConfiguration(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (NativeSoftwareManagementService_UpdateStartupConfigurationClient, error) {
+ stream, err := c.cc.NewStream(ctx, &_NativeSoftwareManagementService_serviceDesc.Streams[3], "/dmi.NativeSoftwareManagementService/UpdateStartupConfiguration", opts...)
+ if err != nil {
+ return nil, err
+ }
+ x := &nativeSoftwareManagementServiceUpdateStartupConfigurationClient{stream}
+ if err := x.ClientStream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err := x.ClientStream.CloseSend(); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type NativeSoftwareManagementService_UpdateStartupConfigurationClient interface {
+ Recv() (*ConfigResponse, error)
+ grpc.ClientStream
+}
+
+type nativeSoftwareManagementServiceUpdateStartupConfigurationClient struct {
+ grpc.ClientStream
+}
+
+func (x *nativeSoftwareManagementServiceUpdateStartupConfigurationClient) Recv() (*ConfigResponse, error) {
+ m := new(ConfigResponse)
+ if err := x.ClientStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
// NativeSoftwareManagementServiceServer is the server API for NativeSoftwareManagementService service.
type NativeSoftwareManagementServiceServer interface {
// Get the software version information of the Active and Standby images
@@ -363,6 +500,8 @@
// Marks the image in the Standby as Active and reboots the device, so that it boots from that image which was in the standby.
// This API is to be used if operator wants to go back to the previous software
RevertToStandbyImage(*HardwareID, NativeSoftwareManagementService_RevertToStandbyImageServer) error
+ // This API can be used to let the devices pickup their properitary configuration which they need at startup.
+ UpdateStartupConfiguration(*ConfigRequest, NativeSoftwareManagementService_UpdateStartupConfigurationServer) error
}
func RegisterNativeSoftwareManagementServiceServer(s *grpc.Server, srv NativeSoftwareManagementServiceServer) {
@@ -450,6 +589,27 @@
return x.ServerStream.SendMsg(m)
}
+func _NativeSoftwareManagementService_UpdateStartupConfiguration_Handler(srv interface{}, stream grpc.ServerStream) error {
+ m := new(ConfigRequest)
+ if err := stream.RecvMsg(m); err != nil {
+ return err
+ }
+ return srv.(NativeSoftwareManagementServiceServer).UpdateStartupConfiguration(m, &nativeSoftwareManagementServiceUpdateStartupConfigurationServer{stream})
+}
+
+type NativeSoftwareManagementService_UpdateStartupConfigurationServer interface {
+ Send(*ConfigResponse) error
+ grpc.ServerStream
+}
+
+type nativeSoftwareManagementServiceUpdateStartupConfigurationServer struct {
+ grpc.ServerStream
+}
+
+func (x *nativeSoftwareManagementServiceUpdateStartupConfigurationServer) Send(m *ConfigResponse) error {
+ return x.ServerStream.SendMsg(m)
+}
+
var _NativeSoftwareManagementService_serviceDesc = grpc.ServiceDesc{
ServiceName: "dmi.NativeSoftwareManagementService",
HandlerType: (*NativeSoftwareManagementServiceServer)(nil),
@@ -475,6 +635,11 @@
Handler: _NativeSoftwareManagementService_RevertToStandbyImage_Handler,
ServerStreams: true,
},
+ {
+ StreamName: "UpdateStartupConfiguration",
+ Handler: _NativeSoftwareManagementService_UpdateStartupConfiguration_Handler,
+ ServerStreams: true,
+ },
},
Metadata: "dmi/sw_management_service.proto",
}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 4e63d72..2986d80 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -75,7 +75,7 @@
github.com/olekukonko/tablewriter
# github.com/opencord/cordctl v0.0.0-20190909161711-01e9c1f04bf4
github.com/opencord/cordctl/pkg/format
-# github.com/opencord/device-management-interface v0.9.1-0.20200930105820-188a84f483b3
+# github.com/opencord/device-management-interface v0.9.5
github.com/opencord/device-management-interface/go/dmi
# github.com/opencord/omci-sim v0.0.5
github.com/opencord/omci-sim