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