Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 1 | syntax = "proto3";
|
| 2 |
|
| 3 | option go_package = "github.com/opencord/device-management-interface/v3/go/dmi";
|
| 4 | package dmi;
|
| 5 |
|
| 6 | import "dmi/commons.proto";
|
| 7 | import "dmi/hw.proto";
|
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 8 | import "google/protobuf/empty.proto";
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 9 |
|
| 10 | // The model used to represent the event data on the SensorData of a component as described
|
| 11 | // in RFC8348 (https://tools.ietf.org/html/rfc8348)
|
| 12 |
|
| 13 | // Management of Metrics and protos for encoding of Metrics
|
| 14 |
|
| 15 | enum MetricNames {
|
| 16 | METRIC_NAME_UNDEFINED = 0;
|
| 17 |
|
| 18 | // FAN related metrics
|
| 19 | METRIC_FAN_SPEED = 1;
|
| 20 |
|
| 21 | // CPU related metrics
|
| 22 | METRIC_CPU_TEMP = 100;
|
| 23 | METRIC_CPU_USAGE_PERCENTAGE = 101;
|
| 24 |
|
| 25 | // Transceiver related metrics
|
| 26 | METRIC_TRANSCEIVER_TEMP = 200;
|
| 27 | METRIC_TRANSCEIVER_VOLTAGE = 201;
|
| 28 | METRIC_TRANSCEIVER_BIAS = 202;
|
| 29 | METRIC_TRANSCEIVER_RX_POWER = 203;
|
| 30 | METRIC_TRANSCEIVER_TX_POWER = 204;
|
| 31 | METRIC_TRANSCEIVER_WAVELENGTH = 205;
|
| 32 |
|
| 33 | // Disk related metrics
|
| 34 | METRIC_DISK_TEMP = 300;
|
| 35 | METRIC_DISK_CAPACITY = 301;
|
| 36 | METRIC_DISK_USAGE = 302;
|
| 37 | METRIC_DISK_USAGE_PERCENTAGE = 303;
|
| 38 | METRIC_DISK_READ_WRITE_PERCENTAGE = 304;
|
| 39 | METRIC_DISK_FAULTY_CELLS_PERCENTAGE = 305;
|
| 40 |
|
| 41 | // RAM related metrics
|
| 42 | METRIC_RAM_TEMP = 400;
|
| 43 | METRIC_RAM_CAPACITY = 401;
|
| 44 | METRIC_RAM_USAGE = 402;
|
| 45 | METRIC_RAM_USAGE_PERCENTAGE = 403;
|
| 46 |
|
| 47 | // Power related metrics
|
| 48 | METRIC_POWER_MAX = 500;
|
| 49 | METRIC_POWER_USAGE = 501;
|
| 50 | METRIC_POWER_USAGE_PERCENTAGE = 502;
|
| 51 |
|
| 52 | // Chassis related metrics
|
| 53 | METRIC_INNER_SURROUNDING_TEMP = 600;
|
| 54 | }
|
| 55 |
|
| 56 | message MetricConfig {
|
| 57 | MetricNames metric_id = 1;
|
| 58 | // Whether the device manager is collecting and reporting this metric or not
|
| 59 | bool is_configured = 2;
|
| 60 | // Number of seconds between two consecutive polls of the particular metric
|
| 61 | // Each device manager implemenation could have it's per metric default poll frequency which
|
| 62 | // can be requested to be changed using this value
|
| 63 | uint32 poll_interval = 3;
|
| 64 | }
|
| 65 |
|
| 66 | message MetricsConfig {
|
| 67 | repeated MetricConfig metrics = 1;
|
| 68 | }
|
| 69 |
|
| 70 | message ListMetricsResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 71 | enum Reason {
|
| 72 | UNDEFINED_REASON = 0;
|
| 73 | UNKNOWN_DEVICE = 1;
|
| 74 | INTERNAL_ERROR = 2;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 75 | DEVICE_UNREACHABLE = 3;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 76 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 77 | Status status = 1;
|
| 78 | Reason reason = 2;
|
| 79 | MetricsConfig metrics = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 80 | string reason_detail = 4;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 81 | }
|
| 82 |
|
| 83 | message MetricsConfigurationRequest {
|
| 84 | Uuid device_uuid = 1;
|
| 85 | oneof operation {
|
| 86 | MetricsConfig changes = 2;
|
| 87 | bool reset_to_default = 3;
|
| 88 | }
|
| 89 | }
|
| 90 |
|
| 91 | message MetricsConfigurationResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 92 | enum Reason {
|
| 93 | UNDEFINED_REASON = 0;
|
| 94 | UNKNOWN_DEVICE = 1;
|
| 95 | INTERNAL_ERROR = 2;
|
| 96 | POLL_INTERVAL_UNSUPPORTED = 3;
|
| 97 | INVALID_METRIC = 4;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 98 | DEVICE_UNREACHABLE = 5;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 99 | }
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 100 | Status status = 1;
|
| 101 | Reason reason = 2;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 102 | string reason_detail = 3;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 103 | }
|
| 104 |
|
| 105 | message MetricMetaData {
|
| 106 | Uuid device_uuid = 1;
|
| 107 | // uuid of the component
|
| 108 | Uuid component_uuid = 2;
|
| 109 | string component_name = 3;
|
| 110 | }
|
| 111 |
|
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 112 | // The Metrics are conveyed to external systems either by submitting them on a message bus or using gRPC server streaming.
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 113 | // The topic to which are Metrics are submitted would be configured as startup
|
| 114 | // configuration of the components
|
| 115 | message Metric {
|
| 116 | MetricNames metric_id = 1;
|
| 117 | MetricMetaData metric_metadata = 2;
|
| 118 | ComponentSensorData value = 3;
|
| 119 | }
|
| 120 |
|
| 121 | message GetMetricRequest {
|
| 122 | MetricMetaData meta_data = 1;
|
| 123 | MetricNames metric_id = 2;
|
| 124 | }
|
| 125 |
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 126 | message GetMetricResponse {
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 127 | enum Reason {
|
| 128 | UNDEFINED_REASON = 0;
|
| 129 | UNKNOWN_DEVICE = 1;
|
| 130 | UNKNOWN_COMPONENT = 2;
|
| 131 | INTERNAL_ERROR = 3;
|
| 132 | INVALID_METRIC = 4;
|
amit.ghosh | bd2022e | 2021-02-22 05:58:53 +0100 | [diff] [blame] | 133 | DEVICE_UNREACHABLE = 5;
|
amit.ghosh | ae47303 | 2021-01-10 11:59:10 +0100 | [diff] [blame] | 134 | }
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 135 | Status status = 1;
|
| 136 | Reason reason = 2;
|
| 137 | Metric metric = 3;
|
amit.ghosh | 8ab1e6e | 2021-02-23 07:40:17 +0100 | [diff] [blame] | 138 | string reason_detail = 4;
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 139 | }
|
| 140 |
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 141 | service NativeMetricsManagementService {
|
| 142 |
|
| 143 | // List the supported metrics for the passed device.
|
| 144 | // This would be the first call that you make to know about the metrics that a particular device supports and
|
| 145 | // then use the UpdateMetricsConfiguration API to monitor only the required metrics.
|
| 146 | rpc ListMetrics(HardwareID) returns(ListMetricsResponse);
|
| 147 |
|
| 148 | // Updates the configuration of the list of metrics in the request
|
| 149 | // Acts upon single metric configuration, collection of a single metric can be started/stopped
|
| 150 | // by changing its configuration.
|
| 151 | //
|
| 152 | // This configuration is persisted across restart of the device or the device manager
|
| 153 | rpc UpdateMetricsConfiguration(MetricsConfigurationRequest) returns(MetricsConfigurationResponse);
|
| 154 |
|
| 155 | // Get the instantenous value of a metric
|
aghosh | c301dcd | 2020-09-03 16:55:34 +0100 | [diff] [blame] | 156 | rpc GetMetric(GetMetricRequest) returns(GetMetricResponse);
|
Chandrakanth Nalkudre Gowda | 68590a4 | 2021-04-22 15:19:21 +0530 | [diff] [blame] | 157 |
|
| 158 | // Initiate the server streaming of the metrics
|
| 159 | rpc StreamMetrics(google.protobuf.Empty) returns(stream Metric);
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 160 | }
|