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 {
|
| 70 | Status status = 1;
|
| 71 | Reason reason = 2;
|
| 72 | MetricsConfig metrics = 3;
|
| 73 | }
|
| 74 |
|
| 75 | message MetricsConfigurationRequest {
|
| 76 | Uuid device_uuid = 1;
|
| 77 | oneof operation {
|
| 78 | MetricsConfig changes = 2;
|
| 79 | bool reset_to_default = 3;
|
| 80 | }
|
| 81 | }
|
| 82 |
|
| 83 | message MetricsConfigurationResponse {
|
| 84 | Status status = 1;
|
| 85 | Reason reason = 2;
|
| 86 | }
|
| 87 |
|
| 88 | message 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
|
| 98 | message Metric {
|
| 99 | MetricNames metric_id = 1;
|
| 100 | MetricMetaData metric_metadata = 2;
|
| 101 | ComponentSensorData value = 3;
|
| 102 | }
|
| 103 |
|
| 104 | message GetMetricRequest {
|
| 105 | MetricMetaData meta_data = 1;
|
| 106 | MetricNames metric_id = 2;
|
| 107 | }
|
| 108 |
|
| 109 | service NativeMetricsManagementService {
|
| 110 |
|
| 111 | // List the supported metrics for the passed device.
|
| 112 | // This would be the first call that you make to know about the metrics that a particular device supports and
|
| 113 | // then use the UpdateMetricsConfiguration API to monitor only the required metrics.
|
| 114 | rpc ListMetrics(HardwareID) returns(ListMetricsResponse);
|
| 115 |
|
| 116 | // Updates the configuration of the list of metrics in the request
|
| 117 | // Acts upon single metric configuration, collection of a single metric can be started/stopped
|
| 118 | // by changing its configuration.
|
| 119 | //
|
| 120 | // This configuration is persisted across restart of the device or the device manager
|
| 121 | rpc UpdateMetricsConfiguration(MetricsConfigurationRequest) returns(MetricsConfigurationResponse);
|
| 122 |
|
| 123 | // Get the instantenous value of a metric
|
| 124 | rpc GetMetric(GetMetricRequest) returns(Metric);
|
| 125 | }
|