blob: f1ac063b64d641ab44d3bee8a0bf133ab5c298d7 [file] [log] [blame]
Zack Williams52209662019-02-07 10:15:31 -07001syntax = "proto3";
2
khenaidoo5fc5cea2021-08-11 17:39:16 -04003option go_package = "github.com/opencord/voltha-protos/v5/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";
khenaidoo5fc5cea2021-08-11 17:39:16 -040010
Zack Williams52209662019-02-07 10:15:31 -070011import "voltha_protos/common.proto";
12import "voltha_protos/meta.proto";
13import "voltha_protos/openflow_13.proto";
Zack Williams52209662019-02-07 10:15:31 -070014
15// A Device Type
16message DeviceType {
17
18 // Unique name for the device type
19 string id = 1;
20
William Kurkian6ea97f82019-03-13 15:51:55 -040021 // Unique vendor id for the device type applicable to ONU
Zack Williams52209662019-02-07 10:15:31 -070022 // 4 bytes of vendor id from ONU serial number
23 string vendor_id = 5;
24
25 repeated string vendor_ids = 6;
26
27 // Name of the adapter that handles device type
khenaidoo5fc5cea2021-08-11 17:39:16 -040028 // Deprecated and replaced by adapterType
Zack Williams52209662019-02-07 10:15:31 -070029 string adapter = 2;
30
William Kurkian6ea97f82019-03-13 15:51:55 -040031 // Capabilities
Zack Williams52209662019-02-07 10:15:31 -070032 bool accepts_bulk_flow_update = 3;
33 bool accepts_add_remove_flow_updates = 4;
34 bool accepts_direct_logical_flows_update = 7;
35
khenaidoo5fc5cea2021-08-11 17:39:16 -040036 // Type of adapter that can handle this device type
37 string adapter_type = 8;
38
Zack Williams52209662019-02-07 10:15:31 -070039}
40
41// A plurality of device types
42message DeviceTypes {
43 repeated DeviceType items = 1;
44}
45
46message PmConfig {
47 enum PmType {
48 COUNTER = 0;
49 GAUGE = 1;
50 STATE = 2;
51 CONTEXT = 3;
52 }
53 string name = 1;
54 PmType type = 2;
55 bool enabled = 3; // Whether or not this metric makes it to Kafka
56 uint32 sample_freq = 4; // Sample rate in 10ths of a second
57}
58
59message PmGroupConfig {
60 string group_name = 1;
61 uint32 group_freq = 2; // Frequency applicable to the grop
62 bool enabled = 3; // Enable/disable group level only
63 repeated PmConfig metrics = 4;
64}
65
66message PmConfigs {
67 string id = 1; // To work around a chameleon POST bug
68 uint32 default_freq = 2; // Default sample rate
69 // Forces group names and group semantics
70 bool grouped = 3 [(access) = READ_ONLY];
71 // Allows Pm to set an individual sample frequency
72 bool freq_override = 4 [(access) = READ_ONLY];
73 repeated PmGroupConfig groups = 5; // The groups if grouped is true
74 repeated PmConfig metrics = 6; // The metrics themselves if grouped is false.
Rohan Agrawal065c8182020-06-29 11:05:32 +000075 uint32 max_skew = 7; //Default value is set to 5 seconds
Zack Williams52209662019-02-07 10:15:31 -070076}
77
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010078//Object representing an image
Zack Williams52209662019-02-07 10:15:31 -070079message Image {
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010080
Zack Williams52209662019-02-07 10:15:31 -070081 string name = 1; // software patch name
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010082
83 // Version, this is the sole identifier of the image. it's the vendor specified OMCI version
84 // must be known at the time of initiating a download, activate, commit image on an onu.
85 string version = 2;
86
87 // hash of the image to be verified against
88 // Deprecated in voltha 2.8, will be removed
89 uint32 hash = 3;
90
91 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -070092 string install_datetime = 4; // combined date and time expressed in UTC.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010093 // use ISO 8601 format for date and time
Zack Williams52209662019-02-07 10:15:31 -070094
95 // The active software image is one that is currently loaded and executing
96 // in the ONU or circuit pack. Under normal operation, one software image
97 // is always active while the other is inactive. Under no circumstances are
98 // both software images allowed to be active at the same time
Andrea Campanella9e94e8a2021-01-19 15:21:25 +010099 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700100 bool is_active = 5; // True if the image is active
101
102 // The committed software image is loaded and executed upon reboot of the
103 // ONU and/or circuit pack. During normal operation, one software image is
104 // always committed, while the other is uncommitted.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100105 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700106 bool is_committed = 6; // True if the image is committed
107
108 // A software image is valid if it has been verified to be an executable
109 // code image. The verification mechanism is not subject to standardization;
110 // however, it should include at least a data integrity (e.g., CRC) check of
111 // the entire code image.
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100112 // Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700113 bool is_valid = 7; // True if the image is valid
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100114
115 // URL where the image is available
116 // URL MUST be fully qualified,
117 // including filename, username and password
118 string url = 8;
119
120 // Represents the vendor/device mfr
121 // Needs to match the vendor of the device the image will be installed on
122 // optional, if not matched no check will be performed
123 string vendor = 9;
124
125 // Represents the ONU Image CRC value.
126 // Default to value 0 if not specified.
127 // If different then 0 it's used to verify the image retrieved from outside before sending it to the ONU.
128 // Calculation of this needs to be done according to ITU-T I.363.5 as per OMCI spec (section A.2.27)
129 uint32 crc32 = 10;
130
131 //TODO augment with RecommendedWindowsSize, Timeout and other valuable attributes.
132
Zack Williams52209662019-02-07 10:15:31 -0700133}
134
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100135// Older version of the API please see DeviceImageDownloadRequest
136// Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700137message ImageDownload {
Zack Williams52209662019-02-07 10:15:31 -0700138 enum ImageDownloadState {
139 DOWNLOAD_UNKNOWN = 0;
140 DOWNLOAD_SUCCEEDED = 1;
141 DOWNLOAD_REQUESTED = 2;
142 DOWNLOAD_STARTED = 3;
143 DOWNLOAD_FAILED = 4;
144 DOWNLOAD_UNSUPPORTED = 5;
145 DOWNLOAD_CANCELLED = 6;
146 }
147
148 enum ImageDownloadFailureReason {
149 NO_ERROR = 0;
150 INVALID_URL = 1;
151 DEVICE_BUSY = 2;
152 INSUFFICIENT_SPACE = 3;
153 UNKNOWN_ERROR = 4;
154 CANCELLED = 5;
155 }
156
157 enum ImageActivateState {
158 IMAGE_UNKNOWN = 0;
159 IMAGE_INACTIVE = 1;
William Kurkian6ea97f82019-03-13 15:51:55 -0400160 IMAGE_ACTIVATING = 2;
Zack Williams52209662019-02-07 10:15:31 -0700161 IMAGE_ACTIVE = 3;
William Kurkian6ea97f82019-03-13 15:51:55 -0400162 IMAGE_REVERTING = 4;
163 IMAGE_REVERTED = 5;
Zack Williams52209662019-02-07 10:15:31 -0700164 }
165
166 // Device Identifier
167 string id = 1;
168
169 // Image unique identifier
170 string name = 2;
171
172 // URL where the image is available
173 // should include username password
174 string url = 3;
175
176 // CRC of the image to be verified aginst
177 uint32 crc = 4;
178
179 // Download state
180 ImageDownloadState download_state = 5;
181
182 // Downloaded version
183 string image_version = 6;
184
185 // Bytes downloaded
186 uint32 downloaded_bytes = 7;
187
188 // Download failure reason
189 ImageDownloadFailureReason reason= 8;
190
191 // Additional info
192 string additional_info = 9;
193
194 // Save current configuration
195 bool save_config = 10;
196
197 // Image local location
198 string local_dir = 11;
199
200 // Image activation state
201 ImageActivateState image_state = 12;
Kent Hagerman66e56b42020-07-09 14:30:23 -0400202
Zack Williams52209662019-02-07 10:15:31 -0700203 // Image file size
204 uint32 file_size = 13;
205}
206
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100207// Deprecated in voltha 2.8, will be removed
Zack Williams52209662019-02-07 10:15:31 -0700208message ImageDownloads {
209 repeated ImageDownload items = 2;
210}
211
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100212message Images {
213 repeated Image image = 1;
214}
215
216// OnuImage represents the OMCI information as per OMCI spec
217// the information will be populates exactly as extracted from the device.
218message OnuImage {
219 //image version
220 string version = 1;
221 bool isCommited = 2;
222 bool isActive = 3;
223 bool isValid = 4;
224 string productCode = 5;
225 // Hash is computed by the ONU and is optional as per OMCI spec (paragraph 9.1.4)
226 // No assumption should be made on the existence of this attribute at any time.
227 string hash = 6;
228}
229
230message OnuImages {
231 repeated OnuImage items = 1;
232}
233
234message DeviceImageState {
235 string device_id = 1;
236 ImageState imageState = 2;
237}
238
239message ImageState {
240 enum ImageDownloadState {
241 DOWNLOAD_UNKNOWN = 0;
242 DOWNLOAD_SUCCEEDED = 1;
243 DOWNLOAD_REQUESTED = 2;
244 DOWNLOAD_STARTED = 3;
245 DOWNLOAD_FAILED = 4;
246 DOWNLOAD_UNSUPPORTED = 5;
247 DOWNLOAD_CANCELLING = 6;
248 DOWNLOAD_CANCELLED = 7;
249 }
250
251 enum ImageFailureReason {
252 NO_ERROR = 0;
253 INVALID_URL = 1;
254 DEVICE_BUSY = 2;
255 INSUFFICIENT_SPACE = 3; // VOLTHA ONU ADAPTER has no more space to store images
256 UNKNOWN_ERROR = 4; // Used also for Checksum failure on ONU
257 CANCELLED_ON_REQUEST = 5;
258 CANCELLED_ON_ONU_STATE = 6;
259 VENDOR_DEVICE_MISMATCH = 7;
260 OMCI_TRANSFER_ERROR = 8;
261 IMAGE_REFUSED_BY_ONU = 9;
262 }
263
264 enum ImageActivationState {
265 IMAGE_UNKNOWN = 0;
266 IMAGE_INACTIVE = 1;
267 IMAGE_ACTIVATING = 2; // Happens during Reboot of the ONU after activate call.
268 IMAGE_ACTIVE = 3;
269 IMAGE_COMMITTING = 4;
270 IMAGE_COMMITTED = 5;
271 IMAGE_ACTIVATION_ABORTING = 6;
272 IMAGE_ACTIVATION_ABORTED = 7;
273 IMAGE_COMMIT_ABORTING = 8;
274 IMAGE_COMMIT_ABORTED = 9;
275 IMAGE_DOWNLOADING = 10;
276 }
277
278 // image version
279 string version = 1;
280
281 // Download state
282 ImageDownloadState download_state = 2;
283
284 // Image Operation Failure reason (use for both Download and Activate)
285 ImageFailureReason reason= 3;
286
287 // Image activation state
288 ImageActivationState image_state = 4;
289
290}
291
Zack Williams52209662019-02-07 10:15:31 -0700292message Port {
Zack Williams52209662019-02-07 10:15:31 -0700293 enum PortType {
294 UNKNOWN = 0;
295 ETHERNET_NNI = 1;
296 ETHERNET_UNI = 2;
297 PON_OLT = 3;
298 PON_ONU = 4;
299 VENET_OLT = 5;
300 VENET_ONU = 6;
301 }
302
303 uint32 port_no = 1; // Device-unique port number
304
305 string label = 2; // Arbitrary port label
306
307 PortType type = 3; // Type of port
308
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300309 common.AdminState.Types admin_state = 5;
Zack Williams52209662019-02-07 10:15:31 -0700310
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300311 common.OperStatus.Types oper_status = 6;
Zack Williams52209662019-02-07 10:15:31 -0700312
313 string device_id = 7; // Unique .id of device that owns this port
314
315 message PeerPort {
316 string device_id = 1;
317 uint32 port_no = 2;
318 }
319 repeated PeerPort peers = 8;
320
321 fixed64 rx_packets = 9;
322 fixed64 rx_bytes = 10;
323 fixed64 rx_errors = 11;
324 fixed64 tx_packets = 12;
325 fixed64 tx_bytes = 13;
326 fixed64 tx_errors = 14;
327
khenaidooce41ea42020-06-09 18:10:16 -0400328 // ofp_port represents the characteristics of a port, e.g. hardware
329 // address and supported features. This field is relevant only for
330 // UNI and NNI ports. For PON ports, it can be left empty.
331 openflow_13.ofp_port ofp_port = 15;
Zack Williams52209662019-02-07 10:15:31 -0700332}
333
334message Ports {
335 repeated Port items = 1;
336}
337
338// A Physical Device instance
339message Device {
Zack Williams52209662019-02-07 10:15:31 -0700340 // Voltha's device identifier
341 string id = 1 [(access) = READ_ONLY];
342
343 // Device type, refers to one of the registered device types
344 string type = 2 [(access) = READ_ONLY];
345
346 // Is this device a root device. Each logical switch has one root
347 // device that is associated with the logical flow switch.
348 bool root = 3 [(access) = READ_ONLY];
349
350 // Parent device id, in the device tree (for a root device, the parent_id
351 // is the logical_device.id)
352 string parent_id = 4 [(access) = READ_ONLY];
353 uint32 parent_port_no = 20 [(access) = READ_ONLY];
354
355 // Vendor, version, serial number, etc.
356 string vendor = 5 [(access) = READ_ONLY];
357 string model = 6 [(access) = READ_ONLY];
358 string hardware_version = 7 [(access) = READ_ONLY];
359 string firmware_version = 8 [(access) = READ_ONLY];
360 // List of software on the device
361 Images images = 9 [(access) = READ_ONLY];
362 string serial_number = 10 [(access) = READ_ONLY];
363 string vendor_id = 24 [(access) = READ_ONLY];
364
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100365 // Adapter that takes care of device
khenaidoo5fc5cea2021-08-11 17:39:16 -0400366 // Deprecated and replaced by adapter_endpoint
Zack Williams52209662019-02-07 10:15:31 -0700367 string adapter = 11 [(access) = READ_ONLY];
368
khenaidoo5fc5cea2021-08-11 17:39:16 -0400369 // Indicates how to reach the adapter instance that manages this device
370 string adapter_endpoint = 25;
371
Zack Williams52209662019-02-07 10:15:31 -0700372 // Device contact on vlan (if 0, no vlan)
373 uint32 vlan = 12;
374
375 message ProxyAddress {
376 string device_id = 1; // Which device to use as proxy to this device
377 string device_type = 2; // The device type of the proxy device to use as the adapter name
378 uint32 channel_id = 3; // Sub-address within proxy
379 uint32 channel_group_id = 4; // Channel Group index
380 string channel_termination = 5; // Channel Termination name
381 uint32 onu_id = 6; // onu identifier; optional
382 uint32 onu_session_id = 7; // session identifier for the ONU; optional
khenaidoo5fc5cea2021-08-11 17:39:16 -0400383 string adapter_endpoint = 8; // endpoint of the adapter that handles the proxy device
Zack Williams52209662019-02-07 10:15:31 -0700384 };
385
William Kurkian6ea97f82019-03-13 15:51:55 -0400386 // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
387 string mac_address = 13;
388
Zack Williams52209662019-02-07 10:15:31 -0700389 oneof address {
Zack Williams52209662019-02-07 10:15:31 -0700390
391 // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too)
392 string ipv4_address = 14;
393
394 // Device contact IPv6 address using the canonical string form
395 // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
396 string ipv6_address = 15;
397
398 string host_and_port = 21;
399
400 };
401 string extra_args = 23; // Used to pass additional device specific arguments
402
403 ProxyAddress proxy_address = 19;
404
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300405 common.AdminState.Types admin_state = 16;
Zack Williams52209662019-02-07 10:15:31 -0700406
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300407 common.OperStatus.Types oper_status = 17 [(access) = READ_ONLY];
Zack Williams52209662019-02-07 10:15:31 -0700408
khenaidoo Nursimulue9ae0452021-01-13 15:23:48 +0000409 string reason = 22 [(access) = READ_ONLY]; // Used in FAILED state
410
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300411 common.ConnectStatus.Types connect_status = 18 [(access) = READ_ONLY];
Zack Williams52209662019-02-07 10:15:31 -0700412
413 // TODO additional common attribute here
414
415 // Device type specific attributes
416 google.protobuf.Any custom = 64;
417
Zack Williams52209662019-02-07 10:15:31 -0700418 // PmConfigs will eventually converted to a child node of the
419 // device to falicitata callbacks and to simplify manipulation.
420 PmConfigs pm_configs = 131 [(child_node) = {}];
421
422 repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}];
Andrea Campanella9e94e8a2021-01-19 15:21:25 +0100423
Zack Williams52209662019-02-07 10:15:31 -0700424}
425
426message Devices {
427 repeated Device items = 1;
428}
429
430message SimulateAlarmRequest {
431 enum OperationType {
432 RAISE = 0;
433 CLEAR = 1;
434 }
435 // Device Identifier
436 string id = 1;
437 string indicator = 2;
438 string intf_id = 3;
439 string port_type_name = 4;
440 string onu_device_id = 5;
441 int32 inverse_bit_error_rate = 6;
442 int32 drift = 7;
443 int32 new_eqd = 8;
444 string onu_serial_number = 9;
445 OperationType operation = 10;
446}