Update docs conf.yaml version to Sulfur
[transportpce.git] / ordmodels / common / src / main / yang / org-openroadm-manifest-file@2020-03-27.yang
1 module org-openroadm-manifest-file {
2   namespace "http://org/openroadm/manifest-file";
3   prefix org-openroadm-manifest-file;
4
5   organization
6     "Open ROADM MSA";
7   contact
8     "OpenROADM.org";
9   description
10     "YANG definitions of sw-manifest-file
11
12      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2017,
13      All other rights reserved.
14
15      Redistribution and use in source and binary forms, with or without modification,
16      are permitted provided that the following conditions are met:
17
18      * Redistributions of source code must retain the above copyright notice, this
19        list of conditions and the following disclaimer.
20      * Redistributions in binary form must reproduce the above copyright notice,
21        this list of conditions and the following disclaimer in the documentation and/or
22        other materials provided with the distribution.
23      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
24        contributors may be used to endorse or promote products derived from this software
25        without specific prior written permission.
26
27      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
28      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
31      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
32      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
33      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36      POSSIBILITY OF SUCH DAMAGE.
37
38      Also contains code components extracted from IETF netconf.  These code components
39      are copyrighted and licensed as follows:
40
41      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
42      All rights reserved.
43
44      This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
45      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
46      publication of this document. Please review these documents carefully, as they
47      describe your rights and restrictions with respect to this document. Code Components
48      extracted from this document must include Simplified BSD License text as described in
49      Section 4.e of the Trust Legal Provisions and are provided without warranty as
50      described in the Simplified BSD License.";
51
52   revision 2020-03-27 {
53     description
54       "Version 7.0.0";
55   }
56   revision 2019-11-29 {
57     description
58       "Version 6.1.0";
59   }
60   revision 2018-11-30 {
61     description
62       "Version 4.1.0";
63   }
64   revision 2018-05-30 {
65     description
66       "Version 3.1.0";
67   }
68   revision 2017-12-15 {
69     description
70       "Version 2.2";
71   }
72   revision 2017-09-29 {
73     description
74       "Version 2.1";
75     reference
76       "This module serves as the manifest file reference.";
77   }
78
79   identity manifest-commands {
80     description
81       "base identity for defining manifest-commands.";
82   }
83
84   identity download-file {
85     base manifest-commands;
86     description
87       "download-file (transfer from OWB-C to Device)";
88   }
89
90   identity upload-file {
91     base manifest-commands;
92     description
93       "upload-file (transfer from Device to OWB-C)";
94   }
95
96   identity delete-file {
97     base manifest-commands;
98     description
99       "delete-file from device";
100   }
101
102   identity sw-manifest-commands {
103     base manifest-commands;
104     description
105       "base identity for defining manifest-commands specific to sw-manifest.";
106   }
107
108   identity sw-stage {
109     base sw-manifest-commands;
110     description
111       "sw-stage sw-manifest-command";
112   }
113
114   identity sw-activate {
115     base sw-manifest-commands;
116     description
117       "sw-activate sw-manifest-command";
118   }
119
120   identity cancel-validation-timer {
121     base sw-manifest-commands;
122     description
123       "cancel-validation-timer sw-manifest-command";
124   }
125
126   identity db-backup-manifest-commands {
127     base manifest-commands;
128     description
129       "base identity for defining manifest-commands specific to db-backup-manifest.";
130   }
131
132   identity db-backup {
133     base db-backup-manifest-commands;
134     description
135       "db-backup db-backup-manifest-command";
136   }
137
138   identity db-restore-manifest-commands {
139     base manifest-commands;
140     description
141       "base identity for defining manifest-commands specific to db-restore-manifest.";
142   }
143
144   identity db-restore {
145     base db-restore-manifest-commands;
146     description
147       "db-restore db-restore-manifest-command";
148   }
149
150   identity db-activate {
151     base db-restore-manifest-commands;
152     description
153       "db-activate db-restore-manifest-command";
154   }
155
156   identity cancel-rollback-timer {
157     base db-restore-manifest-commands;
158     description
159       "cancel-rollback-timer db-restore-manifest-command";
160   }
161
162   grouping base-manifest {
163     description
164       "base set of variables in all manifest files";
165     leaf vendor {
166       type string;
167       mandatory true;
168       description
169         "This field should match the /org-openroadm-device/info/vendor.
170          It is assumed that the vendor value does not change during the
171          processing of the manifest file.
172
173          The controller agent would use the vendor and model to find the
174          manifest for an Open ROADM NE. The controller agent would also
175          use the vendor and model to validate that this is a valid manifest
176          for the Open ROADM NE.
177         ";
178     }
179     leaf model {
180       type string;
181       mandatory true;
182       description
183         "This field should match the /org-openroadm-device/info/model.
184          It is assumed that the model value does not change during the
185          processing of the manifest file.
186
187          The controller agent would use the vendor and model to find the
188          manifest for an Open ROADM NE. The controller agent would also
189          use the vendor and model to validate that this is a valid manifest
190          for the Open ROADM NE.
191         ";
192     }
193     leaf sw-version {
194       type string;
195       description
196         "This field should match the
197              /org-openroadm-device/info/softwareVersion.
198          This is the value in the info tree AFTER an upgrade.
199         ";
200     }
201     leaf global-async-timeout {
202       type uint16;
203       default "900";
204       description
205         "global-async-timeout - time in seconds to wait for command processing to
206          complete.
207
208          Upon timeout, the controller may either:
209            - assume success;
210            - assume failure;
211            - poll the device to determine success/failure of the operation
212
213          This global-async-timeout applies to any asynchronous command.
214         ";
215     }
216     leaf global-sync-timeout {
217       type uint16;
218       description
219         "global-sync-timeout - time in seconds to wait for the rpc response for
220          synchronous commands.
221
222          This global-sync-timeout applies to any synchronous command.
223
224          Upon timeout, the controller may either:
225            - assume success;
226            - assume failure;
227            - poll the device to determine success/failure of the operation
228
229          No default is modeled; if not provided, defaults to the global
230          timeout supported by the controller for rpc responses.
231         ";
232     }
233   }
234
235   grouping timeout-command {
236     description
237       "timeout-command is to be used by any manifest command supporting a timeout";
238     leaf timeout {
239       type uint16;
240       description
241         "See command for additional details.
242          if command is async,
243            - overrides the global-async-timeout;
244            - defaults to the global-async-timeout if not provided.
245          if command is sync,
246            - overrides the global-sync-timeout;
247            - defaults to the global-sync-timeout if not provided.
248         ";
249     }
250   }
251
252   grouping is-async-command {
253     description
254       "is-async-command is to be supported by all manifest commands even if only
255        supported as sync or async. In such cases, a must statement should be
256        included to limit support to either sync or async.";
257     leaf is-async {
258       type boolean;
259       default "true";
260       description
261         "command can be supported as either an async or sync command by a vendor.
262          When supported as a sync command, the OWB-C will determine the success/failure
263          of the command based on the RPC response instead of waiting for transient
264          notifications from the device.";
265     }
266   }
267
268   grouping transfer-command {
269     description
270       "transfer-command defines the common set of variables used by download-file
271        and upload-file";
272     leaf remote-filename {
273       type string;
274       mandatory true;
275       description
276         "See command for detailed description.";
277     }
278     leaf local-file-path {
279       type string;
280       mandatory true;
281       description
282         "See command for detailed description.";
283     }
284     uses timeout-command;
285     uses is-async-command;
286   }
287
288   grouping file-command {
289     description
290       "file-command is used by all manifest files needing a filename";
291     leaf filename {
292       type string;
293       description
294         "filename is mandatory for delete-file; optional otherwise.
295          See command for detailed description.";
296     }
297   }
298
299   grouping command-reboot {
300     description
301       "command-reboot is used by manifest commands which result in a
302        device restart.";
303     leaf auto-reboot {
304       type uint16;
305       mandatory true;
306       description
307         "See command for detailed description.";
308     }
309   }
310
311   grouping download-file-command {
312     description
313       "down-file-command";
314     container download-file {
315       when "../command = 'download-file'";
316       description
317         "Transfer a file from the SFTP server to the device.
318          format: download-file remote-filename local-file-path [timeout]
319          where
320            remote-filename is the filename of the file to transfer on the SFTP
321            server. The filename can include a relative path that represents the
322            subdirectory structure of the vendor's software directory. This file
323            (and optional path) must exist in the software release directory on
324            the SFTP server.
325
326            local-file-path is the local path and filename to transfer the file on
327            the device.
328
329            timeout - see timeout-command grouping for basic details;
330                      if command is async,
331                        - Receipt of an in-progress (version 2)
332                          transfer-notification resets the timeout.
333
334          Maps to the transfer rpc with
335             action = download
336             local-file-path = local-file-path
337             remote-file-path =
338                sftp://user:password@host[:port]/path/remote-filename
339
340             The remote-file-path attribute on the transfer command would be
341             constructed by the software download agent by appending the sftp URL
342             (which includes username, password, host, port, and path to the
343             software release directory) with the remote_filename.
344
345          In the context of the transfer, remote is the SFTP server (e.g., located
346          on the software download agent) and local is on the Open ROADM device.
347
348          Expected notifications: transfer-notification
349         ";
350       uses transfer-command;
351     }
352   }
353
354   grouping upload-file-command {
355     description
356       "upload-file-command";
357     container upload-file {
358       when "../command = 'upload-file'";
359       description
360         "Transfer a file from the device to the SFTP server.
361          format: upload-file remote-filename local-file-path [timeout]
362          where
363            remote-filename is the filename of the file to receive the upload
364            on the SFTP server. The filename can include a relative path that
365            represents the subdirectory structure of the vendor's software
366            directory.
367
368            local-file-path is the local path and filename of the file on
369            the device to be uploaded to the SFTP server. This file must exist on
370            the device.
371
372            timeout - see timeout-command grouping for basic details;
373                      if command is async,
374                        - Receipt of an in-progress (version 2)
375                          transfer-notification resets the timeout.
376
377          Maps to the transfer rpc with
378             action = upload
379             local-file-path = local-file-path
380             remote-file-path =
381                sftp://user:password@host[:port]/path/remote-filename
382
383             The remote-file-path attribute on the transfer command would be
384             constructed by the software download agent by appending the sftp URL
385             (which includes username, password, host, port, and path to the
386             software release directory) with the remote_filename.
387
388          In the context of the transfer, remote is the SFTP server (e.g., located
389          on the software download agent) and local is on the Open ROADM device.
390
391          Expected notifications: transfer-notification
392         ";
393       uses transfer-command;
394     }
395   }
396
397   grouping delete-file-command {
398     description
399       "delete-file-command";
400     container delete-file {
401       when "../command = 'delete-file'";
402       must "is-async != 'false'" {
403         error-message "delete-file is only supported as sync command";
404       }
405       description
406         "Delete a file from the device's file system.
407          format: delete-file filename [timeout]
408          where
409            filename is the filename to be deleted from the device. The filename
410            may include path information.
411
412            timeout - overrides the global-sync-timeout; defaults to the
413                      global-sync-timeout if not provided.
414
415          Maps to the delete-file rpc:
416             delete-file filename
417         ";
418       uses file-command {
419         refine "filename" {
420           mandatory true;
421         }
422       }
423       uses timeout-command;
424       uses is-async-command;
425     }
426   }
427
428   grouping sw-stage-command {
429     description
430       "sw-stage-command";
431     container sw-stage {
432       when "../command = 'sw-stage'";
433       description
434         "Stage a file in the device.  The details of what a device does during
435          the staging operation is vendor specific.  However, the vendor may
436          initiate additional file transfers from the SFTP server during the
437          staging operation.  It is expected that the files will only be
438          transferred from the software release directory.
439
440          format: sw-stage [filename] [timeout]
441          where
442            filename is the filename of the file to stage. If filename is not
443            provided, the software download application will send the sw-stage
444            command without a filename.
445
446            timeout - overrides the global-async-timeout; defaults to the
447                      global-async-timeout if not provided.
448
449
450          Maps to the sw-stage rpc:
451             sw-stage [filename]
452
453          Expected notifications: sw-stage-notification
454         ";
455       uses file-command;
456       uses timeout-command;
457       uses is-async-command;
458     }
459   }
460
461   grouping wait-time-command {
462     description
463       "Wait timer starting from the completion of sw-activate or db-activate before canceling the validation timer or rollback timer";
464     leaf wait-time {
465       type uint16;
466       mandatory true;
467       description
468         "See command for detailed description.";
469     }
470   }
471
472   grouping sw-activate-command {
473     description
474       "sw-activate-command";
475     container sw-activate {
476       when "../command = 'sw-activate'";
477       must "is-async != 'true'" {
478         error-message "sw-activate is only supported as async command";
479       }
480       description
481         "Activate a software load in a device.  The details of what a device does
482          during the activation phase is vendor specific.  The device initiates
483          an automatic reboot as part of the activation.
484
485          format:  sw-activate version [validation-timer] [timeout] auto-reboot
486          where:
487            version: The version of software that is being activated. (The current
488            YANG model indicates that version is optional; however, version should
489            be a mandatory attribute of the sw-activate command in the manifest
490            file).
491
492            validation-timer: Validation timer setting for the software activation.
493            Format is expected to be in the form HH-MM-SS per the YANG model. The
494            software download application expects this format in order to treat
495            00-00-00 and no validation timer as the same use case.
496
497            timeout - overrides the global-async-timeout; defaults to the
498            global-async-timeout if not provided. This timer begins as soon as the
499            sw-activate processing begins. timeout must be greater than the
500            auto-reboot time.
501
502            auto-reboot: time (in seconds) to wait to for the device to reboot.
503            This is the device restart time (e.g. the length of time from device
504            comm loss until the device is ready for login). This timer begins when
505            the controller detects the comm-loss from the device. If login is not
506            successful when this timer expires, the sw-activate is failed.
507
508            NOTE: if controller swdl application is not doing the login directly,
509            the controller may need to augment the auto-reboot timer to account for
510            the login time.
511
512          Maps to the sw-activate rpc:
513            sw-activate version [validationTimer]
514
515          Expected notifications: sw-activate-notification
516            When no validation timer (or validation-timer = 00-00-00), two
517            notifications will be expected: one for activate, the other for
518            commit. Otherwise, only the activate notification is expected.
519
520            NOTE: the sw-activate-notifications (for activate) may be received
521            before or after the reboot; it is assumed the sw-activate-notification
522            (for commit) always occurs after the reboot. Any polling due to missed
523            sw-activate-notifications (activate and/or commit) should not be done
524            until after the reboot login; processing of sw-activate does not
525            complete until after receipt of the notifications and the reboot login.
526         ";
527       leaf version {
528         type string;
529         mandatory true;
530         description
531           "Although version is optional in the sw-activate rpc, it is
532            mandatory in the manifest file command.";
533       }
534       leaf validation-timer {
535         type string;
536         description
537           "hh-mm-ss";
538       }
539       uses timeout-command;
540       uses command-reboot;
541       uses is-async-command;
542     }
543   }
544
545   grouping cancel-validation-timer-command {
546     description
547       "cancel-validation-timer-command";
548     container cancel-validation-timer {
549       when "../command = 'cancel-validation-timer'";
550       description
551         "Command to automatically cancel the validation timer after wait-time.
552          Accept will be set to True if this command is used.
553
554          format:  cancel-validation-timer wait-time [time-out]
555          where:
556
557            wait-time - wait timer starting from the completion of
558            sw-activate before canceling the validation timer.
559
560            timeout - see timeout-command grouping for basic details.
561
562          Expected notifications: sw-activate-notification
563            commit notification is expected.
564         ";
565       uses wait-time-command;
566       uses timeout-command;
567       uses is-async-command;
568     }
569   }
570
571   grouping db-backup-command {
572     description
573       "db-backup-command";
574     container db-backup {
575       when "../command = 'db-backup'";
576       description
577         "Perform a database backup on the device.
578
579          format: db-backup [filename] [timeout]
580          where
581            filename is the filename of the backup file to be generated on the
582            device. If filename is not provided, the database backup application
583            will send the db-backup command without a filename. It's possible the
584            filename will not be statically provided in the manifest file, but
585            provided by the database backup application.
586
587            timeout - see timeout-command grouping for basic details;
588
589          Maps to the db-backup rpc:
590            db-backup [filename]
591
592          Expected notifications: db-backup-notification
593         ";
594       uses file-command;
595       uses timeout-command;
596       uses is-async-command;
597     }
598   }
599
600   grouping db-restore-command {
601     description
602       "db-restore-command";
603     container db-restore {
604       when "../command = 'db-restore'";
605       description
606         "Perform a database restore on the device.
607
608          format: db-restore [filename] [node-id-check] [timeout]
609          where
610            filename is the filename of the file to be restored on the
611            device. If filename is not provided, the database restore application
612            will send the db-restore command without a filename. It's possible the
613            filename will not be statically provided in the manifest file, but
614            provided by the database restore application.
615
616            node-id-check is a boolean indicating whether sysNameCheck is required.
617
618            timeout - see timeout-command grouping for basic details;
619
620          Maps to the db-restore rpc:
621            db-restore [filename] [nodeIDCheck]
622
623          Expected notifications: db-restore-notification
624         ";
625       uses file-command;
626       leaf node-id-check {
627         type string;
628         default "true";
629         description
630           "Defined as an string here so that manifest file can parameterize
631            the value for user input. __NODE-ID-CHECK is used for that purpose. Other valid
632            values are true or false. Maps to a boolean value in the rpc invocation.";
633       }
634       uses timeout-command;
635       uses is-async-command;
636     }
637   }
638
639   grouping cancel-rollback-timer-command {
640     description
641       "cancel-rollback-timer-command";
642     container cancel-rollback-timer {
643       when "../command = 'cancel-rollback-timer'";
644       description
645         "Command to automatically cancel the rollback timer after wait-time.
646          Accept will be set to True if this command is used.
647
648          format: cancel-rollback-timer wait-time [timeout]
649
650            wait-time - Wait timer starting from the completion of
651            db-activate before canceling the rollback timer.
652
653            timeout - see timeout-command grouping for basic details.
654
655          Expected notifications: db-activate-notification
656            commit notification is expected.
657         ";
658       uses wait-time-command;
659       uses timeout-command;
660       uses is-async-command;
661     }
662   }
663
664   grouping db-activate-command {
665     description
666       "db-activate-command";
667     container db-activate {
668       when "../command = 'db-activate'";
669       must "is-async != 'true'" {
670         error-message "db-activate is only supported as async command";
671       }
672       description
673         "Activate a database on a device.  The details of what a device does
674          during the activation phase is vendor specific.  The device initiates
675          an automatic reboot as part of the activation.
676
677          format:  db-activate [rollback-timer] [timeout] auto-reboot
678          where:
679            rollback-timer: Rollback timer setting for the database activation.
680            Format is expected to be in the form HH-MM-SS per the YANG model. The
681            database activation application expects this format in order to treat
682            00-00-00 and no validation timer as the same use case.
683
684            timeout - overrides the global-async-timeout; defaults to the
685            global-async-timeout if not provided. This timer begins as soon as the
686            db-activate processing begins. timeout must be greater than the
687            auto-reboot time.
688
689            auto-reboot: time (in seconds) to wait to for the device to reboot.
690            This is the device restart time (e.g. the length of time from device
691            comm loss until the device is ready for login). This timer begins when
692            the controller detects the comm-loss from the device. If login is not
693            successful when this timer expires, the db-activate is failed.
694
695            NOTE: if controller database application is not doing the login
696            directly, the controller may need to augment the auto-reboot timer to
697            account for the login time.
698
699          Maps to the db-activate rpc:
700            db-activate [rollBackTimer]
701
702          Expected notifications: db-activate-notification
703            When no rollback timer (or rollback-timer = 00-00-00), two
704            notifications will be expected: one for activate, the other for
705            commit. Otherwise, only the activate notification is expected.
706
707            NOTE: the db-activate-notifications (for activate) may be received
708            before or after the reboot; it is assumed the db-activate-notification
709            (for commit) always occurs after the reboot. Any polling due to missed
710            db-activate-notifications (activate and/or commit) should not be done
711            until after the reboot login; processing of db-activate does not
712            complete until after receipt of the notifications and the reboot login.
713         ";
714       leaf rollback-timer {
715         type string;
716         description
717           "hh-mm-ss";
718       }
719       uses timeout-command;
720       uses command-reboot;
721       uses is-async-command;
722     }
723   }
724
725   container sw-manifest {
726     presence "The sw-manifest instructions for swdl operations have been defined.";
727     description
728       "The manifest file provides instructions to a software download
729        application to download and install a new software load into a vendor's
730        equipment.
731
732        Software download files
733            All vendor files for a software release should be stored in a
734        separate directory. A unique directory would be used for each vendor,
735        model and software release combination. This directory and all files in
736        that directory will be accessible by the SFTP server.
737            The software directory can be flat or hierarchical with
738        subdirectories. The manifest file should be in the root directory of the
739        software directory.
740            A software directory must contain files for one and only one
741        software release.
742
743        Manifest file name
744            Each software release directory shall contain a manifest file for
745        that release. The filename for the manifest file shall be sw-manifest.json.
746       ";
747     uses base-manifest {
748       refine "sw-version" {
749         mandatory true;
750       }
751     }
752     list instruction-set {
753       key "index";
754       description
755         "The instruction set for a list of sw-versions that can be upgraded to
756          the sw-version specified at the top of the manifest file.";
757       leaf index {
758         type uint8;
759         description
760           "The index for this instruction set.";
761       }
762       leaf-list from-sw-version {
763         type string;
764         description
765           "The optional list of sw-versions that can be upgraded to the
766            sw-version specified at the top of the sw-manifest file.
767
768            If not specified, this instruction set is used to upgrade from
769            any sw-version to the sw-version specified at the top of the
770            sw-manifest file.
771
772            If multiple instruction sets are provided, from-sw-version
773            should always be defined.";
774       }
775       leaf is-commit-sw-activate-async {
776         type boolean;
777         default "true";
778         description
779           "Is cancel-validation-timer (accept = true) supported as an
780            async or sync command on the device? If supported as sync, the rpc response
781            is used to determine success/failure instead of waiting for transient notifications
782            of the result.
783            NOTE: cancel-validation-timer (accept = false) requires a reboot so is
784            always considered async";
785       }
786       leaf cancel-validation-timer-async-timeout {
787         type uint16;
788         description
789           "timeout value to use for cancel-validation-timer when supported as
790            an async command. If not specified, the global-async-timeout is used.";
791       }
792       leaf cancel-validation-timer-sync-timeout {
793         type uint16;
794         description
795           "timeout value to use for cancel-validation-timer (accept = true) when
796            supported as a sync command. If not specified, the global-sync-timeout
797            is used.";
798       }
799       container sw-manifest-commands {
800         description
801           "The ordered list of commands to be processed. Since some yang
802            implementations do not support ordered-by user, the list is also
803            indexed by command-order. The commands should be processed
804            in the order of command-order.
805
806            Processing moves to the next command when:
807            1. command is synchronous and rpc returns a successful result.
808            2. command is asynchronous, the rpc returns a successful result,
809            and
810            2.1 expected successful notification(s) have been received; or
811            2.2 timeout occurs.
812            \t\t
813            Processing of the manifest file is aborted when:
814            1. command is synchronous and rpc returns a failed result.
815            2. command is asynchronous, and:
816            2.1 the rpc returns a failed result; or
817            2.2 a failed notification is received; or
818            2.3 timeout occurs.
819            \t\t
820            NOTE: behavior for timeouts (synchronous or asynchronous) may depend upon
821            controller implementation per command. It may be considered either:
822            - as a successful result
823            - as a failed result
824            - as a success or failure based on polling the device
825           ";
826         list sw-manifest-command {
827           key "command-order";
828           ordered-by user;
829           description
830             "The list of commands to be processed.";
831           leaf command-order {
832             type uint8;
833             description
834               "The order in which commands should be processed.";
835           }
836           leaf command {
837             type identityref {
838               base sw-manifest-commands;
839             }
840             mandatory true;
841             description
842               "The command to be processed.";
843           }
844           uses download-file-command;
845           uses delete-file-command;
846           uses sw-stage-command;
847           uses sw-activate-command;
848           uses cancel-validation-timer-command;
849         }
850       }
851     }
852   }
853   container db-backup-manifest {
854     presence "The db-backup-manifest template for db-backup operations has been defined.";
855     description
856       "The manifest file provides instructions to a database operations
857        application to backup the database on a device.
858
859        Since the files used for these operations are likely user selected,
860        these manifest files are more likely used by the controller as a
861        template to control the overall flow of a backup operation and provide
862        a means of providing customized timeout values.
863
864        The following strings will be recognized as parameters to be replaced
865        by the user selected values: __LOCAL-FILE-PATH, __REMOTE-FILENAME.
866
867        Manifest file name
868            Each vendor/model combination can have a separate manifest file
869        defined for backup. These shall be named db-backup-manifest.json.
870       ";
871     uses base-manifest;
872     container db-backup-manifest-commands {
873       description
874         "The ordered list of commands to be processed. Since some yang
875          implementations do not support ordered-by user, the list is also
876          indexed by command-order. The commands should be processed
877          in the order of command-order.
878
879          Processing moves to the next command when:
880             1. command is synchronous and rpc returns a successful result.
881             2. command is asynchronous, the rpc returns a successful result,
882                and
883                2.1 expected successful notification(s) have been received; or
884                2.2 timeout occurs.
885
886          Processing of the manifest file is aborted when:
887             1. command is synchronous and rpc returns a failed result.
888             2. command is asynchronous, and:
889                2.1 the rpc returns a failed result; or
890                2.2 a failed notification is received; or
891                2.3 timeout occurs.
892
893          NOTE: behavior for timeouts (synchronous or asynchronous) may depend upon
894          controller implementation per command. It may be considered either:
895              - as a successful result
896              - as a failed result
897              - as a success or failure based on polling the device
898         ";
899       list db-backup-manifest-command {
900         key "command-order";
901         ordered-by user;
902         description
903           "The list of commands to be processed.";
904         leaf command-order {
905           type uint8;
906           description
907             "The order in which commands should be processed.";
908         }
909         leaf command {
910           type identityref {
911             base db-backup-manifest-commands;
912           }
913           mandatory true;
914           description
915             "The command to be processed.";
916         }
917         uses upload-file-command;
918         uses delete-file-command;
919         uses db-backup-command;
920       }
921     }
922   }
923   container db-restore-manifest {
924     presence "The db-restore-manifest template for db-restore operations has been defined.";
925     description
926       "The manifest file provides instructions to a database operations
927        application to restore the database on a device.
928
929        Since the files used for these operations are likely user selected,
930        these manifest files are more likely used by the controller as a
931        template to control the overall flow of a restore operation and provide
932        a means of providing customized timeout and auto-reboot values.
933
934        The following strings will be recognized as parameters to be replaced
935        by the user selected values: __LOCAL-FILE-PATH, __REMOTE-FILENAME,
936        __NODE-ID-CHECK.
937
938        Manifest file name
939            Each vendor/model combination can have a separate manifest file
940        defined for restore. These shall be named db-restore-manifest.json.
941       ";
942     uses base-manifest;
943     leaf is-commit-db-activate-async {
944       type boolean;
945       default "true";
946       description
947         "Is cancel-rollback-timer (accept = true) supported as an
948          async or sync command on the device? If supported as sync, the rpc response
949          is used to determine success/failure instead of waiting for transient notifications
950          of the result.
951          NOTE: cancel-rollback-timer (accept = false) requires a reboot so is
952          always considered async";
953     }
954     leaf cancel-rollback-timer-async-timeout {
955       type uint16;
956       description
957         "timeout value to use for cancel-rollback-timer when supported as
958          an async command. If not specified, the global-async-timeout is used.";
959     }
960     leaf cancel-rollback-timer-sync-timeout {
961       type uint16;
962       description
963         "timeout value to use for cancel-rollback-timer (accept = true) when
964          supported as a sync command. If not specified, the global-sync-timeout
965          is used.";
966     }
967     leaf database-init-sync-timeout {
968       type uint16;
969       description
970         "timeout value to use for database-init command. If not specified,
971          the global-sync-timeout is used.";
972     }
973     container db-restore-manifest-commands {
974       description
975         "The ordered list of commands to be processed. Since some yang
976          implementations do not support ordered-by user, the list is also
977          indexed by command-order. The commands should be processed
978          in the order of command-order.
979
980          Processing moves to the next command when:
981             1. command is synchronous and rpc returns a successful result.
982             2. command is asynchronous, the rpc returns a successful result,
983                and
984                2.1 expected successful notification(s) have been received; or
985                2.2 timeout occurs.
986
987          Processing of the manifest file is aborted when:
988             1. command is synchronous and rpc returns a failed result.
989             2. command is asynchronous, and:
990                2.1 the rpc returns a failed result; or
991                2.2 a failed notification is received; or
992                2.3 timeout occurs.
993
994          NOTE: behavior for timeouts (synchronous or asynchronous) may depend upon
995          controller implementation per command. It may be considered either:
996              - as a successful result
997              - as a failed result
998              - as a success or failure based on polling the device
999         ";
1000       list db-restore-manifest-command {
1001         key "command-order";
1002         ordered-by user;
1003         description
1004           "The list of commands to be processed.";
1005         leaf command-order {
1006           type uint8;
1007           description
1008             "The order in which commands should be processed.";
1009         }
1010         leaf command {
1011           type identityref {
1012             base db-restore-manifest-commands;
1013           }
1014           mandatory true;
1015           description
1016             "The command to be processed.";
1017         }
1018         uses download-file-command;
1019         uses delete-file-command;
1020         uses db-restore-command;
1021         uses db-activate-command;
1022         uses cancel-rollback-timer-command;
1023       }
1024     }
1025   }
1026 }