blob: 103df4606f8ec54426e8158283d7124873f694f2 [file] [log] [blame]
Amit Ghosh09f28362020-06-12 21:52:19 +01001syntax = "proto3";
2
3option go_package = "github.com/opencord/device-management-interface/v3/go/dmi";
4package dmi;
5
6import "dmi/commons.proto";
7import "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
14enum 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
55message 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
65message MetricsConfig {
66 repeated MetricConfig metrics = 1;
67}
68
69message ListMetricsResponse {
amit.ghoshae473032021-01-10 11:59:10 +010070 enum Reason {
71 UNDEFINED_REASON = 0;
72 UNKNOWN_DEVICE = 1;
73 INTERNAL_ERROR = 2;
amit.ghoshbd2022e2021-02-22 05:58:53 +010074 DEVICE_UNREACHABLE = 3;
amit.ghoshae473032021-01-10 11:59:10 +010075 }
Amit Ghosh09f28362020-06-12 21:52:19 +010076 Status status = 1;
77 Reason reason = 2;
78 MetricsConfig metrics = 3;
79}
80
81message MetricsConfigurationRequest {
82 Uuid device_uuid = 1;
83 oneof operation {
84 MetricsConfig changes = 2;
85 bool reset_to_default = 3;
86 }
87}
88
89message MetricsConfigurationResponse {
amit.ghoshae473032021-01-10 11:59:10 +010090 enum Reason {
91 UNDEFINED_REASON = 0;
92 UNKNOWN_DEVICE = 1;
93 INTERNAL_ERROR = 2;
94 POLL_INTERVAL_UNSUPPORTED = 3;
95 INVALID_METRIC = 4;
amit.ghoshbd2022e2021-02-22 05:58:53 +010096 DEVICE_UNREACHABLE = 5;
amit.ghoshae473032021-01-10 11:59:10 +010097 }
Amit Ghosh09f28362020-06-12 21:52:19 +010098 Status status = 1;
99 Reason reason = 2;
100}
101
102message MetricMetaData {
103 Uuid device_uuid = 1;
104 // uuid of the component
105 Uuid component_uuid = 2;
106 string component_name = 3;
107}
108
109// The Metrics are conveyed to external systems by submitting them on a kafka bus.
110// The topic to which are Metrics are submitted would be configured as startup
111// configuration of the components
112message Metric {
113 MetricNames metric_id = 1;
114 MetricMetaData metric_metadata = 2;
115 ComponentSensorData value = 3;
116}
117
118message GetMetricRequest {
119 MetricMetaData meta_data = 1;
120 MetricNames metric_id = 2;
121}
122
aghoshc301dcd2020-09-03 16:55:34 +0100123message GetMetricResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100124 enum Reason {
125 UNDEFINED_REASON = 0;
126 UNKNOWN_DEVICE = 1;
127 UNKNOWN_COMPONENT = 2;
128 INTERNAL_ERROR = 3;
129 INVALID_METRIC = 4;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100130 DEVICE_UNREACHABLE = 5;
amit.ghoshae473032021-01-10 11:59:10 +0100131 }
aghoshc301dcd2020-09-03 16:55:34 +0100132 Status status = 1;
133 Reason reason = 2;
134 Metric metric = 3;
135}
136
Amit Ghosh09f28362020-06-12 21:52:19 +0100137service NativeMetricsManagementService {
138
139 // List the supported metrics for the passed device.
140 // This would be the first call that you make to know about the metrics that a particular device supports and
141 // then use the UpdateMetricsConfiguration API to monitor only the required metrics.
142 rpc ListMetrics(HardwareID) returns(ListMetricsResponse);
143
144 // Updates the configuration of the list of metrics in the request
145 // Acts upon single metric configuration, collection of a single metric can be started/stopped
146 // by changing its configuration.
147 //
148 // This configuration is persisted across restart of the device or the device manager
149 rpc UpdateMetricsConfiguration(MetricsConfigurationRequest) returns(MetricsConfigurationResponse);
150
151 // Get the instantenous value of a metric
aghoshc301dcd2020-09-03 16:55:34 +0100152 rpc GetMetric(GetMetricRequest) returns(GetMetricResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100153}