blob: adec0d37f5ffc886cc6f634040c273c2ccc85a7c [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 {
70 Status status = 1;
71 Reason reason = 2;
72 MetricsConfig metrics = 3;
73}
74
75message MetricsConfigurationRequest {
76 Uuid device_uuid = 1;
77 oneof operation {
78 MetricsConfig changes = 2;
79 bool reset_to_default = 3;
80 }
81}
82
83message MetricsConfigurationResponse {
84 Status status = 1;
85 Reason reason = 2;
86}
87
88message MetricMetaData {
89 Uuid device_uuid = 1;
90 // uuid of the component
91 Uuid component_uuid = 2;
92 string component_name = 3;
93}
94
95// The Metrics are conveyed to external systems by submitting them on a kafka bus.
96// The topic to which are Metrics are submitted would be configured as startup
97// configuration of the components
98message Metric {
99 MetricNames metric_id = 1;
100 MetricMetaData metric_metadata = 2;
101 ComponentSensorData value = 3;
102}
103
104message GetMetricRequest {
105 MetricMetaData meta_data = 1;
106 MetricNames metric_id = 2;
107}
108
aghoshc301dcd2020-09-03 16:55:34 +0100109message GetMetricResponse {
110 Status status = 1;
111 Reason reason = 2;
112 Metric metric = 3;
113}
114
Amit Ghosh09f28362020-06-12 21:52:19 +0100115service NativeMetricsManagementService {
116
117 // List the supported metrics for the passed device.
118 // This would be the first call that you make to know about the metrics that a particular device supports and
119 // then use the UpdateMetricsConfiguration API to monitor only the required metrics.
120 rpc ListMetrics(HardwareID) returns(ListMetricsResponse);
121
122 // Updates the configuration of the list of metrics in the request
123 // Acts upon single metric configuration, collection of a single metric can be started/stopped
124 // by changing its configuration.
125 //
126 // This configuration is persisted across restart of the device or the device manager
127 rpc UpdateMetricsConfiguration(MetricsConfigurationRequest) returns(MetricsConfigurationResponse);
128
129 // Get the instantenous value of a metric
aghoshc301dcd2020-09-03 16:55:34 +0100130 rpc GetMetric(GetMetricRequest) returns(GetMetricResponse);
Amit Ghosh09f28362020-06-12 21:52:19 +0100131}