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