blob: 72a84144878c1e2b88428b05bf22dcdf669f9c10 [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;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +010079 string reason_detail = 4;
Amit Ghosh09f28362020-06-12 21:52:19 +010080}
81
82message MetricsConfigurationRequest {
83 Uuid device_uuid = 1;
84 oneof operation {
85 MetricsConfig changes = 2;
86 bool reset_to_default = 3;
87 }
88}
89
90message MetricsConfigurationResponse {
amit.ghoshae473032021-01-10 11:59:10 +010091 enum Reason {
92 UNDEFINED_REASON = 0;
93 UNKNOWN_DEVICE = 1;
94 INTERNAL_ERROR = 2;
95 POLL_INTERVAL_UNSUPPORTED = 3;
96 INVALID_METRIC = 4;
amit.ghoshbd2022e2021-02-22 05:58:53 +010097 DEVICE_UNREACHABLE = 5;
amit.ghoshae473032021-01-10 11:59:10 +010098 }
Amit Ghosh09f28362020-06-12 21:52:19 +010099 Status status = 1;
100 Reason reason = 2;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100101 string reason_detail = 3;
Amit Ghosh09f28362020-06-12 21:52:19 +0100102}
103
104message MetricMetaData {
105 Uuid device_uuid = 1;
106 // uuid of the component
107 Uuid component_uuid = 2;
108 string component_name = 3;
109}
110
111// The Metrics are conveyed to external systems by submitting them on a kafka bus.
112// The topic to which are Metrics are submitted would be configured as startup
113// configuration of the components
114message Metric {
115 MetricNames metric_id = 1;
116 MetricMetaData metric_metadata = 2;
117 ComponentSensorData value = 3;
118}
119
120message GetMetricRequest {
121 MetricMetaData meta_data = 1;
122 MetricNames metric_id = 2;
123}
124
aghoshc301dcd2020-09-03 16:55:34 +0100125message GetMetricResponse {
amit.ghoshae473032021-01-10 11:59:10 +0100126 enum Reason {
127 UNDEFINED_REASON = 0;
128 UNKNOWN_DEVICE = 1;
129 UNKNOWN_COMPONENT = 2;
130 INTERNAL_ERROR = 3;
131 INVALID_METRIC = 4;
amit.ghoshbd2022e2021-02-22 05:58:53 +0100132 DEVICE_UNREACHABLE = 5;
amit.ghoshae473032021-01-10 11:59:10 +0100133 }
aghoshc301dcd2020-09-03 16:55:34 +0100134 Status status = 1;
135 Reason reason = 2;
136 Metric metric = 3;
amit.ghosh8ab1e6e2021-02-23 07:40:17 +0100137 string reason_detail = 4;
aghoshc301dcd2020-09-03 16:55:34 +0100138}
139
Amit Ghosh09f28362020-06-12 21:52:19 +0100140service NativeMetricsManagementService {
141
142 // List the supported metrics for the passed device.
143 // This would be the first call that you make to know about the metrics that a particular device supports and
144 // then use the UpdateMetricsConfiguration API to monitor only the required metrics.
145 rpc ListMetrics(HardwareID) returns(ListMetricsResponse);
146
147 // Updates the configuration of the list of metrics in the request
148 // Acts upon single metric configuration, collection of a single metric can be started/stopped
149 // by changing its configuration.
150 //
151 // This configuration is persisted across restart of the device or the device manager
152 rpc UpdateMetricsConfiguration(MetricsConfigurationRequest) returns(MetricsConfigurationResponse);
153
154 // Get the instantenous value of a metric
aghoshc301dcd2020-09-03 16:55:34 +0100155 rpc GetMetric(GetMetricRequest) returns(GetMetricResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100156}