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