blob: 30baf344562f30a2146d005598871c7e5fe673a4 [file] [log] [blame]
Zsolt Haraszti00d9a842016-11-23 11:18:23 -08001syntax = "proto3";
2
3package voltha;
4
5import "meta.proto";
6import "google/protobuf/any.proto";
Zsolt Haraszti66862032016-11-28 14:28:39 -08007import "common.proto";
Zsolt Haraszti00d9a842016-11-23 11:18:23 -08008import "openflow_13.proto";
Khen Nursimulua4972742016-12-23 17:15:20 -05009import "yang_options.proto";
Nikolay Titov89004ec2017-06-19 18:22:42 -040010import "bbf_fiber_base.proto";
Zsolt Haraszti00d9a842016-11-23 11:18:23 -080011
12// A Device Type
13message DeviceType {
14
15 // Unique name for the device type
16 string id = 1;
17
Niren R Chidrawarefcebcd2017-07-19 20:03:39 -040018 // Unique venor id for the device type applicable to ONU
19 // 4 bytes of vendor id from ONU serial number
20 string vendor_id = 5;
21
Zsolt Haraszti00d9a842016-11-23 11:18:23 -080022 // Name of the adapter that handles device type
23 string adapter = 2;
24
Zsolt Harasztic5c5d102016-12-07 21:12:27 -080025 // Capabilitities
26
27 bool accepts_bulk_flow_update = 3;
28 bool accepts_add_remove_flow_updates = 4;
Zsolt Haraszti00d9a842016-11-23 11:18:23 -080029
30}
31
32// A plurality of device types
33message DeviceTypes {
34 repeated DeviceType items = 1;
35}
36
Sergio Slobodriana2eb52b2017-03-07 12:24:46 -050037message PmConfig {
38 enum PmType {
39 COUNTER = 0;
40 GUAGE = 1;
41 STATE = 2;
42 }
43 string name = 1;
44 PmType type = 2;
45 bool enabled = 3; // Whether or not this metric makes it to Kafka
46 uint32 sample_freq = 4; // Sample rate in 10ths of a second
47}
48
49message PmGroupConfig {
50 string group_name = 1;
51 uint32 group_freq = 2; // Frequency applicable to the grop
52 bool enabled = 3; // Enable/disable group level only
53 repeated PmConfig metrics = 4;
54}
55
56message PmConfigs {
Sergio Slobodrian2db4c102017-03-09 22:29:23 -050057 string id = 1; // To work around a chameleon POST bug
58 uint32 default_freq = 2; // Default sample rate
Sergio Slobodriana2eb52b2017-03-07 12:24:46 -050059 // Forces group names and group semantics
Sergio Slobodrian2db4c102017-03-09 22:29:23 -050060 bool grouped = 3 [(access) = READ_ONLY];
Sergio Slobodriana2eb52b2017-03-07 12:24:46 -050061 // Allows Pm to set an individual sample frequency
Sergio Slobodrian2db4c102017-03-09 22:29:23 -050062 bool freq_override = 4 [(access) = READ_ONLY];
63 repeated PmGroupConfig groups = 5; // The groups if grouped is true
64 repeated PmConfig metrics = 6; // The metrics themselves if grouped is false.
Sergio Slobodriana2eb52b2017-03-07 12:24:46 -050065}
66
ggowdru236bd952017-06-20 20:32:55 -070067// Describes instance of software image on the device
68message Image {
69 string name = 1; // software patch name
70 string version = 2; // version of software
71 string hash = 3; // md5 hash
72 string install_datetime = 4; // combined date and time expressed in UTC.
73 // use ISO 8601 format for date and time
74
75 // The active software image is one that is currently loaded and executing
76 // in the ONU or circuit pack. Under normal operation, one software image
77 // is always active while the other is inactive. Under no circumstances are
78 // both software images allowed to be active at the same time
79 bool is_active = 5; // True if the image is active
80
81 // The committed software image is loaded and executed upon reboot of the
82 // ONU and/or circuit pack. During normal operation, one software image is
83 // always committed, while the other is uncommitted.
84 bool is_committed = 6; // True if the image is committed
85
86 // A software image is valid if it has been verified to be an executable
87 // code image. The verification mechanism is not subject to standardization;
88 // however, it should include at least a data integrity (e.g., CRC) check of
89 // the entire code image.
90 bool is_valid = 7; // True if the image is valid
91}
92
93// List of software on the device
94message Images {
95 repeated Image image = 1;
96}
97
Lydia Fang01f2e852017-06-28 17:24:58 -070098message ImageDownload {
99 option (yang_child_rule) = MOVE_TO_PARENT_LEVEL;
100
101 enum ImageDownloadState {
102 DOWNLOAD_UNKNOWN = 0;
103 DOWNLOAD_SUCCEEDED = 1;
104 DOWNLOAD_REQUESTED = 2;
105 DOWNLOAD_STARTED = 3;
106 DOWNLOAD_FAILED = 4;
107 DOWNLOAD_UNSUPPORTED = 5;
108 }
109
110 enum ImageDownloadFailureReason {
111 NO_ERROR = 0;
112 INVALID_URL = 1;
113 DEVICE_BUSY = 2;
114 INSUFFICIENT_SPACE = 3;
115 UNKNOWN_ERROR = 4;
116 }
117
118 enum ImageActivateState {
119 IMAGE_UNKNOWN = 0;
120 IMAGE_INACTIVE = 1;
121 IMAGE_ACTIVATE = 2;
122 IMAGE_ACTIVE = 3;
123 IMAGE_REVERT = 4;
124 }
125
126 // Device Identifier
127 string id = 1;
128
129 // Image unique identifier
130 string name = 2;
131
132 // URL where the image is available
133 // should include username password
134 string url = 3;
135
136 // CRC of the image to be verified aginst
137 uint32 crc = 4;
138
139 // Download state
140 ImageDownloadState state = 5;
141
142 // Downloaded version
143 string image_version = 6;
144
145 // Bytes downloaded
146 uint32 downloaded_bytes = 7;
147
148 // Download failure reason
149 ImageDownloadFailureReason reason= 8;
150
151 // Additional info
152 string additional_info = 9;
153
154 // Save current configuration
155 bool save_config = 10;
156
157 // Image local location
158 string local_dir = 11;
159
160 // Image activation state
161 ImageActivateState image_state = 12;
162}
163
164message ImageDownloads {
165 repeated ImageDownload items = 2;
166}
167
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800168message Port {
Khen Nursimulua4972742016-12-23 17:15:20 -0500169 option (voltha.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
Zsolt Haraszti66862032016-11-28 14:28:39 -0800170
171 enum PortType {
172 UNKNOWN = 0;
173 ETHERNET_NNI = 1;
174 ETHERNET_UNI = 2;
175 PON_OLT = 3;
176 PON_ONU = 4;
Niren R Chidrawarfc1bf6e2017-09-26 19:39:54 -0400177 VENET_OLT = 5;
178 VENET_ONU = 6;
Zsolt Haraszti66862032016-11-28 14:28:39 -0800179 }
180
181 uint32 port_no = 1; // Device-unique port number
182
183 string label = 2; // Arbitrary port label
184
185 PortType type = 3; // Type of port
186
187 AdminState.AdminState admin_state = 5;
188
189 OperStatus.OperStatus oper_status = 6;
190
191 string device_id = 7; // Unique .id of device that owns this port
192
193 message PeerPort {
194 string device_id = 1;
195 uint32 port_no = 2;
196 }
197 repeated PeerPort peers = 8;
198
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800199}
200
201message Ports {
202 repeated Port items = 1;
203}
204
205// A Physical Device instance
206message Device {
Khen Nursimulua4972742016-12-23 17:15:20 -0500207 option (voltha.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800208
209 // Voltha's device identifier
Zsolt Haraszti66862032016-11-28 14:28:39 -0800210 string id = 1 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800211
212 // Device type, refers to one of the registered device types
Zsolt Haraszti66862032016-11-28 14:28:39 -0800213 string type = 2 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800214
215 // Is this device a root device. Each logical switch has one root
216 // device that is associated with the logical flow switch.
Zsolt Haraszti66862032016-11-28 14:28:39 -0800217 bool root = 3 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800218
Zsolt Haraszti66862032016-11-28 14:28:39 -0800219 // Parent device id, in the device tree (for a root device, the parent_id
220 // is the logical_device.id)
221 string parent_id = 4 [(access) = READ_ONLY];
222 uint32 parent_port_no = 20 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800223
224 // Vendor, version, serial number, etc.
Zsolt Haraszti66862032016-11-28 14:28:39 -0800225 string vendor = 5 [(access) = READ_ONLY];
226 string model = 6 [(access) = READ_ONLY];
227 string hardware_version = 7 [(access) = READ_ONLY];
228 string firmware_version = 8 [(access) = READ_ONLY];
ggowdru236bd952017-06-20 20:32:55 -0700229 // List of software on the device
230 Images images = 9 [(access) = READ_ONLY];
Zsolt Haraszti66862032016-11-28 14:28:39 -0800231 string serial_number = 10 [(access) = READ_ONLY];
Niren R Chidrawarefcebcd2017-07-19 20:03:39 -0400232 string vendor_id = 24 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800233
234 // Addapter that takes care of device
Zsolt Haraszti66862032016-11-28 14:28:39 -0800235 string adapter = 11 [(access) = READ_ONLY];
236
237 // Device contact on vlan (if 0, no vlan)
238 uint32 vlan = 12;
239
Zsolt Harasztic5c5d102016-12-07 21:12:27 -0800240 message ProxyAddress {
Zsolt Haraszti66862032016-11-28 14:28:39 -0800241 string device_id = 1; // Which device to use as proxy to this device
alshabib38ba2032017-03-14 11:19:58 +0100242 uint32 channel_id = 2; // Sub-address within proxy
Sireesha Kora3f3788f2017-08-18 01:18:53 -0400243 uint32 channel_group_id = 5; // Channel Group index
244 string channel_termination = 6; // Channel Termination name
alshabib38ba2032017-03-14 11:19:58 +0100245 uint32 onu_id = 3; // onu identifier; optional
alshabib1ef322b2017-03-16 10:39:59 +0100246 uint32 onu_session_id = 4; // session identifier for the ONU; optional
Zsolt Haraszti66862032016-11-28 14:28:39 -0800247 };
248
249 oneof address {
250 // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
251 string mac_address = 13;
252
253 // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too)
254 string ipv4_address = 14;
255
256 // Device contact IPv6 address using the canonical string form
257 // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
258 string ipv6_address = 15;
259
Zsolt Haraszti656ecc62016-12-28 15:08:23 -0800260 string host_and_port = 21;
261
Zsolt Haraszti66862032016-11-28 14:28:39 -0800262 };
Chip Boling90b224d2017-06-02 11:51:48 -0500263 string extra_args = 23; // Used to pass additional device specific arguments
Zsolt Haraszti66862032016-11-28 14:28:39 -0800264
Zsolt Haraszti348d1932016-12-10 01:10:07 -0800265 ProxyAddress proxy_address = 19;
266
Zsolt Haraszti66862032016-11-28 14:28:39 -0800267 AdminState.AdminState admin_state = 16;
268
269 OperStatus.OperStatus oper_status = 17 [(access) = READ_ONLY];
270
Zsolt Haraszti656ecc62016-12-28 15:08:23 -0800271 string reason = 22 [(access) = READ_ONLY]; // Used in FAILED state
272
Zsolt Haraszti66862032016-11-28 14:28:39 -0800273 ConnectStatus.ConnectStatus connect_status = 18 [(access) = READ_ONLY];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800274
275 // TODO additional common attribute here
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800276
277 // Device type specific attributes
278 google.protobuf.Any custom = 64;
279
Zsolt Haraszti66862032016-11-28 14:28:39 -0800280 repeated Port ports = 128 [(child_node) = {key: "port_no"}];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800281 openflow_13.Flows flows = 129 [(child_node) = {}];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800282 openflow_13.FlowGroups flow_groups = 130 [(child_node) = {}];
Sergio Slobodrian71960022017-03-09 10:20:57 -0500283 // PmConfigs will eventually converted to a child node of the
284 // device to falicitata callbacks and to simplify manipulation.
Sergio Slobodrian2db4c102017-03-09 22:29:23 -0500285 PmConfigs pm_configs = 131 [(child_node) = {}];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800286
Nikolay Titov89004ec2017-06-19 18:22:42 -0400287 // Channel Terminations for the OLT device
288 repeated bbf_fiber.ChannelterminationConfig channel_terminations = 132 [(child_node) = {key: "name"}];
289
Lydia Fang01f2e852017-06-28 17:24:58 -0700290 repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}];
Zsolt Haraszti00d9a842016-11-23 11:18:23 -0800291}
292
293message Devices {
294 repeated Device items = 1;
295}