blob: 902a58c158e1b60bd5a0258b0b41cc1845785da8 [file] [log] [blame]
khenaidooabad44c2018-08-03 16:58:35 -04001syntax = "proto3";
2
3option go_package = "github.com/opencord/voltha-go/protos/voltha";
4
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
20 // 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
24 repeated string vendor_ids = 6;
25
26 // Name of the adapter that handles device type
27 string adapter = 2;
28
29 // Capabilitities
30
31 bool accepts_bulk_flow_update = 3;
32 bool accepts_add_remove_flow_updates = 4;
Arun Arora5f89fb62018-12-19 08:25:54 +000033 bool accepts_direct_logical_flows_update = 7;
khenaidooabad44c2018-08-03 16:58:35 -040034
35}
36
37// A plurality of device types
38message DeviceTypes {
39 repeated DeviceType items = 1;
40}
41
42message PmConfig {
43 enum PmType {
44 COUNTER = 0;
45 GUAGE = 1;
46 STATE = 2;
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.
70}
71
72// Describes instance of software image on the device
73message Image {
74 string name = 1; // software patch name
75 string version = 2; // version of software
76 string hash = 3; // md5 hash
77 string install_datetime = 4; // combined date and time expressed in UTC.
78 // use ISO 8601 format for date and time
79
80 // The active software image is one that is currently loaded and executing
81 // in the ONU or circuit pack. Under normal operation, one software image
82 // is always active while the other is inactive. Under no circumstances are
83 // both software images allowed to be active at the same time
84 bool is_active = 5; // True if the image is active
85
86 // The committed software image is loaded and executed upon reboot of the
87 // ONU and/or circuit pack. During normal operation, one software image is
88 // always committed, while the other is uncommitted.
89 bool is_committed = 6; // True if the image is committed
90
91 // A software image is valid if it has been verified to be an executable
92 // code image. The verification mechanism is not subject to standardization;
93 // however, it should include at least a data integrity (e.g., CRC) check of
94 // the entire code image.
95 bool is_valid = 7; // True if the image is valid
96}
97
98// List of software on the device
99message Images {
100 repeated Image image = 1;
101}
102
103message ImageDownload {
104 option (yang_child_rule) = MOVE_TO_PARENT_LEVEL;
105
106 enum ImageDownloadState {
107 DOWNLOAD_UNKNOWN = 0;
108 DOWNLOAD_SUCCEEDED = 1;
109 DOWNLOAD_REQUESTED = 2;
110 DOWNLOAD_STARTED = 3;
111 DOWNLOAD_FAILED = 4;
112 DOWNLOAD_UNSUPPORTED = 5;
khenaidoof5a5bfa2019-01-23 22:20:29 -0500113 DOWNLOAD_CANCELLED = 6;
khenaidooabad44c2018-08-03 16:58:35 -0400114 }
115
116 enum ImageDownloadFailureReason {
117 NO_ERROR = 0;
118 INVALID_URL = 1;
119 DEVICE_BUSY = 2;
120 INSUFFICIENT_SPACE = 3;
121 UNKNOWN_ERROR = 4;
122 }
123
124 enum ImageActivateState {
125 IMAGE_UNKNOWN = 0;
126 IMAGE_INACTIVE = 1;
khenaidoof5a5bfa2019-01-23 22:20:29 -0500127 IMAGE_ACTIVATING = 2;
khenaidooabad44c2018-08-03 16:58:35 -0400128 IMAGE_ACTIVE = 3;
khenaidoof5a5bfa2019-01-23 22:20:29 -0500129 IMAGE_REVERTING = 4;
130 IMAGE_REVERTED = 5;
khenaidooabad44c2018-08-03 16:58:35 -0400131 }
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;
169}
170
171message ImageDownloads {
172 repeated ImageDownload items = 2;
173}
174
175message Port {
176 option (voltha.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
177
178 enum PortType {
179 UNKNOWN = 0;
180 ETHERNET_NNI = 1;
181 ETHERNET_UNI = 2;
182 PON_OLT = 3;
183 PON_ONU = 4;
184 VENET_OLT = 5;
185 VENET_ONU = 6;
186 }
187
188 uint32 port_no = 1; // Device-unique port number
189
190 string label = 2; // Arbitrary port label
191
192 PortType type = 3; // Type of port
193
194 AdminState.AdminState admin_state = 5;
195
196 OperStatus.OperStatus oper_status = 6;
197
198 string device_id = 7; // Unique .id of device that owns this port
199
200 message PeerPort {
201 string device_id = 1;
202 uint32 port_no = 2;
203 }
204 repeated PeerPort peers = 8;
205
206}
207
208message Ports {
209 repeated Port items = 1;
210}
211
212// A Physical Device instance
213message Device {
214 option (voltha.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
215
216 // Voltha's device identifier
217 string id = 1 [(access) = READ_ONLY];
218
219 // Device type, refers to one of the registered device types
220 string type = 2 [(access) = READ_ONLY];
221
222 // Is this device a root device. Each logical switch has one root
223 // device that is associated with the logical flow switch.
224 bool root = 3 [(access) = READ_ONLY];
225
226 // Parent device id, in the device tree (for a root device, the parent_id
227 // is the logical_device.id)
228 string parent_id = 4 [(access) = READ_ONLY];
229 uint32 parent_port_no = 20 [(access) = READ_ONLY];
230
231 // Vendor, version, serial number, etc.
232 string vendor = 5 [(access) = READ_ONLY];
233 string model = 6 [(access) = READ_ONLY];
234 string hardware_version = 7 [(access) = READ_ONLY];
235 string firmware_version = 8 [(access) = READ_ONLY];
236 // List of software on the device
237 Images images = 9 [(access) = READ_ONLY];
238 string serial_number = 10 [(access) = READ_ONLY];
239 string vendor_id = 24 [(access) = READ_ONLY];
240
241 // Addapter that takes care of device
242 string adapter = 11 [(access) = READ_ONLY];
243
244 // Device contact on vlan (if 0, no vlan)
245 uint32 vlan = 12;
246
247 message ProxyAddress {
248 string device_id = 1; // Which device to use as proxy to this device
khenaidoo6fdf0ba2018-11-02 14:38:33 -0400249 string device_type = 2; // The device type of the proxy device to use as the adapter name
250 uint32 channel_id = 3; // Sub-address within proxy
251 uint32 channel_group_id = 4; // Channel Group index
252 string channel_termination = 5; // Channel Termination name
253 uint32 onu_id = 6; // onu identifier; optional
254 uint32 onu_session_id = 7; // session identifier for the ONU; optional
khenaidooabad44c2018-08-03 16:58:35 -0400255 };
256
khenaidoob9203542018-09-17 22:56:37 -0400257 // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
258 string mac_address = 13;
khenaidooabad44c2018-08-03 16:58:35 -0400259
khenaidoob9203542018-09-17 22:56:37 -0400260 oneof address {
khenaidooabad44c2018-08-03 16:58:35 -0400261 // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too)
262 string ipv4_address = 14;
263
264 // Device contact IPv6 address using the canonical string form
265 // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
266 string ipv6_address = 15;
267
268 string host_and_port = 21;
269
270 };
271 string extra_args = 23; // Used to pass additional device specific arguments
272
273 ProxyAddress proxy_address = 19;
274
275 AdminState.AdminState admin_state = 16;
276
277 OperStatus.OperStatus oper_status = 17 [(access) = READ_ONLY];
278
279 string reason = 22 [(access) = READ_ONLY]; // Used in FAILED state
280
281 ConnectStatus.ConnectStatus connect_status = 18 [(access) = READ_ONLY];
282
283 // TODO additional common attribute here
284
285 // Device type specific attributes
286 google.protobuf.Any custom = 64;
287
288 repeated Port ports = 128 [(child_node) = {key: "port_no"}];
289 openflow_13.Flows flows = 129 [(child_node) = {}];
290 openflow_13.FlowGroups flow_groups = 130 [(child_node) = {}];
291 // PmConfigs will eventually converted to a child node of the
292 // device to falicitata callbacks and to simplify manipulation.
293 PmConfigs pm_configs = 131 [(child_node) = {}];
294
295 repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}];
296}
297
298message Devices {
299 repeated Device items = 1;
300}