blob: e35f3c7ce5eab846148d4dd033ed924c28eb92c9 [file] [log] [blame]
Zsolt Haraszti00d9a842016-11-23 11:18:23 -08001syntax = "proto3";
2
Stephane Barbarie35595062018-02-08 08:34:39 -05003option go_package = "github.com/opencord/voltha/protos/go/voltha";
4
Zsolt Haraszti00d9a842016-11-23 11:18:23 -08005package voltha;
6
7import "meta.proto";
8import "google/protobuf/any.proto";
Zsolt Haraszti66862032016-11-28 14:28:39 -08009import "common.proto";
Zsolt Haraszti00d9a842016-11-23 11:18:23 -080010import "openflow_13.proto";
Khen Nursimulua4972742016-12-23 17:15:20 -050011import "yang_options.proto";
Nikolay Titov89004ec2017-06-19 18:22:42 -040012import "bbf_fiber_base.proto";
Zsolt Haraszti00d9a842016-11-23 11:18:23 -080013
14// A Device Type
15message DeviceType {
16
17 // Unique name for the device type
18 string id = 1;
19
Niren R Chidrawarefcebcd2017-07-19 20:03:39 -040020 // Unique venor id for the device type applicable to ONU
21 // 4 bytes of vendor id from ONU serial number
22 string vendor_id = 5;
23
Shad Ansarice5fbc62018-05-01 04:03:56 +000024 repeated string vendor_ids = 6;
25
Zsolt Haraszti00d9a842016-11-23 11:18:23 -080026 // Name of the adapter that handles device type
27 string adapter = 2;
28
Zsolt Harasztic5c5d102016-12-07 21:12:27 -080029 // Capabilitities
30
31 bool accepts_bulk_flow_update = 3;
32 bool accepts_add_remove_flow_updates = 4;
Nicolas Palpacuer0c7c3162018-08-08 11:27:57 -040033 bool accepts_direct_logical_flows_update = 7;
Zsolt Haraszti00d9a842016-11-23 11:18:23 -080034
35}
36
37// A plurality of device types
38message DeviceTypes {
39 repeated DeviceType items = 1;
40}
41
Sergio Slobodriana2eb52b2017-03-07 12:24:46 -050042message PmConfig {
43 enum PmType {
Chip Boling8f171622018-08-17 10:39:54 -050044 COUNTER = 0;
45 GAUGE = 1;
46 STATE = 2;
47 CONTEXT = 3;
Sergio Slobodriana2eb52b2017-03-07 12:24:46 -050048 }
49 string name = 1;
50 PmType type = 2;
51 bool enabled = 3; // Whether or not this metric makes it to Kafka
52 uint32 sample_freq = 4; // Sample rate in 10ths of a second
53}
54
55message PmGroupConfig {
56 string group_name = 1;
57 uint32 group_freq = 2; // Frequency applicable to the grop
58 bool enabled = 3; // Enable/disable group level only
59 repeated PmConfig metrics = 4;
60}
61
62message PmConfigs {
Sergio Slobodrian2db4c102017-03-09 22:29:23 -050063 string id = 1; // To work around a chameleon POST bug
64 uint32 default_freq = 2; // Default sample rate
Sergio Slobodriana2eb52b2017-03-07 12:24:46 -050065 // Forces group names and group semantics
Sergio Slobodrian2db4c102017-03-09 22:29:23 -050066 bool grouped = 3 [(access) = READ_ONLY];
Sergio Slobodriana2eb52b2017-03-07 12:24:46 -050067 // Allows Pm to set an individual sample frequency
Sergio Slobodrian2db4c102017-03-09 22:29:23 -050068 bool freq_override = 4 [(access) = READ_ONLY];
69 repeated PmGroupConfig groups = 5; // The groups if grouped is true
70 repeated PmConfig metrics = 6; // The metrics themselves if grouped is false.
Sergio Slobodriana2eb52b2017-03-07 12:24:46 -050071}
72
ggowdru236bd952017-06-20 20:32:55 -070073// Describes instance of software image on the device
74message Image {
75 string name = 1; // software patch name
76 string version = 2; // version of software
77 string hash = 3; // md5 hash
78 string install_datetime = 4; // combined date and time expressed in UTC.
79 // use ISO 8601 format for date and time
80
81 // The active software image is one that is currently loaded and executing
82 // in the ONU or circuit pack. Under normal operation, one software image
83 // is always active while the other is inactive. Under no circumstances are
84 // both software images allowed to be active at the same time
85 bool is_active = 5; // True if the image is active
86
87 // The committed software image is loaded and executed upon reboot of the
88 // ONU and/or circuit pack. During normal operation, one software image is
89 // always committed, while the other is uncommitted.
90 bool is_committed = 6; // True if the image is committed
91
92 // A software image is valid if it has been verified to be an executable
93 // code image. The verification mechanism is not subject to standardization;
94 // however, it should include at least a data integrity (e.g., CRC) check of
95 // the entire code image.
96 bool is_valid = 7; // True if the image is valid
97}
98
99// List of software on the device
100message Images {
101 repeated Image image = 1;
102}
103
Lydia Fang01f2e852017-06-28 17:24:58 -0700104message ImageDownload {
105 option (yang_child_rule) = MOVE_TO_PARENT_LEVEL;
106
107 enum ImageDownloadState {
108 DOWNLOAD_UNKNOWN = 0;
109 DOWNLOAD_SUCCEEDED = 1;
110 DOWNLOAD_REQUESTED = 2;
111 DOWNLOAD_STARTED = 3;
112 DOWNLOAD_FAILED = 4;
113 DOWNLOAD_UNSUPPORTED = 5;
114 }
115
116 enum ImageDownloadFailureReason {
117 NO_ERROR = 0;
118 INVALID_URL = 1;
119 DEVICE_BUSY = 2;
120 INSUFFICIENT_SPACE = 3;
121 UNKNOWN_ERROR = 4;
lcui33d6a8e2018-08-28 12:51:38 -0700122 CANCELLED = 5;
Lydia Fang01f2e852017-06-28 17:24:58 -0700123 }
124
125 enum ImageActivateState {
126 IMAGE_UNKNOWN = 0;
127 IMAGE_INACTIVE = 1;
128 IMAGE_ACTIVATE = 2;
129 IMAGE_ACTIVE = 3;
130 IMAGE_REVERT = 4;
131 }
132
133 // Device Identifier
134 string id = 1;
135
136 // Image unique identifier
137 string name = 2;
138
139 // URL where the image is available
140 // should include username password
141 string url = 3;
142
143 // CRC of the image to be verified aginst
144 uint32 crc = 4;
145
146 // Download state
147 ImageDownloadState state = 5;
148
149 // Downloaded version
150 string image_version = 6;
151
152 // Bytes downloaded
153 uint32 downloaded_bytes = 7;
154
155 // Download failure reason
156 ImageDownloadFailureReason reason= 8;
157
158 // Additional info
159 string additional_info = 9;
160
161 // Save current configuration
162 bool save_config = 10;
163
164 // Image local location
165 string local_dir = 11;
166
167 // Image activation state
168 ImageActivateState image_state = 12;
lcui33d6a8e2018-08-28 12:51:38 -0700169
170 // Image file size
171 uint32 file_size = 13;
Lydia Fang01f2e852017-06-28 17:24:58 -0700172}
173
174message ImageDownloads {
175 repeated ImageDownload items = 2;
176}
177
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800178message Port {
Khen Nursimulua4972742016-12-23 17:15:20 -0500179 option (voltha.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
Zsolt Haraszti66862032016-11-28 14:28:39 -0800180
181 enum PortType {
182 UNKNOWN = 0;
183 ETHERNET_NNI = 1;
184 ETHERNET_UNI = 2;
185 PON_OLT = 3;
186 PON_ONU = 4;
Niren R Chidrawarfc1bf6e2017-09-26 19:39:54 -0400187 VENET_OLT = 5;
188 VENET_ONU = 6;
Zsolt Haraszti66862032016-11-28 14:28:39 -0800189 }
190
191 uint32 port_no = 1; // Device-unique port number
192
193 string label = 2; // Arbitrary port label
194
195 PortType type = 3; // Type of port
196
197 AdminState.AdminState admin_state = 5;
198
199 OperStatus.OperStatus oper_status = 6;
200
201 string device_id = 7; // Unique .id of device that owns this port
202
203 message PeerPort {
204 string device_id = 1;
205 uint32 port_no = 2;
206 }
207 repeated PeerPort peers = 8;
208
Nicolas Palpacuere7359fc2018-06-15 14:10:48 -0400209 fixed64 rx_packets = 9;
210 fixed64 rx_bytes = 10;
211 fixed64 rx_errors = 11;
212 fixed64 tx_packets = 12;
213 fixed64 tx_bytes = 13;
214 fixed64 tx_errors = 14;
215
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800216}
217
218message Ports {
219 repeated Port items = 1;
220}
221
222// A Physical Device instance
223message Device {
Khen Nursimulua4972742016-12-23 17:15:20 -0500224 option (voltha.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800225
226 // Voltha's device identifier
Zsolt Haraszti66862032016-11-28 14:28:39 -0800227 string id = 1 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800228
229 // Device type, refers to one of the registered device types
Zsolt Haraszti66862032016-11-28 14:28:39 -0800230 string type = 2 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800231
232 // Is this device a root device. Each logical switch has one root
233 // device that is associated with the logical flow switch.
Zsolt Haraszti66862032016-11-28 14:28:39 -0800234 bool root = 3 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800235
Zsolt Haraszti66862032016-11-28 14:28:39 -0800236 // Parent device id, in the device tree (for a root device, the parent_id
237 // is the logical_device.id)
238 string parent_id = 4 [(access) = READ_ONLY];
239 uint32 parent_port_no = 20 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800240
241 // Vendor, version, serial number, etc.
Zsolt Haraszti66862032016-11-28 14:28:39 -0800242 string vendor = 5 [(access) = READ_ONLY];
243 string model = 6 [(access) = READ_ONLY];
244 string hardware_version = 7 [(access) = READ_ONLY];
245 string firmware_version = 8 [(access) = READ_ONLY];
ggowdru236bd952017-06-20 20:32:55 -0700246 // List of software on the device
247 Images images = 9 [(access) = READ_ONLY];
Zsolt Haraszti66862032016-11-28 14:28:39 -0800248 string serial_number = 10 [(access) = READ_ONLY];
Niren R Chidrawarefcebcd2017-07-19 20:03:39 -0400249 string vendor_id = 24 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800250
251 // Addapter that takes care of device
Zsolt Haraszti66862032016-11-28 14:28:39 -0800252 string adapter = 11 [(access) = READ_ONLY];
253
254 // Device contact on vlan (if 0, no vlan)
255 uint32 vlan = 12;
256
Zsolt Harasztic5c5d102016-12-07 21:12:27 -0800257 message ProxyAddress {
Zsolt Haraszti66862032016-11-28 14:28:39 -0800258 string device_id = 1; // Which device to use as proxy to this device
alshabib38ba2032017-03-14 11:19:58 +0100259 uint32 channel_id = 2; // Sub-address within proxy
Sireesha Kora3f3788f2017-08-18 01:18:53 -0400260 uint32 channel_group_id = 5; // Channel Group index
261 string channel_termination = 6; // Channel Termination name
alshabib38ba2032017-03-14 11:19:58 +0100262 uint32 onu_id = 3; // onu identifier; optional
alshabib1ef322b2017-03-16 10:39:59 +0100263 uint32 onu_session_id = 4; // session identifier for the ONU; optional
Zsolt Haraszti66862032016-11-28 14:28:39 -0800264 };
265
266 oneof address {
267 // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
268 string mac_address = 13;
269
270 // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too)
271 string ipv4_address = 14;
272
273 // Device contact IPv6 address using the canonical string form
274 // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
275 string ipv6_address = 15;
276
Zsolt Haraszti656ecc62016-12-28 15:08:23 -0800277 string host_and_port = 21;
278
Zsolt Haraszti66862032016-11-28 14:28:39 -0800279 };
Chip Boling90b224d2017-06-02 11:51:48 -0500280 string extra_args = 23; // Used to pass additional device specific arguments
Zsolt Haraszti66862032016-11-28 14:28:39 -0800281
Zsolt Haraszti348d1932016-12-10 01:10:07 -0800282 ProxyAddress proxy_address = 19;
283
Zsolt Haraszti66862032016-11-28 14:28:39 -0800284 AdminState.AdminState admin_state = 16;
285
286 OperStatus.OperStatus oper_status = 17 [(access) = READ_ONLY];
287
Zsolt Haraszti656ecc62016-12-28 15:08:23 -0800288 string reason = 22 [(access) = READ_ONLY]; // Used in FAILED state
289
Zsolt Haraszti66862032016-11-28 14:28:39 -0800290 ConnectStatus.ConnectStatus connect_status = 18 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800291
292 // TODO additional common attribute here
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800293
294 // Device type specific attributes
295 google.protobuf.Any custom = 64;
296
Zsolt Haraszti66862032016-11-28 14:28:39 -0800297 repeated Port ports = 128 [(child_node) = {key: "port_no"}];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800298 openflow_13.Flows flows = 129 [(child_node) = {}];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800299 openflow_13.FlowGroups flow_groups = 130 [(child_node) = {}];
Sergio Slobodrian71960022017-03-09 10:20:57 -0500300 // PmConfigs will eventually converted to a child node of the
301 // device to falicitata callbacks and to simplify manipulation.
Sergio Slobodrian2db4c102017-03-09 22:29:23 -0500302 PmConfigs pm_configs = 131 [(child_node) = {}];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800303
Nikolay Titov89004ec2017-06-19 18:22:42 -0400304 // Channel Terminations for the OLT device
305 repeated bbf_fiber.ChannelterminationConfig channel_terminations = 132 [(child_node) = {key: "name"}];
306
Lydia Fang01f2e852017-06-28 17:24:58 -0700307 repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800308}
309
310message Devices {
311 repeated Device items = 1;
312}
Scott Bakerd3190952018-09-04 15:47:28 -0700313
314message SimulateAlarmRequest {
315 enum OperationType {
316 RAISE = 0;
317 CLEAR = 1;
318 }
319 // Device Identifier
320 string id = 1;
321 string indicator = 2;
322 string intf_id = 3;
323 string port_type_name = 4;
324 string onu_device_id = 5;
325 int32 inverse_bit_error_rate = 6;
326 int32 drift = 7;
327 int32 new_eqd = 8;
328 string onu_serial_number = 9;
329 OperationType operation = 10;
lcui33d6a8e2018-08-28 12:51:38 -0700330}