blob: 9e65beec53b0ae4bf9b4e00e6c02113097c7bcf4 [file] [log] [blame]
Zack Williams52209662019-02-07 10:15:31 -07001syntax = "proto3";
2
Matteo Scandolob3c08ae2020-10-14 13:15:43 -07003option go_package = "github.com/opencord/voltha-protos/v4/go/voltha";
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +03004option java_package = "org.opencord.voltha";
5option java_outer_classname = "VolthaDevice";
Zack Williams52209662019-02-07 10:15:31 -07006
7package voltha;
8
9import "google/protobuf/any.proto";
10import "voltha_protos/common.proto";
11import "voltha_protos/meta.proto";
12import "voltha_protos/openflow_13.proto";
Zack Williams52209662019-02-07 10:15:31 -070013
14// A Device Type
15message DeviceType {
16
17 // Unique name for the device type
18 string id = 1;
19
William Kurkian6ea97f82019-03-13 15:51:55 -040020 // Unique vendor id for the device type applicable to ONU
Zack Williams52209662019-02-07 10:15:31 -070021 // 4 bytes of vendor id from ONU serial number
22 string vendor_id = 5;
23
24 repeated string vendor_ids = 6;
25
26 // Name of the adapter that handles device type
27 string adapter = 2;
28
William Kurkian6ea97f82019-03-13 15:51:55 -040029 // Capabilities
Zack Williams52209662019-02-07 10:15:31 -070030 bool accepts_bulk_flow_update = 3;
31 bool accepts_add_remove_flow_updates = 4;
32 bool accepts_direct_logical_flows_update = 7;
33
34}
35
36// A plurality of device types
37message DeviceTypes {
38 repeated DeviceType items = 1;
39}
40
41message PmConfig {
42 enum PmType {
43 COUNTER = 0;
44 GAUGE = 1;
45 STATE = 2;
46 CONTEXT = 3;
47 }
48 string name = 1;
49 PmType type = 2;
50 bool enabled = 3; // Whether or not this metric makes it to Kafka
51 uint32 sample_freq = 4; // Sample rate in 10ths of a second
52}
53
54message PmGroupConfig {
55 string group_name = 1;
56 uint32 group_freq = 2; // Frequency applicable to the grop
57 bool enabled = 3; // Enable/disable group level only
58 repeated PmConfig metrics = 4;
59}
60
61message PmConfigs {
62 string id = 1; // To work around a chameleon POST bug
63 uint32 default_freq = 2; // Default sample rate
64 // Forces group names and group semantics
65 bool grouped = 3 [(access) = READ_ONLY];
66 // Allows Pm to set an individual sample frequency
67 bool freq_override = 4 [(access) = READ_ONLY];
68 repeated PmGroupConfig groups = 5; // The groups if grouped is true
69 repeated PmConfig metrics = 6; // The metrics themselves if grouped is false.
Rohan Agrawal065c8182020-06-29 11:05:32 +000070 uint32 max_skew = 7; //Default value is set to 5 seconds
Zack Williams52209662019-02-07 10:15:31 -070071}
72
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010073//Object representing an image
Zack Williams52209662019-02-07 10:15:31 -070074message Image {
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010075
Zack Williams52209662019-02-07 10:15:31 -070076 string name = 1; // software patch name
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010077
78 // Version, this is the sole identifier of the image. it's the vendor specified OMCI version
79 // must be known at the time of initiating a download, activate, commit image on an onu.
80 string version = 2;
81
82 // hash of the image to be verified against
83 // Deprecated in voltha 2.8, will be removed
84 uint32 hash = 3;
85
86 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -070087 string install_datetime = 4; // combined date and time expressed in UTC.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010088 // use ISO 8601 format for date and time
Zack Williams52209662019-02-07 10:15:31 -070089
90 // The active software image is one that is currently loaded and executing
91 // in the ONU or circuit pack. Under normal operation, one software image
92 // is always active while the other is inactive. Under no circumstances are
93 // both software images allowed to be active at the same time
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010094 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -070095 bool is_active = 5; // True if the image is active
96
97 // The committed software image is loaded and executed upon reboot of the
98 // ONU and/or circuit pack. During normal operation, one software image is
99 // always committed, while the other is uncommitted.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100100 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700101 bool is_committed = 6; // True if the image is committed
102
103 // A software image is valid if it has been verified to be an executable
104 // code image. The verification mechanism is not subject to standardization;
105 // however, it should include at least a data integrity (e.g., CRC) check of
106 // the entire code image.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100107 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700108 bool is_valid = 7; // True if the image is valid
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100109
110 // URL where the image is available
111 // URL MUST be fully qualified,
112 // including filename, username and password
113 string url = 8;
114
115 // Represents the vendor/device mfr
116 // Needs to match the vendor of the device the image will be installed on
117 // optional, if not matched no check will be performed
118 string vendor = 9;
119
120 // Represents the ONU Image CRC value.
121 // Default to value 0 if not specified.
122 // If different then 0 it's used to verify the image retrieved from outside before sending it to the ONU.
123 // Calculation of this needs to be done according to ITU-T I.363.5 as per OMCI spec (section A.2.27)
124 uint32 crc32 = 10;
125
126 //TODO augment with RecommendedWindowsSize, Timeout and other valuable attributes.
127
Zack Williams52209662019-02-07 10:15:31 -0700128}
129
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100130// Older version of the API please see DeviceImageDownloadRequest
131// Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700132message ImageDownload {
Zack Williams52209662019-02-07 10:15:31 -0700133 enum ImageDownloadState {
134 DOWNLOAD_UNKNOWN = 0;
135 DOWNLOAD_SUCCEEDED = 1;
136 DOWNLOAD_REQUESTED = 2;
137 DOWNLOAD_STARTED = 3;
138 DOWNLOAD_FAILED = 4;
139 DOWNLOAD_UNSUPPORTED = 5;
140 DOWNLOAD_CANCELLED = 6;
141 }
142
143 enum ImageDownloadFailureReason {
144 NO_ERROR = 0;
145 INVALID_URL = 1;
146 DEVICE_BUSY = 2;
147 INSUFFICIENT_SPACE = 3;
148 UNKNOWN_ERROR = 4;
149 CANCELLED = 5;
150 }
151
152 enum ImageActivateState {
153 IMAGE_UNKNOWN = 0;
154 IMAGE_INACTIVE = 1;
William Kurkian6ea97f82019-03-13 15:51:55 -0400155 IMAGE_ACTIVATING = 2;
Zack Williams52209662019-02-07 10:15:31 -0700156 IMAGE_ACTIVE = 3;
William Kurkian6ea97f82019-03-13 15:51:55 -0400157 IMAGE_REVERTING = 4;
158 IMAGE_REVERTED = 5;
Zack Williams52209662019-02-07 10:15:31 -0700159 }
160
161 // Device Identifier
162 string id = 1;
163
164 // Image unique identifier
165 string name = 2;
166
167 // URL where the image is available
168 // should include username password
169 string url = 3;
170
171 // CRC of the image to be verified aginst
172 uint32 crc = 4;
173
174 // Download state
175 ImageDownloadState download_state = 5;
176
177 // Downloaded version
178 string image_version = 6;
179
180 // Bytes downloaded
181 uint32 downloaded_bytes = 7;
182
183 // Download failure reason
184 ImageDownloadFailureReason reason= 8;
185
186 // Additional info
187 string additional_info = 9;
188
189 // Save current configuration
190 bool save_config = 10;
191
192 // Image local location
193 string local_dir = 11;
194
195 // Image activation state
196 ImageActivateState image_state = 12;
Kent Hagerman66e56b42020-07-09 14:30:23 -0400197
Zack Williams52209662019-02-07 10:15:31 -0700198 // Image file size
199 uint32 file_size = 13;
200}
201
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100202// Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700203message ImageDownloads {
204 repeated ImageDownload items = 2;
205}
206
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100207message Images {
208 repeated Image image = 1;
209}
210
211// OnuImage represents the OMCI information as per OMCI spec
212// the information will be populates exactly as extracted from the device.
213message OnuImage {
214 //image version
215 string version = 1;
216 bool isCommited = 2;
217 bool isActive = 3;
218 bool isValid = 4;
219 string productCode = 5;
220 // Hash is computed by the ONU and is optional as per OMCI spec (paragraph 9.1.4)
221 // No assumption should be made on the existence of this attribute at any time.
222 string hash = 6;
223}
224
225message OnuImages {
226 repeated OnuImage items = 1;
227}
228
229message DeviceImageState {
230 string device_id = 1;
231 ImageState imageState = 2;
232}
233
234message ImageState {
235 enum ImageDownloadState {
236 DOWNLOAD_UNKNOWN = 0;
237 DOWNLOAD_SUCCEEDED = 1;
238 DOWNLOAD_REQUESTED = 2;
239 DOWNLOAD_STARTED = 3;
240 DOWNLOAD_FAILED = 4;
241 DOWNLOAD_UNSUPPORTED = 5;
242 DOWNLOAD_CANCELLING = 6;
243 DOWNLOAD_CANCELLED = 7;
244 }
245
246 enum ImageFailureReason {
247 NO_ERROR = 0;
248 INVALID_URL = 1;
249 DEVICE_BUSY = 2;
250 INSUFFICIENT_SPACE = 3; // VOLTHA ONU ADAPTER has no more space to store images
251 UNKNOWN_ERROR = 4; // Used also for Checksum failure on ONU
252 CANCELLED_ON_REQUEST = 5;
253 CANCELLED_ON_ONU_STATE = 6;
254 VENDOR_DEVICE_MISMATCH = 7;
255 OMCI_TRANSFER_ERROR = 8;
256 IMAGE_REFUSED_BY_ONU = 9;
257 }
258
259 enum ImageActivationState {
260 IMAGE_UNKNOWN = 0;
261 IMAGE_INACTIVE = 1;
262 IMAGE_ACTIVATING = 2; // Happens during Reboot of the ONU after activate call.
263 IMAGE_ACTIVE = 3;
264 IMAGE_COMMITTING = 4;
265 IMAGE_COMMITTED = 5;
266 IMAGE_ACTIVATION_ABORTING = 6;
267 IMAGE_ACTIVATION_ABORTED = 7;
268 IMAGE_COMMIT_ABORTING = 8;
269 IMAGE_COMMIT_ABORTED = 9;
270 IMAGE_DOWNLOADING = 10;
271 }
272
273 // image version
274 string version = 1;
275
276 // Download state
277 ImageDownloadState download_state = 2;
278
279 // Image Operation Failure reason (use for both Download and Activate)
280 ImageFailureReason reason= 3;
281
282 // Image activation state
283 ImageActivationState image_state = 4;
284
285}
286
Zack Williams52209662019-02-07 10:15:31 -0700287message Port {
Zack Williams52209662019-02-07 10:15:31 -0700288 enum PortType {
289 UNKNOWN = 0;
290 ETHERNET_NNI = 1;
291 ETHERNET_UNI = 2;
292 PON_OLT = 3;
293 PON_ONU = 4;
294 VENET_OLT = 5;
295 VENET_ONU = 6;
296 }
297
298 uint32 port_no = 1; // Device-unique port number
299
300 string label = 2; // Arbitrary port label
301
302 PortType type = 3; // Type of port
303
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300304 common.AdminState.Types admin_state = 5;
Zack Williams52209662019-02-07 10:15:31 -0700305
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300306 common.OperStatus.Types oper_status = 6;
Zack Williams52209662019-02-07 10:15:31 -0700307
308 string device_id = 7; // Unique .id of device that owns this port
309
310 message PeerPort {
311 string device_id = 1;
312 uint32 port_no = 2;
313 }
314 repeated PeerPort peers = 8;
315
316 fixed64 rx_packets = 9;
317 fixed64 rx_bytes = 10;
318 fixed64 rx_errors = 11;
319 fixed64 tx_packets = 12;
320 fixed64 tx_bytes = 13;
321 fixed64 tx_errors = 14;
322
khenaidooce41ea42020-06-09 18:10:16 -0400323 // ofp_port represents the characteristics of a port, e.g. hardware
324 // address and supported features. This field is relevant only for
325 // UNI and NNI ports. For PON ports, it can be left empty.
326 openflow_13.ofp_port ofp_port = 15;
Zack Williams52209662019-02-07 10:15:31 -0700327}
328
329message Ports {
330 repeated Port items = 1;
331}
332
333// A Physical Device instance
334message Device {
Zack Williams52209662019-02-07 10:15:31 -0700335 // Voltha's device identifier
336 string id = 1 [(access) = READ_ONLY];
337
338 // Device type, refers to one of the registered device types
339 string type = 2 [(access) = READ_ONLY];
340
341 // Is this device a root device. Each logical switch has one root
342 // device that is associated with the logical flow switch.
343 bool root = 3 [(access) = READ_ONLY];
344
345 // Parent device id, in the device tree (for a root device, the parent_id
346 // is the logical_device.id)
347 string parent_id = 4 [(access) = READ_ONLY];
348 uint32 parent_port_no = 20 [(access) = READ_ONLY];
349
350 // Vendor, version, serial number, etc.
351 string vendor = 5 [(access) = READ_ONLY];
352 string model = 6 [(access) = READ_ONLY];
353 string hardware_version = 7 [(access) = READ_ONLY];
354 string firmware_version = 8 [(access) = READ_ONLY];
355 // List of software on the device
356 Images images = 9 [(access) = READ_ONLY];
357 string serial_number = 10 [(access) = READ_ONLY];
358 string vendor_id = 24 [(access) = READ_ONLY];
359
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100360 // Adapter that takes care of device
Zack Williams52209662019-02-07 10:15:31 -0700361 string adapter = 11 [(access) = READ_ONLY];
362
363 // Device contact on vlan (if 0, no vlan)
364 uint32 vlan = 12;
365
366 message ProxyAddress {
367 string device_id = 1; // Which device to use as proxy to this device
368 string device_type = 2; // The device type of the proxy device to use as the adapter name
369 uint32 channel_id = 3; // Sub-address within proxy
370 uint32 channel_group_id = 4; // Channel Group index
371 string channel_termination = 5; // Channel Termination name
372 uint32 onu_id = 6; // onu identifier; optional
373 uint32 onu_session_id = 7; // session identifier for the ONU; optional
374 };
375
William Kurkian6ea97f82019-03-13 15:51:55 -0400376 // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
377 string mac_address = 13;
378
Zack Williams52209662019-02-07 10:15:31 -0700379 oneof address {
Zack Williams52209662019-02-07 10:15:31 -0700380
381 // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too)
382 string ipv4_address = 14;
383
384 // Device contact IPv6 address using the canonical string form
385 // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
386 string ipv6_address = 15;
387
388 string host_and_port = 21;
389
390 };
391 string extra_args = 23; // Used to pass additional device specific arguments
392
393 ProxyAddress proxy_address = 19;
394
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300395 common.AdminState.Types admin_state = 16;
Zack Williams52209662019-02-07 10:15:31 -0700396
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300397 common.OperStatus.Types oper_status = 17 [(access) = READ_ONLY];
Zack Williams52209662019-02-07 10:15:31 -0700398
khenaidoo Nursimulue9ae0452021-01-13 15:23:48 +0000399 string reason = 22 [(access) = READ_ONLY]; // Used in FAILED state
400
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300401 common.ConnectStatus.Types connect_status = 18 [(access) = READ_ONLY];
Zack Williams52209662019-02-07 10:15:31 -0700402
403 // TODO additional common attribute here
404
405 // Device type specific attributes
406 google.protobuf.Any custom = 64;
407
Zack Williams52209662019-02-07 10:15:31 -0700408 // PmConfigs will eventually converted to a child node of the
409 // device to falicitata callbacks and to simplify manipulation.
410 PmConfigs pm_configs = 131 [(child_node) = {}];
411
412 repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}];
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100413
Zack Williams52209662019-02-07 10:15:31 -0700414}
415
416message Devices {
417 repeated Device items = 1;
418}
419
420message SimulateAlarmRequest {
421 enum OperationType {
422 RAISE = 0;
423 CLEAR = 1;
424 }
425 // Device Identifier
426 string id = 1;
427 string indicator = 2;
428 string intf_id = 3;
429 string port_type_name = 4;
430 string onu_device_id = 5;
431 int32 inverse_bit_error_rate = 6;
432 int32 drift = 7;
433 int32 new_eqd = 8;
434 string onu_serial_number = 9;
435 OperationType operation = 10;
436}