blob: cf53269e50d66151289014858942751e63d8c86b [file] [log] [blame]
khenaidooabad44c2018-08-03 16:58:35 -04001syntax = "proto3";
2
William Kurkiandaa6bb22019-03-07 12:26:28 -05003option go_package = "github.com/opencord/voltha-protos/go/voltha";
khenaidooabad44c2018-08-03 16:58:35 -04004
5package voltha;
6
7import "meta.proto";
8import "google/protobuf/any.proto";
9import "common.proto";
10import "openflow_13.proto";
11import "yang_options.proto";
12
13
14// A Device Type
15message DeviceType {
16
17 // Unique name for the device type
18 string id = 1;
19
William Kurkiandaa6bb22019-03-07 12:26:28 -050020 // Unique venor id for the device type applicable to ONU
khenaidooabad44c2018-08-03 16:58:35 -040021 // 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 Kurkiandaa6bb22019-03-07 12:26:28 -050029 // Capabilitities
30
khenaidooabad44c2018-08-03 16:58:35 -040031 bool accepts_bulk_flow_update = 3;
32 bool accepts_add_remove_flow_updates = 4;
William Kurkiandaa6bb22019-03-07 12:26:28 -050033 bool accepts_direct_logical_flows_update = 7;
34
khenaidooabad44c2018-08-03 16:58:35 -040035}
36
37// A plurality of device types
38message DeviceTypes {
39 repeated DeviceType items = 1;
40}
41
42message PmConfig {
43 enum PmType {
William Kurkiandaa6bb22019-03-07 12:26:28 -050044 COUNTER = 0;
45 GAUGE = 1;
46 STATE = 2;
47 CONTEXT = 3;
khenaidooabad44c2018-08-03 16:58:35 -040048 }
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 {
63 string id = 1; // To work around a chameleon POST bug
64 uint32 default_freq = 2; // Default sample rate
65 // Forces group names and group semantics
66 bool grouped = 3 [(access) = READ_ONLY];
67 // Allows Pm to set an individual sample frequency
68 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.
71}
72
73// 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
104message 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;
khenaidoof5a5bfa2019-01-23 22:20:29 -0500114 DOWNLOAD_CANCELLED = 6;
khenaidooabad44c2018-08-03 16:58:35 -0400115 }
116
117 enum ImageDownloadFailureReason {
118 NO_ERROR = 0;
119 INVALID_URL = 1;
120 DEVICE_BUSY = 2;
121 INSUFFICIENT_SPACE = 3;
122 UNKNOWN_ERROR = 4;
William Kurkiandaa6bb22019-03-07 12:26:28 -0500123 CANCELLED = 5;
khenaidooabad44c2018-08-03 16:58:35 -0400124 }
125
126 enum ImageActivateState {
127 IMAGE_UNKNOWN = 0;
128 IMAGE_INACTIVE = 1;
William Kurkiandaa6bb22019-03-07 12:26:28 -0500129 IMAGE_ACTIVATE = 2;
khenaidooabad44c2018-08-03 16:58:35 -0400130 IMAGE_ACTIVE = 3;
William Kurkiandaa6bb22019-03-07 12:26:28 -0500131 IMAGE_REVERT = 4;
khenaidooabad44c2018-08-03 16:58:35 -0400132 }
133
134 // Device Identifier
135 string id = 1;
136
137 // Image unique identifier
138 string name = 2;
139
140 // URL where the image is available
141 // should include username password
142 string url = 3;
143
144 // CRC of the image to be verified aginst
145 uint32 crc = 4;
146
147 // Download state
Stephane Barbariedf5479f2019-01-29 22:13:00 -0500148 ImageDownloadState download_state = 5;
khenaidooabad44c2018-08-03 16:58:35 -0400149
150 // Downloaded version
151 string image_version = 6;
152
153 // Bytes downloaded
154 uint32 downloaded_bytes = 7;
155
156 // Download failure reason
157 ImageDownloadFailureReason reason= 8;
158
159 // Additional info
160 string additional_info = 9;
161
162 // Save current configuration
163 bool save_config = 10;
164
165 // Image local location
166 string local_dir = 11;
167
168 // Image activation state
169 ImageActivateState image_state = 12;
William Kurkiandaa6bb22019-03-07 12:26:28 -0500170
171 // Image file size
172 uint32 file_size = 13;
khenaidooabad44c2018-08-03 16:58:35 -0400173}
174
175message ImageDownloads {
176 repeated ImageDownload items = 2;
177}
178
179message Port {
180 option (voltha.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
181
182 enum PortType {
183 UNKNOWN = 0;
184 ETHERNET_NNI = 1;
185 ETHERNET_UNI = 2;
186 PON_OLT = 3;
187 PON_ONU = 4;
188 VENET_OLT = 5;
189 VENET_ONU = 6;
190 }
191
192 uint32 port_no = 1; // Device-unique port number
193
194 string label = 2; // Arbitrary port label
195
196 PortType type = 3; // Type of port
197
198 AdminState.AdminState admin_state = 5;
199
200 OperStatus.OperStatus oper_status = 6;
201
202 string device_id = 7; // Unique .id of device that owns this port
203
204 message PeerPort {
205 string device_id = 1;
206 uint32 port_no = 2;
207 }
208 repeated PeerPort peers = 8;
209
William Kurkiandaa6bb22019-03-07 12:26:28 -0500210 fixed64 rx_packets = 9;
211 fixed64 rx_bytes = 10;
212 fixed64 rx_errors = 11;
213 fixed64 tx_packets = 12;
214 fixed64 tx_bytes = 13;
215 fixed64 tx_errors = 14;
216
khenaidooabad44c2018-08-03 16:58:35 -0400217}
218
219message Ports {
220 repeated Port items = 1;
221}
222
223// A Physical Device instance
224message Device {
225 option (voltha.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
226
227 // Voltha's device identifier
228 string id = 1 [(access) = READ_ONLY];
229
230 // Device type, refers to one of the registered device types
231 string type = 2 [(access) = READ_ONLY];
232
233 // Is this device a root device. Each logical switch has one root
234 // device that is associated with the logical flow switch.
235 bool root = 3 [(access) = READ_ONLY];
236
237 // Parent device id, in the device tree (for a root device, the parent_id
238 // is the logical_device.id)
239 string parent_id = 4 [(access) = READ_ONLY];
240 uint32 parent_port_no = 20 [(access) = READ_ONLY];
241
242 // Vendor, version, serial number, etc.
243 string vendor = 5 [(access) = READ_ONLY];
244 string model = 6 [(access) = READ_ONLY];
245 string hardware_version = 7 [(access) = READ_ONLY];
246 string firmware_version = 8 [(access) = READ_ONLY];
247 // List of software on the device
248 Images images = 9 [(access) = READ_ONLY];
249 string serial_number = 10 [(access) = READ_ONLY];
250 string vendor_id = 24 [(access) = READ_ONLY];
251
252 // Addapter that takes care of device
253 string adapter = 11 [(access) = READ_ONLY];
254
255 // Device contact on vlan (if 0, no vlan)
256 uint32 vlan = 12;
257
258 message ProxyAddress {
259 string device_id = 1; // Which device to use as proxy to this device
khenaidoo6fdf0ba2018-11-02 14:38:33 -0400260 string device_type = 2; // The device type of the proxy device to use as the adapter name
261 uint32 channel_id = 3; // Sub-address within proxy
262 uint32 channel_group_id = 4; // Channel Group index
263 string channel_termination = 5; // Channel Termination name
264 uint32 onu_id = 6; // onu identifier; optional
265 uint32 onu_session_id = 7; // session identifier for the ONU; optional
khenaidooabad44c2018-08-03 16:58:35 -0400266 };
267
khenaidoob9203542018-09-17 22:56:37 -0400268 oneof address {
William Kurkiandaa6bb22019-03-07 12:26:28 -0500269 // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
270 string mac_address = 13;
271
khenaidooabad44c2018-08-03 16:58:35 -0400272 // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too)
273 string ipv4_address = 14;
274
275 // Device contact IPv6 address using the canonical string form
276 // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
277 string ipv6_address = 15;
278
279 string host_and_port = 21;
280
281 };
282 string extra_args = 23; // Used to pass additional device specific arguments
283
284 ProxyAddress proxy_address = 19;
285
286 AdminState.AdminState admin_state = 16;
287
288 OperStatus.OperStatus oper_status = 17 [(access) = READ_ONLY];
289
290 string reason = 22 [(access) = READ_ONLY]; // Used in FAILED state
291
292 ConnectStatus.ConnectStatus connect_status = 18 [(access) = READ_ONLY];
293
294 // TODO additional common attribute here
295
296 // Device type specific attributes
297 google.protobuf.Any custom = 64;
298
299 repeated Port ports = 128 [(child_node) = {key: "port_no"}];
300 openflow_13.Flows flows = 129 [(child_node) = {}];
301 openflow_13.FlowGroups flow_groups = 130 [(child_node) = {}];
302 // PmConfigs will eventually converted to a child node of the
303 // device to falicitata callbacks and to simplify manipulation.
304 PmConfigs pm_configs = 131 [(child_node) = {}];
305
306 repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}];
307}
308
309message Devices {
310 repeated Device items = 1;
311}
William Kurkiandaa6bb22019-03-07 12:26:28 -0500312
313message SimulateAlarmRequest {
314 enum OperationType {
315 RAISE = 0;
316 CLEAR = 1;
317 }
318 // Device Identifier
319 string id = 1;
320 string indicator = 2;
321 string intf_id = 3;
322 string port_type_name = 4;
323 string onu_device_id = 5;
324 int32 inverse_bit_error_rate = 6;
325 int32 drift = 7;
326 int32 new_eqd = 8;
327 string onu_serial_number = 9;
328 OperationType operation = 10;
329}