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 "google/protobuf/timestamp.proto";
|
| 7 |
|
| 8 | // The model used to represent a HW is based on RFC8348 (https://tools.ietf.org/html/rfc8348)
|
| 9 |
|
| 10 | message Uuid {
|
| 11 | string uuid = 1;
|
| 12 | }
|
| 13 |
|
| 14 | message HardwareID {
|
| 15 | Uuid uuid = 1;
|
| 16 | }
|
| 17 |
|
| 18 | message Uri {
|
| 19 | string uri = 1;
|
| 20 | }
|
| 21 |
|
| 22 | enum ComponentType {
|
| 23 | COMPONENT_TYPE_UNDEFINED = 0;
|
| 24 | COMPONENT_TYPE_UNKNOWN = 1;
|
| 25 | COMPONENT_TYPE_CHASSIS = 2;
|
| 26 | COMPONENT_TYPE_BACKPLANE = 3;
|
| 27 | COMPONENT_TYPE_CONTAINER = 4;
|
| 28 | COMPONENT_TYPE_POWER_SUPPLY = 5;
|
| 29 | COMPONENT_TYPE_FAN = 6;
|
| 30 | COMPONENT_TYPE_SENSOR = 7;
|
| 31 | COMPONENT_TYPE_MODULE = 8;
|
| 32 | COMPONENT_TYPE_PORT = 9;
|
| 33 | COMPONENT_TYPE_CPU = 10;
|
| 34 | COMPONENT_TYPE_BATTERY = 11;
|
| 35 | COMPONENT_TYPE_STORAGE = 12;
|
| 36 | COMPONENT_TYPE_MEMORY = 13;
|
| 37 | COMPONENT_TYPE_TRANSCEIVER = 14;
|
aghosh | 0746ffb | 2020-09-04 17:09:04 +0100 | [diff] [blame] | 38 | COMPONENT_TYPE_GPON_TRANSCEIVER = 15;
|
| 39 | COMPONENT_TYPE_XGS_PON_TRANSCEIVER = 16;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 40 | }
|
| 41 |
|
| 42 | enum ComponentAdminState {
|
| 43 | COMP_ADMIN_STATE_UNDEFINED = 0;
|
| 44 | COMP_ADMIN_STATE_UNKNOWN = 1;
|
| 45 | COMP_ADMIN_STATE_LOCKED = 2;
|
| 46 | COMP_ADMIN_STATE_SHUTTING_DOWN = 3;
|
| 47 | COMP_ADMIN_STATE_UNLOCKED = 4;
|
| 48 | }
|
| 49 |
|
| 50 | enum ComponentOperState {
|
| 51 | COMP_OPER_STATE_UNDEFINED = 0;
|
| 52 | COMP_OPER_STATE_UNKNOWN = 1;
|
| 53 | COMP_OPER_STATE_DISABLED = 2;
|
| 54 | COMP_OPER_STATE_ENABLED = 3;
|
| 55 | COMP_OPER_STATE_TESTING = 4;
|
| 56 | }
|
| 57 |
|
| 58 | enum ComponentUsageState {
|
| 59 | COMP_USAGE_STATE_UNDEFINED = 0;
|
| 60 | COMP_USAGE_STATE_UNKNOWN = 1;
|
| 61 | COMP_USAGE_STATE_IDLE = 2;
|
| 62 | COMP_USAGE_STATE_ACTIVE = 3;
|
| 63 | COMP_USAGE_STATE_BUSY = 4;
|
| 64 | }
|
| 65 |
|
| 66 | enum ComponentAlarmState {
|
| 67 | COMP_ALARM_STATE_UNDEFINED = 0;
|
| 68 | COMP_ALARM_STATE_UNKNOWN = 1;
|
| 69 | COMP_ALARM_STATE_UNDER_REPAIR= 2;
|
| 70 | COMP_ALARM_STATE_CRITICAL = 3;
|
| 71 | COMP_ALARM_STATE_MAJOR = 4;
|
| 72 | COMP_ALARM_STATE_MINOR = 5;
|
| 73 | COMP_ALARM_STATE_WARNING = 6;
|
| 74 | COMP_ALARM_STATE_INTERMEDIATE = 7;
|
| 75 | }
|
| 76 |
|
| 77 | enum ComponentStandbyState {
|
| 78 | COMP_STANDBY_STATE_UNDEFINED = 0;
|
| 79 | COMP_STANDBY_STATE_UNKNOWN = 1;
|
| 80 | COMP_STANDBY_STATE_HOT = 2;
|
| 81 | COMP_STANDBY_STATE_COLD = 3;
|
| 82 | COMP_STANDBY_STATE_PROVIDING_SERVICE = 4;
|
| 83 | }
|
| 84 |
|
| 85 | message ComponentState {
|
| 86 | google.protobuf.Timestamp state_last_changed = 1;
|
| 87 | ComponentAdminState admin_state = 2;
|
| 88 | ComponentOperState oper_state = 3;
|
| 89 | ComponentUsageState usage_state = 4;
|
| 90 | ComponentAlarmState alarm_state = 5;
|
| 91 | ComponentStandbyState standby_state = 6;
|
| 92 | }
|
| 93 |
|
| 94 | enum SensorValueType {
|
| 95 | SENSOR_VALUE_TYPE_UNDEFINED = 0;
|
| 96 | SENSOR_VALUE_TYPE_OTHER = 1;
|
| 97 | SENSOR_VALUE_TYPE_UNKNOWN = 2;
|
| 98 | SENSOR_VALUE_TYPE_VOLTS_AC = 3;
|
| 99 | SENSOR_VALUE_TYPE_VOLTS_DC = 4;
|
| 100 | SENSOR_VALUE_TYPE_AMPERES = 5;
|
| 101 | SENSOR_VALUE_TYPE_WATTS = 6;
|
| 102 | SENSOR_VALUE_TYPE_HERTZ = 7;
|
| 103 | SENSOR_VALUE_TYPE_CELSIUS = 8;
|
| 104 | SENSOR_VALUE_TYPE_PERCENT_RH = 9;
|
| 105 | SENSOR_VALUE_TYPE_RPM = 10;
|
| 106 | SENSOR_VALUE_TYPE_CMM = 11;
|
| 107 | SENSOR_VALUE_TYPE_TRUTH_VALUE = 12;
|
| 108 | }
|
| 109 |
|
| 110 | enum SensorValueScale {
|
| 111 | SENSOR_VALUE_SCALE_UNDEFINED = 0;
|
| 112 | SENSOR_VALUE_SCALE_YOCTO = 1;
|
| 113 | SENSOR_VALUE_SCALE_ZEPTO = 2;
|
| 114 | SENSOR_VALUE_SCALE_ATTO = 3;
|
| 115 | SENSOR_VALUE_SCALE_FEMTO = 4;
|
| 116 | SENSOR_VALUE_SCALE_PICO = 5;
|
| 117 | SENSOR_VALUE_SCALE_NANO = 6;
|
| 118 | SENSOR_VALUE_SCALE_MICRO = 7;
|
| 119 | SENSOR_VALUE_SCALE_MILLI = 8;
|
| 120 | SENSOR_VALUE_SCALE_UNITS = 9;
|
| 121 | SENSOR_VALUE_SCALE_KILO = 10;
|
| 122 | SENSOR_VALUE_SCALE_MEGA = 11;
|
| 123 | SENSOR_VALUE_SCALE_GIGA = 12;
|
| 124 | SENSOR_VALUE_SCALE_TERA = 13;
|
| 125 | SENSOR_VALUE_SCALE_PETA = 14;
|
| 126 | SENSOR_VALUE_SCALE_EXA = 15;
|
| 127 | SENSOR_VALUE_SCALE_ZETTA = 16;
|
| 128 | SENSOR_VALUE_SCALE_YOTTA =17;
|
| 129 | }
|
| 130 |
|
| 131 | enum SensorStatus {
|
| 132 | SENSOR_STATUS_UNDEFINED = 0;
|
| 133 | SENSOR_STATUS_OK = 1;
|
| 134 | SENSOR_STATUS_UNAVAILABLE = 2;
|
| 135 | SENSOR_STATUS_NONOPERATIONAL = 3;
|
| 136 | }
|
| 137 |
|
| 138 | message ComponentSensorData {
|
| 139 | int32 value = 1;
|
| 140 | SensorValueType type = 2;
|
| 141 | SensorValueScale scale = 3;
|
| 142 | int32 precision = 4;
|
| 143 | SensorStatus status = 5;
|
| 144 | string units_display = 6;
|
| 145 | google.protobuf.Timestamp timestamp = 7;
|
| 146 | uint32 value_update_rate = 8;
|
| 147 | // data_type can be of the string representation of MetricNames or something else as well
|
| 148 | string data_type = 9;
|
| 149 | }
|
| 150 |
|
| 151 | message Component {
|
| 152 | // The name of a component uniquely identifies an component within the Hardware
|
| 153 | string name = 1;
|
| 154 | ComponentType class = 2;
|
| 155 | string description = 3;
|
Amit Ghosh | 121f7c2 | 2020-07-21 10:18:38 +0100 | [diff] [blame] | 156 | // The name of the parent of this component, empty "" in case of the root component
|
| 157 | string parent = 4;
|
Amit Ghosh | 09f2836 | 2020-06-12 21:52:19 +0100 | [diff] [blame] | 158 | int32 parent_rel_pos = 5;
|
| 159 | repeated Component children = 6;
|
| 160 | string hardware_rev = 7;
|
| 161 | string firmware_rev = 8;
|
| 162 | string software_rev = 9;
|
| 163 | string serial_num = 10;
|
| 164 | string mfg_name = 11;
|
| 165 | string model_name = 12;
|
| 166 | string alias = 13;
|
| 167 | string asset_id = 14;
|
| 168 | bool is_fru = 15;
|
| 169 | google.protobuf.Timestamp mfg_date = 16;
|
| 170 | Uri uri = 17;
|
| 171 | // The uuid of the component uniquely identifies the component across the entire system
|
| 172 | Uuid uuid= 18;
|
| 173 | ComponentState state = 19;
|
| 174 | repeated ComponentSensorData sensor_data = 20;
|
| 175 | }
|
| 176 |
|
| 177 | message Hardware {
|
| 178 | google.protobuf.Timestamp last_change = 1;
|
| 179 | // Each HW has one parent/root and all other components are children of this
|
| 180 | // The class of the root component would be set as UNDEFINED
|
| 181 | Component root = 2;
|
| 182 | // TODO: Authetication?
|
| 183 | }
|
| 184 |
|
| 185 | // The attributes of a component which are modifiable from the client side
|
| 186 | message ModifiableComponent {
|
| 187 | // The name has to be unique for each component within the hardware and implementations need to
|
| 188 | // ascertain this when modifying the name
|
| 189 | string name = 1;
|
| 190 | ComponentType class = 2;
|
| 191 | Component parent = 3;
|
| 192 | int32 parent_rel_pos = 4;
|
| 193 | string alias = 5;
|
| 194 | string asset_id = 6;
|
| 195 | Uri uri = 7;
|
| 196 | ComponentAdminState admin_state = 8;
|
| 197 | }
|