blob: b88ba261f80bb6ea86c791c94ae7d3843f09ccbc [file] [log] [blame]
Sean Condonfae8e662016-12-15 10:25:13 +00001module ietf-system-microsemi {
2
3 namespace "http://www.microsemi.com/microsemi-edge-assure/msea-system";
4 prefix "sys-ms";
5
6 import ietf-yang-types {
7 prefix yang;
8 revision-date 2013-07-15;
9 }
10
11 import ietf-inet-types {
12 prefix inet;
13 revision-date 2013-07-15;
14 }
15
16 import msea-types {
17 prefix msea;
18 revision-date 2016-02-29;
19 }
20
21 import ietf-system {
22 prefix sys;
23 revision-date 2014-08-06;
24 }
25
26 import ietf-netconf-acm {
27 prefix nacm;
28 revision-date 2012-02-22;
29 }
30
31 /*** META INFORMATION ***/
32
33 organization
34 "Microsemi Inc., FTD Division";
35
36 contact
37 "Web URL: http://www.microsemi.com/
38 E-mail: info@microsemi.com
39 Postal: Microsemi Corporation Corporate Headquarters
40 One Enterprise Aliso Viejo,
41 CA 92656
42 U.S.A.
43 Phone: +1 949 380 6100
44 Fax: +1 949 215-4996";
45
46 description
47 "This YANG module extends the IETF System objects with some extra configuration attributes
48
49 Copyright 2015 Microsemi Inc.
50 All rights reserved.";
51
52 reference "RFC 7317: A YANG Data Model for System Management";
53
54 revision "2016-05-05" {
55 description
56 "Updated for ZTP support - Sean Condon, Microsemi";
57 }
58
59 revision "2015-10-01" {
60 description
61 "Initial version to augment IETF-SYSTEM YANG module - Sean Condon, Microsemi";
62 }
63
64 typedef identifier {
65 type string {
66 length "1..255";
67 pattern "[a-zA-Z0-9\-._]*";
68 }
69 description
70 "A simple string with only alphabetic or numeric and dash, dot and underscore";
71 }
72
73 grouping upgrade-file-attributes {
74 leaf file-name {
75 type string;
76 description "The name of the update TAR file as found on the device";
77 }
78
79 leaf file-date {
80 type yang:date-and-time;
81 description "The date of the update TAR file as found on the device";
82 }
83
84 leaf file-size {
85 type uint32;
86 description "The size of the update TAR file as found on the device";
87 }
88 }
89
90
91 grouping upgrade-attributes {
92 description "Attributes from the /update.tar file";
93
94 leaf version {
95 type uint32;
96 description "The version of this portion of the /update.tar";
97 }
98
99 leaf crc32 {
100 type uint32;
101 description "The CRC32 value of this portion of the /update.tar";
102 }
103
104 leaf length {
105 type uint32;
106 description "The length of this portion of the /update.tar";
107 }
108 }
109
110 grouping ddm-attributes {
111
112 leaf high-alarm-thresh {
113 description "The high alarm threshold value";
114 type decimal64 {
115 fraction-digits 6;
116 }
117 }
118
119 leaf high-warn-thresh {
120 description "The high warn threshold value";
121 type decimal64 {
122 fraction-digits 6;
123 }
124 }
125
126 leaf low-warn-thresh {
127 description "The low warn threshold value";
128 type decimal64 {
129 fraction-digits 6;
130 }
131 }
132
133 leaf low-alarm-thresh {
134 description "The low alarm threshold value";
135 type decimal64 {
136 fraction-digits 6;
137 }
138 }
139 }
140
141 feature serial-number {
142 description "Set of readonly attributes that identify the hardware";
143 }
144
145 feature remote-upgrade {
146 description
147 "Indicates that the device supports upgrade of fabric, linux and fabric header.
148 This expects a file /update.tar on the device -
149 put there through SFTP or some other file transfer method";
150 }
151
152
153 augment "/sys:system" {
154 description
155 "Extends the SYSTEM with some extra configuration attributes required for setup.";
156
157 leaf asset-tag { //Microsemi specific configuration attribute
158 type identifier;
159 description
160 "An asset tag field for the device.";
161 }
162
163 leaf description { //Microsemi specific configuration attribute
164 type string {
165 length "0..256";
166 pattern "[a-zA-Z0-9\\-_. ,]*";
167 }
168 description "A description for the device.";
169 }
170
171 leaf longitude { //Microsemi specific configuration attribute
172 type decimal64 {
173 fraction-digits 7;
174 range "-180..180";
175 }
176 description
177 "Longitude for the device expressed in decimal degrees.
178 Positive values represent East and negative values represent West";
179 }
180
181 leaf latitude { //Microsemi specific configuration attribute
182 type decimal64 {
183 fraction-digits 7;
184 range "-90..90";
185 }
186 description
187 "Latitude for the device expressed in decimal degrees
188 Positive values represent North and negative values represent South";
189 }
190 }
191
192
193 augment "/sys:system-state" {
194 description
195 "Extends the SYSTEM-STATE with some extra configuration attributes required for setup.
196
197 All attributes are automatically config=false because they extend system-state";
198
199 container remote-upgrade {
200 description "Details of the /update.tar file present on the system.
201 These are all read-only because they are under system-state";
202
203 choice file-present-choice {
204 case not-present {
205 leaf file-not-found {
206 type string;
207 description "Gives the name of the expected file. Usually /update.tar";
208 }
209 }
210
211 case file-present {
212 uses upgrade-file-attributes;
213
214 leaf file-validity {
215 type string;
216 description "Gives an indication if the file is valid, or if not, the reason why";
217 }
218
219 container fabric-image {
220 uses upgrade-attributes;
221 }
222
223 container linux-image {
224 uses upgrade-attributes;
225 }
226 }
227 }
228 }
229
230 leaf hostname {
231 type string;
232 description "The hostname of the system. When DHCP or ZTP
233 is active the hostname will not be configured through NETCONF";
234 }
235
236 container ntp {
237 if-feature sys:ntp;
238 description "The list of NTP servers active on the system. When DHCP or ZTP
239 is active the NTP servers will not be configured through NETCONF";
240
241 leaf-list server {
242 type string;
243 description "An NTP server active on the system";
244 }
245 }
246
247 container dns-resolver {
248 description "The list of DNS servers active on the system. When DHCP or ZTP
249 is active the DNS servers will not be configured through NETCONF";
250
251 leaf-list server {
252 type string;
253 description "A DNS server active on the system";
254 }
255
256 leaf-list search {
257 type string;
258 description "A DNS search domain active on the system";
259 }
260
261 }
262
263 container diagnostic-monitoring {
264
265 container temperature {
266 description "The temperature and thresholds of the device";
267
268 leaf measured {
269 description "The measured transceiver temperature at the current time";
270 type decimal64 {
271 fraction-digits 6;
272 }
273 units "°C";
274 reference
275 "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
276 Transceivers Rev 12.1 September 12, 2014 Section 9.1";
277 }
278
279 uses ddm-attributes;
280 }
281
282 container voltage {
283 description "The core voltage and thresholds of the device";
284
285 leaf measured {
286 description "The measured voltage at the current time";
287 type decimal64 {
288 fraction-digits 6;
289 }
290 units "V";
291 reference
292 "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
293 Transceivers Rev 12.1 September 12, 2014 Section 9.1";
294 }
295
296 uses ddm-attributes;
297 }
298
299 container tx-bias {
300 description "The transmit (Tx) bias and thresholds of the device";
301
302 leaf measured {
303 description "The measured transmit (Tx) bias at the current time";
304 type decimal64 {
305 fraction-digits 6;
306 }
307 units "mA";
308 reference
309 "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
310 Transceivers Rev 12.1 September 12, 2014 Section 9.1";
311 }
312
313 uses ddm-attributes;
314 }
315
316 container tx-power {
317 description "The transmit (Tx) power and thresholds of the device";
318
319 leaf measured {
320 description "The measured transmit (Tx) power at the current time";
321 type decimal64 {
322 fraction-digits 6;
323 }
324 units "mV";
325 reference
326 "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
327 Transceivers Rev 12.1 September 12, 2014 Section 9.1";
328 }
329
330 uses ddm-attributes;
331 }
332
333 container rx-power {
334 description "The receive (Rx) power and thresholds of the device";
335
336 leaf measured {
337 description "The measured receive (Rx) power at the current time";
338 type decimal64 {
339 fraction-digits 6;
340 }
341 units "mV";
342 reference
343 "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
344 Transceivers Rev 12.1 September 12, 2014 Section 9.1";
345 }
346
347 uses ddm-attributes;
348 }
349 }
350 }
351
352 augment "/sys:system-state/sys:platform" {
353 description
354 "Extends the SYSTEM-STATE with some extra configuration attributes required for setup.
355
356 All attributes are automatically config=false because they extend system-state";
357
358 container device-identification {
359 if-feature serial-number;
360 config false;
361
362 leaf vendor-name {
363 type string;
364 description
365 "Device Vendor Name";
366 reference
367 "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
368 Transceivers Rev 12.1 September 12, 2014 Table 4-1 Address A0H Bytes 20-35";
369 }
370
371 leaf vendor-part-number {
372 type string;
373 description
374 "Device Vendor Part Number";
375 reference
376 "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
377 Transceivers Rev 12.1 September 12, 2014 Table 4-1 Address A0H Bytes 40-55";
378 }
379
380 leaf vendor-revision {
381 type string;
382 description
383 "Device Vendor Revision";
384 reference
385 "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
386 Transceivers Rev 12.1 September 12, 2014 Table 4-1 Address A0H Bytes 56-59";
387 }
388
389 leaf serial-number {
390 type string;
391 description
392 "Device Serial Number";
393 reference
394 "SFF-8472 Specification for Diagnostic Monitoring Interface for Optical
395 Transceivers Rev 12.1 September 12, 2014 Table 4-1 Address A0H Bytes 68-83";
396 }
397
398 container processor {
399 description "Details of the processor hardware in the device";
400
401 leaf serialnumber {
402 type yang:hex-string;
403 description "The serial number of the processor";
404 }
405
406 leaf x509-device-certificate-pem {
407 type string;
408 description "X509 Device certificate in PEM (Base 64 format)";
409 }
410 }
411 }
412 }
413
414 rpc do-upgrade-and-reboot {
415// nacm:default-deny-all;
416 if-feature remote-upgrade;
417
418 description "Method to perform an upgrade of the device. This
419 expects a file /update.tar to have be present on the device.
420 The system-state/remote-upgrade attributes can be used to
421 verify the contents of the file before calling this action.
422 If there is a problem performing the upgrade
423 these will be described in any error thrown";
424
425 input {
426 leaf reset-option {
427 type enumeration {
428 enum nuclear {
429 description "Erases all configuration and resets the device to
430 factory defaults.";
431 }
432 enum allnetconf {
433 description "Reset all NETCONF data - leaves only logs and SSH keys.
434 If a lesser reset is required use system-restart with a
435 suitable reset-option";
436 }
437 }
438 description "Optionally specify a parameter that can be
439 used to reset the device to factory defaults";
440 }
441 }
442
443 output {
444 anyxml data {
445 description "A message describing the result.
446 The result might not be seen as it schedules a reboot of the device";
447 }
448 }
449 }
450
451
452 rpc pull-update-tar-from-tftp {
453// nacm:default-deny-all;
454 if-feature remote-upgrade;
455
456 description "Pulls a specified file from the specifed host and copies it
457 to the local device (usually at /update.tar
458 It also expects the file to be signed with GnuPG and the signature
459 file to exist on the TFTP server at <tftp-file>.asc";
460
461 input {
462 leaf tftp-file {
463 type msea:file-name;
464 mandatory true;
465 description "The name of a file to pull from the TFTP server at the host name specified";
466 }
467
468 leaf tftp-host {
469 type inet:host;
470 mandatory true;
471 description "The hostname of a TFTP server where an update TAR file can be pulled from";
472 }
473 }
474 }
475
476 rpc read-from-syslog {
477 description "A method of reading the entries from syslog. If no
478 argument is given will read the last 100 lines";
479
480 input {
481 leaf start-line {
482 type int16 {
483 range -10000..-1;
484 }
485 default -100;
486 description "The number of lines to read from the end of syslog.";
487 }
488 }
489
490 output {
491 anyxml data {
492 description "Syslog entries represented as XML";
493 }
494 }
495 }
496
497// notification upgrade-notification {
498// description
499// "Generated when a remote upgrade is in progress.";
500//
501// leaf upgrade-stage {
502// type enumeration {
503// enum "check" {
504// description
505// "Checking the upgrade file is valid";
506// }
507// enum "erase" {
508// description "Erasing old image";
509// }
510// enum "write" {
511// description "Writing new image";
512// }
513// enum "complete" {
514// description "Upgrade complete";
515// }
516// }
517// mandatory true;
518// }
519//
520// leaf upgrade-detail {
521// description "Textual description of the stage of upgrade";
522// type string {
523// length 0..100;
524// }
525// }
526// } // upgrade-notification
527}