Release version 1.1.0 of sli/northbound
[ccsdk/sli/northbound.git] / lcm / model / src / main / yang / lcm.yang
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 /*
26  * Yang model for the Application Controller (APP-C) component of ECOMP
27  *
28  * This model is used to define the data and services of the Application Controller
29  * component of ECOMP.  The APP-C controller initiates the processing of directed
30  * graphs, which define the actual process implementations used.  The name of the
31  * directed graph is set by properties and cannot be changed dynamically.
32  *
33  * The services exposed by this provider are:
34  *
35  * restart-vnf:
36  *    Used to request a restart of a virtual network function (a VM).
37  *
38  * rebuild-vnf:
39  *    Used to request a rebuild of a virtual network function (a VM).
40  *
41  */
42
43 module LCM {
44
45     yang-version 1;
46     namespace "org:onap:ccsdk:sli:northbound:lcm";
47     prefix lcm;
48
49     description
50       "Defines the services and request/response requirements for the CCSDK LCM component.";
51
52     /*
53      * Note, the revision changes the package name of the generated java code.  Do not
54      * change the revision unless you also update all references to the bindings.
55      */
56     revision "2018-03-29" {
57       description
58         "CCSDK LCM interface version 0.2.1";
59     }
60
61     /**********************************************************************************
62      * Data type definitions
63      *
64      * The following data type definitions are used to define common data structures,
65      * define constraints, or to impart special meanings to data objects related to the
66      * APP-C controller functions.
67      **********************************************************************************/
68
69     typedef ZULU {
70         description "Define a common definition of a time stamp (expressed as a formatted
71                 string) as follows yyyy-MM-ddTHH:mm:ss.SSSSSSSSZ";
72         type string {
73             length "16..28";
74             pattern "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,6}Z";
75         }
76     }
77
78     typedef payload {
79            type string ;
80            description "The payload can be any valid JSON string value. Json escape characters need to be added when required to include an inner json within the payload to make it a valid json string value";
81     }
82
83     typedef action {
84         type enumeration {
85             enum "Restart";
86             enum "Rebuild";
87             enum "Migrate";
88             enum "Evacuate";
89             enum "Snapshot";
90             enum "Rollback";
91             enum "Sync";
92             enum "Audit";
93             enum "Stop";
94             enum "Start";
95             enum "Terminate";
96             enum "SoftwareUpload";
97             enum "HealthCheck";
98             enum "LiveUpgrade";
99             enum "Lock";
100             enum "Unlock";
101             enum "Test";
102             enum "CheckLock";
103             enum "Configure";
104             enum "ConfigModify";
105             enum "ConfigScaleOut";
106             enum "ConfigRestore";
107             enum "ConfigBackup";
108             enum "ConfigBackupDelete";
109             enum "ConfigExport";
110             enum "StopApplication";
111             enum "StartApplication";
112             enum "QuiesceTraffic";
113             enum "ResumeTraffic";
114             enum "DistributeTraffic";
115             enum "UpgradePreCheck";
116             enum "UpgradeSoftware";
117             enum "DownloadNESw";
118             enum "ActivateNESw";
119             enum "UpgradePostCheck";
120             enum "UpgradeBackup";
121             enum "UpgradeBackout";
122             enum "ActionStatus";
123             enum "Query";
124             enum "Reboot";
125             enum "AttachVolume";
126             enum "DetachVolume";
127
128         }
129         description "The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate";
130     }
131
132     typedef vm-state {
133         description "The state of a VM";
134         type enumeration {
135             enum "active";
136             enum "standby";
137             enum "inactive";
138             enum "unknown";
139         }
140     }
141
142     typedef vm-status {
143         description "The status of a VM";
144         type enumeration {
145             enum "healthy";
146             enum "unhealthy";
147             enum "unknown";
148         }
149     }
150
151
152     /**********************************************************************************
153      * Basic manipulation of a VNF (or VM) will typically include querying the current
154      * state, restarting, rebuilding, stopping, starting, etc.  In all of these basic
155      * "state"-type operations, the services require the identification of the VNF to
156      * be operated on, and the region or LCP that contains that resource.  This
157      * information is used across all of these services, so it has been defined as a
158      * common structure here and is referenced in the appropriate RPC definitions.
159      **********************************************************************************/
160
161
162     /**********************************************************************************
163      * All requests will include this standard header
164      *
165      * The standard request header is used to define a correlation identification for
166      * the request that is returned on all responses.  This correlation identifier
167      * (called the service-request-id) is meaningful to the caller and is included on
168      * all responses from the services.
169      **********************************************************************************/
170
171     /**********************************************************************************
172      * All responses will include this standard header
173      *
174      * The standard response header includes the time of completion as well as a
175      * success|failure indication
176      **********************************************************************************/
177
178     grouping common-header {
179         description "A common header for all APP-C requests";
180         container common-header {
181             description "A common header for all APP-C requests";
182             leaf timestamp {
183                 description "timestamp is in ISO 8601 timestamp format ZULU offset";
184                 type ZULU;
185                 mandatory true;
186             }
187
188             leaf api-ver {
189                 description "api-ver is the API version identifier. A given release of APPC
190                                 should support all previous versions of APPC API (correlate with
191                                 general requirements)";
192                 type string {
193                     pattern "[2]\.\d\d" {
194                         error-message "API Version 2.XX is supported at this end point";
195                     }
196                 }
197                 mandatory true;
198             }
199
200             leaf originator-id {
201                 description "originator-id an identifier of the calling system which can be
202                                 used addressing purposes, i.e. returning asynchronous response
203                                 to the proper destination over DMaaP (especially in case of multiple
204                                 consumers of APP-C APIs)";
205                 type string;
206                 mandatory true;
207             }
208
209             leaf request-id {
210                 description "UUID for the request ID. An OSS/BSS identifier for the request
211                                 that caused the current action. Multiple API calls may be made
212                                 with the same request-id The request-id shall be recorded throughout
213                                 the operations on a single request";
214                 type string;
215                 mandatory true;
216             }
217
218             leaf sub-request-id {
219                 description "Uniquely identifies a specific LCM action. It is persistent over
220                                 the life-cycle of a single request";
221                 type string;
222                 mandatory false;
223             }
224
225
226             /**********************************************************************************
227              * Flags are generic flags that apply to any and all commands, all are optional
228              *  force = TRUE/FALSE - Execute command even if target is in unstable (i.e. locked, transiting, etc)
229              *                       state. Specific behaviour of forced commands varies, but implies cancellation
230              *                       of previous command and an override by the new command. The FALSE value is
231              *                       used by default.
232              *  ttl = <0....N> - The timeout value for command execution, expressed in seconds
233              *  mode = EXCLUSIVE/NORMAL - defines execution mode as follows:
234              *        - EXCLUSIVE ? on encountering an exclusive command, the APP-C will:
235              *          * Cease accepting additional command requests
236              *          * Complete execution of outstanding commands
237              *          * Execute the exclusive command to completion
238              *          * Optionally report the result of the command
239              *          * Optionally resume command acceptance and processing
240              *        - NORMAL - Obverse of EXCLUSIVE, the default one.
241              **********************************************************************************/
242             container flags {
243                 description "Flags are generic flags that apply to any and all commands, all are optional";
244                 leaf mode {
245                     type enumeration {
246                         enum "EXCLUSIVE";
247                         enum "NORMAL";
248                     }
249                     description "EXCLUSIVE (accept no queued requests on this VNF while processing)
250                                         or NORMAL (queue other requests until complete)";
251                     mandatory false;
252                 }
253                 leaf force {
254                     type enumeration {
255                         enum "TRUE";
256                         enum "FALSE";
257                     }
258                     description "TRUE/FALSE - Execute action even if target is in unstable (i.e.
259                                         locked, transiting, etc.) state";
260                     mandatory false;
261                 }
262                 leaf ttl {
263                     description "<0....N> - The timeout value (expressed in seconds) for action
264                                         execution, between action being received by APPC and action initiation";
265                     type uint16;
266                     mandatory false;
267                 }
268             }
269         }
270     }
271
272
273     grouping action-identifiers {
274         description "A block containing the action arguments. These are used to specify
275                 the object upon which APP-C LCM command is to operate";
276         container action-identifiers {
277             description "A block containing the action arguments. These are used to specify
278                         the object upon which APP-C LCM command is to operate";
279             leaf service-instance-id {
280                 description "identifies a specific service the command refers to. When multiple
281                                 APP-C instances are used and applied to a subset of services,
282                                 this will become significant . The field is mandatory when the
283                                 vnf-id is empty";
284                 type string;
285                 mandatory false;
286             }
287             leaf vnf-id {
288                 description "identifies the VNF to which this action is to be applied(vnf-id
289                                 uniquely identifies the service-instance referred to). Note that
290                                 some actions are applied to multiple VNFs in the same service.
291                                 When this is the case, vnf-id may be left out, but service-instance-id
292                                 must appear. The field is mandatory when service-instance-id is
293                                 empty";
294                 type string;
295                 mandatory false;
296             }
297             leaf vf-module-id {
298                 description "identifies the VF module to which this action is to be applied.";
299                 type string;
300                 mandatory false;
301             }
302             leaf vnfc-name {
303                 description "identifies the VNFC to which this action is to be applied. Some
304                                 actions apply only to a component within a VNF (e.g. RESTART is
305                                 sometimes applied to on VM only). In such a case, the name of
306                                 the VNFC is used to search for the component within the VNF";
307                 type string;
308                 mandatory false;
309             }
310             leaf vserver-id {
311                 description "identifies a specific VM within the given service/vnf to which
312                                 this action is to be applied";
313                 type string;
314                 mandatory false;
315             }
316             leaf pnf-name {
317                 description "identifies the PNF to which this action is to be applied.";
318                 type string;
319                 mandatory false;
320             }
321         }
322     }
323
324
325      grouping status {
326             description "The specific response codes are to be aligned with SDC reference doc
327                          (main table removed to avoid duplication and digression from main table).
328                          See SDC and ECOMP Distribution Consumer Interface Agreement";
329             container status {
330                 description "The specific response codes are to be aligned with SDC reference doc
331                              (main table removed to avoid duplication and digression from main table).
332                              See SDC and ECOMP Distribution Consumer Interface Agreement";
333                 leaf code {
334                     description "Response code";
335                     type uint16;
336                     mandatory true;
337                 }
338                 leaf message {
339                     description "Response message";
340                     type string;
341                     mandatory true;
342                 }
343             }
344       }
345
346      typedef lcm-action-status {
347          type enumeration {
348                  enum "IN_PROGRESS";
349                  enum "SUCCESSFUL";
350                  enum "FAILED";
351                  enum "NOT_FOUND";
352                  enum "ABORTED";
353                  enum "MULTIPLE_REQUESTS_FOUND";
354          }
355          description "The status of the requested LCM action";
356      }
357
358     /**********************************************************************************
359      * Define the restart service
360      **********************************************************************************/
361     rpc restart {
362         description "An operation to restart a virtual network function (or VM)";
363         input {
364             uses common-header;
365             leaf action {
366                 type action;
367                 mandatory true;
368             }
369             uses action-identifiers;
370                  leaf payload {
371                  type payload;
372                  mandatory false;
373             }
374         }
375         output {
376             uses common-header;
377             uses status;
378         }
379     }
380
381     /**********************************************************************************
382      * Define the rebuild service
383      **********************************************************************************/
384     rpc rebuild {
385         description "An operation to rebuild a virtual network function (or VM)";
386         input {
387             uses common-header;
388             leaf action {
389                 type action;
390                 mandatory true;
391             }
392             uses action-identifiers;
393             leaf payload {
394             type payload;
395             mandatory false;
396         }
397     }
398         output {
399             uses common-header;
400             uses status;
401         }
402     }
403
404     /**********************************************************************************
405      * Define the migrate service
406      **********************************************************************************/
407     rpc migrate {
408         description "An operation to migrate a virtual network function (or VM)";
409         input {
410             uses common-header;
411             leaf action {
412                 type action;
413                 mandatory true;
414             }
415             uses action-identifiers;
416             leaf payload {
417                 type payload;
418                 mandatory false;
419             }
420         }
421         output {
422             uses common-header;
423             uses status;
424         }
425     }
426
427     /**********************************************************************************
428      * Define the evacuate service
429      **********************************************************************************/
430     rpc evacuate {
431         description "An operation to evacuate a virtual network function (or VM)";
432          input {
433              uses common-header;
434              leaf action {
435                  type action;
436                   mandatory true;
437              }
438              uses action-identifiers;
439              leaf payload {
440                  type payload;
441                  mandatory false;
442              }
443          }
444          output {
445              uses common-header;
446              uses status;
447          }
448     }
449
450     /**********************************************************************************
451      * Define the snapshot service
452      **********************************************************************************/
453     rpc snapshot {
454         description "An operation to create a snapshot of a virtual network function (or VM)";
455         input {
456             uses common-header;
457             leaf action {
458                 type action;
459                 mandatory true;
460              }
461               uses action-identifiers;
462               leaf payload {
463                   type payload;
464                   mandatory false;
465               }
466               leaf identity-url {
467                   type string;
468                   mandatory true;
469               }
470         }
471         output {
472             uses common-header;
473             uses status;
474             leaf snapshot-id {
475                 type string;
476             }
477         }
478     }
479     /**********************************************************************************
480      * Define the VNF quiesce traffic service
481      **********************************************************************************/
482     rpc quiesce-traffic {
483         description "An operation to stop traffic gracefully on the VF.
484                      It stops traffic gracefully without stopping the application";
485         input {
486             uses common-header;
487             leaf action {
488                 type action;
489                 mandatory true;
490             }
491             uses action-identifiers;
492             leaf payload {
493                 type payload;
494                 mandatory true;
495            }
496         }
497         output {
498             uses common-header;
499             uses status;
500         }
501     }
502
503     /**********************************************************************************
504      * Define the VNF resume traffic service
505      **********************************************************************************/
506     rpc resume-traffic {
507         description "An operation to resume traffic gracefully on the VF.
508                      It resumes traffic gracefully without stopping the application";
509         input {
510             uses common-header;
511             leaf action {
512                 type action;
513                 mandatory true;
514             }
515             uses action-identifiers;
516             leaf payload {
517                 type payload;
518                 mandatory true;
519            }
520     }
521         output {
522             uses common-header;
523             uses status;
524         }
525     }
526
527     /**********************************************************************************
528      * Define the VNF distribute traffic service
529      **********************************************************************************/
530     rpc distribute-traffic {
531         description "An operation to distribute traffic gracefully on the VF.
532                      It distributes traffic gracefully without stopping the application";
533         input {
534             uses common-header;
535             leaf action {
536                 type action;
537                 mandatory true;
538             }
539             uses action-identifiers;
540             leaf payload {
541                 type payload;
542                 mandatory true;
543            }
544     }
545         output {
546             uses common-header;
547             uses status;
548         }
549     }
550
551     /**********************************************************************************
552      * Define the VNF UpgradePreCheck service
553      **********************************************************************************/
554     rpc upgrade-pre-check {
555         description "An operation to check that the VNF has the correct software version needed for a software upgrade.";
556         input {
557             uses common-header;
558             leaf action {
559                 type action;
560                 mandatory true;
561             }
562             uses action-identifiers;
563             leaf payload {
564                 type payload;
565                 mandatory true;
566            }
567         }
568         output {
569             uses common-header;
570             uses status;
571             leaf payload {
572                 type payload;
573                 mandatory true;
574                     }
575         }
576     }
577
578     /**********************************************************************************
579      * Define the VNF UpgradeSoftware service
580      **********************************************************************************/
581     rpc upgrade-software {
582         description "An operation to upgrade the target VNF to a new version and expected that the VNF is in a quiesced status .";
583         input {
584             uses common-header;
585             leaf action {
586                 type action;
587                 mandatory true;
588             }
589             uses action-identifiers;
590             leaf payload {
591                 type payload;
592                 mandatory true;
593            }
594         }
595         output {
596             uses common-header;
597             uses status;
598         }
599     }
600
601     /**********************************************************************************
602      * Define the downloadNESw operation
603      **********************************************************************************/
604     rpc download-n-e-sw {
605         description "An operation to download NE software";
606         input {
607             uses common-header;
608             leaf action {
609                 type action;
610                 mandatory true;
611             }
612             uses action-identifiers;
613             leaf payload {
614                 type payload;
615                 mandatory true;
616            }
617         }
618         output {
619             uses common-header;
620             uses status;
621             leaf payload {
622                 type payload;
623                 mandatory true;
624             }
625         }
626     }
627
628     /**********************************************************************************
629      * Define the activateNESw operation
630      **********************************************************************************/
631     rpc activate-n-e-sw {
632         description "An operation to activate NE software";
633         input {
634             uses common-header;
635             leaf action {
636                 type action;
637                 mandatory true;
638             }
639             uses action-identifiers;
640             leaf payload {
641                 type payload;
642                 mandatory true;
643            }
644         }
645         output {
646             uses common-header;
647             uses status;
648             leaf payload {
649                 type payload;
650                 mandatory true;
651             }
652         }
653     }
654
655     /**********************************************************************************
656      * Define the VNF UpgradePostCheck service
657      **********************************************************************************/
658     rpc upgrade-post-check {
659         description "An operation to check the VNF upgrade has been successful completed and all processes are running properly.";
660         input {
661             uses common-header;
662             leaf action {
663                 type action;
664                 mandatory true;
665             }
666             uses action-identifiers;
667             leaf payload {
668                 type payload;
669                 mandatory true;
670            }
671         }
672         output {
673             uses common-header;
674             uses status;
675             leaf payload {
676                 type payload;
677                 mandatory true;
678                          }
679         }
680     }
681
682     /**********************************************************************************
683      * Define the VNF UpgradeBackup service
684      **********************************************************************************/
685     rpc upgrade-backup {
686         description "An operation to do full backup of the VNF data prior to an upgrade.";
687         input {
688             uses common-header;
689             leaf action {
690                 type action;
691                 mandatory true;
692             }
693             uses action-identifiers;
694             leaf payload {
695                 type payload;
696                 mandatory true;
697            }
698         }
699         output {
700             uses common-header;
701             uses status;
702         }
703     }
704
705     /**********************************************************************************
706      * Define the VNF UpgradeBackout service
707      **********************************************************************************/
708     rpc upgrade-backout {
709         description "An operation does a backout after an UpgradeSoftware is completed (either successfully or unsuccessfully).";
710         input {
711             uses common-header;
712             leaf action {
713                 type action;
714                 mandatory true;
715             }
716             uses action-identifiers;
717             leaf payload {
718                 type payload;
719                 mandatory true;
720            }
721         }
722         output {
723             uses common-header;
724             uses status;
725         }
726     }
727
728     /**********************************************************************************
729      * Define the rollback service
730      **********************************************************************************/
731     rpc rollback {
732         description "An operation to rollback to particular snapshot of a virtual network function (or VM)";
733         input {
734             uses common-header;
735             leaf action {
736                 type action;
737                  mandatory true;
738             }
739             uses action-identifiers;
740             leaf payload {
741                 type payload;
742                 mandatory false;
743             }
744             leaf identity-url {
745                 type string;
746                 mandatory false;
747             }
748             leaf snapshot-id {
749                 type string;
750                  mandatory false;
751             }
752         }
753         output {
754             uses common-header;
755             uses status;
756             leaf payload {
757                 type payload;
758                 mandatory false;
759             }
760         }
761     }
762
763
764     /**********************************************************************************
765      * Additional RPCs added here...
766      **********************************************************************************/
767
768
769     /**********************************************************************************
770      * Define the sync service
771      **********************************************************************************/
772     rpc sync {
773         description "An operation to sync the configurations of a virtual network function (or VM)";
774         input {
775             uses common-header;
776             leaf action {
777                        type action;
778                        mandatory true;
779             }
780             uses action-identifiers;
781             leaf payload {
782                 type payload;
783                 mandatory false;
784             }
785         }
786         output {
787             uses common-header;
788             uses status;
789             leaf payload {
790                 type payload;
791                 mandatory false;
792            }
793         }
794     }
795
796     /**********************************************************************************
797      * Define the terminate service
798      **********************************************************************************/
799     rpc terminate {
800         description "An operation to terminate the configurations of a virtual network function (or VM)";
801         input {
802             uses common-header;
803             leaf action {
804                        type action;
805                        mandatory true;
806             }
807             uses action-identifiers;
808             leaf payload {
809                         type payload;
810                         mandatory false;
811             }
812         }
813         output {
814             uses common-header;
815             uses status;
816         }
817     }
818
819
820     rpc configure {
821         description "An operation to configure the configurations of a virtual network
822                 function (or VM)";
823         input {
824             uses common-header;
825             leaf action {
826                 type action;
827                 mandatory true;
828             }
829             uses action-identifiers;
830             leaf payload {
831                 type payload;
832                 mandatory false;
833             }
834         }
835         output {
836             uses common-header;
837             uses status;
838             leaf payload {
839                  type payload;
840                  mandatory false;
841             }
842         }
843     }
844
845     rpc config-modify {
846         description "Use the ModifyConfig command when a full configuration cycle is either not required
847                      or is considered too costly. The ModifyConfig LCM action affects only a subset of the
848                      total configuration data of a VNF. The set of configuration parameters to be affected
849                      is a subset of the total configuration data of the target VNF type. The payload Stop
850                      Application must contain the configuration parameters to be modified and their values.
851                      A successful modify returns a success response. A failed modify returns a failure
852                      response and the specific failure messages in the response payload Stop Application";
853         input {
854             uses common-header;
855             leaf action {
856                 type action;
857                 mandatory true;
858             }
859             uses action-identifiers;
860             leaf payload {
861                 type payload;
862                 mandatory false;
863             }
864         }
865         output {
866             uses common-header;
867             uses status;
868             leaf payload {
869                  type payload;
870                  mandatory false;
871             }
872         }
873     }
874
875     rpc config-scale-out {
876             description "An operation to Modify the configuration or other action to support
877             a ConfigScaleOut of a VNF.";
878             input {
879                 uses common-header;
880                 leaf action {
881                     type action;
882                     mandatory true;
883                 }
884                 uses action-identifiers;
885                 leaf payload {
886                     type payload;
887                     mandatory true;
888                 }
889             }
890             output {
891                 uses common-header;
892                 uses status;
893                 leaf payload {
894                      type payload;
895                      mandatory false;
896                 }
897             }
898         }
899
900     rpc config-restore {
901         description "An operation to restore the configurations of a virtual network
902                 function (or VM)";
903         input {
904             uses common-header;
905             leaf action {
906                 type action;
907                 mandatory true;
908             }
909             uses action-identifiers;
910             leaf payload {
911                 type payload;
912                 mandatory false;
913             }
914         }
915         output {
916             uses common-header;
917             uses status;
918             leaf payload {
919                  type payload;
920                  mandatory false;
921             }
922         }
923     }
924
925     /**********************************************************************************
926      * Define the test service
927      **********************************************************************************/
928     rpc test {
929         description "An operation to test the configurations of a virtual network function (or VM)";
930         input {
931             uses common-header;
932             leaf action {
933                        type action;
934                        mandatory true;
935             }
936             uses action-identifiers;
937             leaf payload {
938                         type payload;
939                         mandatory false;
940             }
941         }
942         output {
943             uses common-header;
944             uses status;
945         }
946     }
947
948     /**********************************************************************************
949      * Define the stop service
950      **********************************************************************************/
951     rpc stop {
952         description "An operation to stop the configurations of a virtual network function (or VM)";
953         input {
954             uses common-header;
955             leaf action {
956                 type action;
957                 mandatory true;
958             }
959             uses action-identifiers;
960             leaf payload {
961                 type payload;
962                 mandatory false;
963             }
964         }
965         output {
966             uses common-header;
967             uses status;
968         }
969     }
970
971     rpc start {
972         description "An operation to start a virtual network function (or VM)";
973         input {
974             uses common-header;
975             leaf action {
976                 type action;
977                 mandatory true;
978             }
979             uses action-identifiers;
980             leaf payload {
981                 type payload;
982                 mandatory false;
983             }
984         }
985         output {
986             uses common-header;
987             uses status;
988         }
989     }
990
991     /**********************************************************************************
992      * Define the audit service
993      **********************************************************************************/
994     rpc audit {
995         description "An operation to audit the configurations of a virtual network function (or VM)";
996         input {
997             uses common-header;
998             leaf action {
999                 type action;
1000                 mandatory true;
1001             }
1002             uses action-identifiers;
1003             leaf payload {
1004                 type payload;
1005                 mandatory false;
1006             }
1007         }
1008         output {
1009             uses common-header;
1010             uses status;
1011             leaf payload {
1012                 type payload;
1013                 mandatory false;
1014             }
1015         }
1016     }
1017
1018     /**********************************************************************************
1019      * Define the SoftwareUpload vSCP service
1020      **********************************************************************************/
1021     rpc software-upload {
1022         description "An operation to upload a new version of vSCP image to vSCP for updating it";
1023         input {
1024             uses common-header;
1025             leaf action {
1026                 type action;
1027                 mandatory true;
1028             }
1029             uses action-identifiers;
1030             leaf payload {
1031                 type payload;
1032                 mandatory false;
1033             }
1034         }
1035         output {
1036             uses common-header;
1037             uses status;
1038         }
1039     }
1040
1041     /**********************************************************************************
1042      * Define the PreHealthCheck vSCP service
1043      **********************************************************************************/
1044     rpc health-check {
1045         description "An operation to perform health check of vSCP prior its upgrading";
1046         input {
1047             uses common-header;
1048             leaf action {
1049                 type action;
1050                 mandatory true;
1051             }
1052             uses action-identifiers;
1053             leaf payload {
1054                 type payload;
1055                 mandatory false;
1056             }
1057         }
1058         output {
1059             uses common-header;
1060             uses status;
1061             leaf payload {
1062                 type payload;
1063                 mandatory true;
1064                          }
1065
1066         }
1067     }
1068
1069
1070     /**********************************************************************************
1071      * Define the Upgrade vSCP service
1072      **********************************************************************************/
1073     rpc live-upgrade {
1074         description "An operation to perform upgrade of vSCP";
1075         input {
1076             uses common-header;
1077             leaf action {
1078                  type action;
1079                  mandatory true;
1080             }
1081             uses action-identifiers;
1082             leaf payload {
1083                  type payload;
1084                  mandatory false;
1085             }
1086         }
1087         output {
1088             uses common-header;
1089             uses status;
1090         }
1091     }
1092
1093
1094     /**********************************************************************************
1095      * Define the VNF lock service
1096      **********************************************************************************/
1097     rpc lock {
1098          description "An operation to perform VNF lock operation";
1099           input {
1100               uses common-header;
1101                leaf action {
1102                    type action;
1103                    mandatory true;
1104                }
1105                uses action-identifiers;
1106                leaf payload {
1107                    type payload;
1108                    mandatory false;
1109                }
1110           }
1111           output {
1112               uses common-header;
1113               uses status;
1114           }
1115     }
1116
1117     /**********************************************************************************
1118      * Define the VNF unlock service
1119      **********************************************************************************/
1120     rpc unlock {
1121         description "An operation to perform VNF unlock operation";
1122          input {
1123              uses common-header;
1124              leaf action {
1125                  type action;
1126                  mandatory true;
1127              }
1128              uses action-identifiers;
1129              leaf payload {
1130                  type payload;
1131                  mandatory false;
1132              }
1133          }
1134          output {
1135              uses common-header;
1136              uses status;
1137          }
1138     }
1139
1140     /**********************************************************************************
1141      * Define the VNF check lock service
1142      **********************************************************************************/
1143     rpc check-lock {
1144         description "An operation to check VNF lock status";
1145         input {
1146             uses common-header;
1147             leaf action {
1148                        type action;
1149                        mandatory true;
1150             }
1151             uses action-identifiers;
1152         }
1153         output {
1154             uses common-header;
1155             uses status;
1156             leaf locked {
1157                 type enumeration {
1158                             enum "TRUE";
1159                             enum "FALSE";
1160                        }
1161                 description "TRUE/FALSE - returns TRUE when the given VNF was locked, otherwise returns FALSE";
1162                 mandatory false;
1163             }
1164         }
1165     }
1166
1167
1168     rpc config-backup {
1169         description "An operation to Backup configurations of a virtual network function
1170                 (or VM)";
1171         input {
1172             uses common-header;
1173             leaf action {
1174                 type action;
1175                 mandatory true;
1176             }
1177             uses action-identifiers;
1178             leaf payload {
1179                  type payload;
1180                  mandatory false;
1181             }
1182         }
1183         output {
1184             uses common-header;
1185             uses status;
1186             leaf payload {
1187                  type payload;
1188                  mandatory false;
1189             }
1190         }
1191     }
1192
1193     rpc config-backup-delete {
1194         description "An operation to Delete backup configurations of a virtual network
1195                 function (or VM)";
1196         input {
1197             uses common-header;
1198             leaf action {
1199                 type action;
1200                 mandatory true;
1201             }
1202             uses action-identifiers;
1203         }
1204         output {
1205             uses common-header;
1206             uses status;
1207             leaf payload {
1208                  type payload;
1209                  mandatory false;
1210             }
1211         }
1212     }
1213
1214     rpc config-export {
1215         description "An operation to Export configurations of a virtual network function
1216                 (or VM)";
1217         input {
1218             uses common-header;
1219             leaf action {
1220                 type action;
1221                 mandatory true;
1222             }
1223             uses action-identifiers;
1224         }
1225         output {
1226             uses common-header;
1227             uses status;
1228         }
1229     }
1230     rpc stop-application {
1231             description "An operation to Stop Application traffic to a virtual network function";
1232             input {
1233                 uses common-header;
1234                 leaf action {
1235                     type action;
1236                     mandatory true;
1237                 }
1238                 uses action-identifiers;
1239                 leaf payload {
1240                      type payload;
1241                      mandatory false;
1242                 }
1243             }
1244             output {
1245                 uses common-header;
1246                 uses status;
1247             }
1248         }
1249
1250     /**********************************************************************************
1251      * Define the VNF Start Application service
1252      **********************************************************************************/
1253     rpc start-application {
1254         description "An operation to perform VNF Start Application operation";
1255         input {
1256             uses common-header;
1257             leaf action {
1258                 type action;
1259                  mandatory true;
1260             }
1261             uses action-identifiers;
1262             leaf payload {
1263                 type payload;
1264                 mandatory false;
1265             }
1266         }
1267         output {
1268             uses common-header;
1269             uses status;
1270         }
1271     }
1272
1273
1274     /**********************************************************************************
1275      * Gets the current state of the previously submitted LCM request
1276      **********************************************************************************/
1277     rpc action-status {
1278         description "An operation to get the current state of the previously submitted LCM request";
1279         input {
1280             uses common-header;
1281             leaf action {
1282                 type action;
1283                 mandatory true;
1284             }
1285             uses action-identifiers;
1286             leaf payload {
1287                 type payload;
1288                 mandatory false;
1289             }
1290         }
1291         output {
1292            uses common-header;
1293            uses status;
1294            leaf payload {
1295                 type payload;
1296            }
1297         }
1298     }
1299
1300     /**********************************************************************************
1301      * Define the VNF Query service
1302      **********************************************************************************/
1303     rpc query {
1304         description "An operation to query the status of a targe VNF.
1305                      Returns information on each VM, including state (active or standby)
1306                      and status (healthy or unhealthy)";
1307         input {
1308             uses common-header;
1309             leaf action {
1310                 type action;
1311                 mandatory true;
1312             }
1313             uses action-identifiers;
1314         }
1315         output {
1316             uses common-header;
1317             uses status;
1318             list query-results {
1319                 leaf vserver-id {
1320                     description "Identifier of a VM";
1321                     type string;
1322                     mandatory true;
1323                 }
1324                 leaf vm-state {
1325                     description "The state of the VM";
1326                     type vm-state;
1327                     mandatory true;
1328                 }
1329                 leaf vm-status {
1330                     description "the status of the VM";
1331                     type vm-status;
1332                     mandatory true;
1333                 }
1334             }
1335         }
1336     }
1337
1338     /**********************************************************************************
1339      * Define the Reboot service
1340      **********************************************************************************/
1341     rpc reboot {
1342         description "An operation to reboot a specified virtual machine (VM)";
1343         input {
1344             uses common-header;
1345             leaf action {
1346                 type action;
1347                 mandatory true;
1348             }
1349             uses action-identifiers;
1350             leaf payload {
1351                 type payload;
1352                 mandatory false;
1353             }
1354          }
1355         output {
1356             uses common-header;
1357             uses status;
1358         }
1359     }
1360
1361     /**********************************************************************************
1362      * Define the VM attach volume service
1363      **********************************************************************************/
1364     rpc attach-volume {
1365         description "An operation to attach a cinder volume to a VM";
1366         input {
1367             uses common-header;
1368             leaf action {
1369                 type action;
1370                 mandatory true;
1371             }
1372             uses action-identifiers;
1373             leaf payload {
1374                  type payload;
1375                  mandatory true;
1376             }
1377         }
1378         output {
1379             uses common-header;
1380             uses status;
1381         }
1382     }
1383
1384     /**********************************************************************************
1385      * Define the VM detach volume service
1386      **********************************************************************************/
1387     rpc detach-volume {
1388         description "An operation to detach a cinder volume from a VM";
1389         input {
1390             uses common-header;
1391             leaf action {
1392                 type action;
1393                 mandatory true;
1394             }
1395             uses action-identifiers;
1396             leaf payload {
1397                  type payload;
1398                  mandatory true;
1399             }
1400         }
1401         output {
1402             uses common-header;
1403             uses status;
1404         }
1405     }
1406
1407
1408
1409  /**********************************************************************************
1410      * Additional RPCs added here...
1411  **********************************************************************************/
1412 }