Add LCM APIs for DownloadNeSw and ActivateNeSw actions
[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-id {
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
326      grouping status {
327             description "The specific response codes are to be aligned with SDC reference doc
328                          (main table removed to avoid duplication and digression from main table).
329                          See SDC and ECOMP Distribution Consumer Interface Agreement";
330             container status {
331                 description "The specific response codes are to be aligned with SDC reference doc
332                              (main table removed to avoid duplication and digression from main table).
333                              See SDC and ECOMP Distribution Consumer Interface Agreement";
334                 leaf code {
335                     description "Response code";
336                     type uint16;
337                     mandatory true;
338                 }
339                 leaf message {
340                     description "Response message";
341                     type string;
342                     mandatory true;
343                 }
344             }
345       }
346
347      typedef lcm-action-status {
348          type enumeration {
349                  enum "IN_PROGRESS";
350                  enum "SUCCESSFUL";
351                  enum "FAILED";
352                  enum "NOT_FOUND";
353                  enum "ABORTED";
354                  enum "MULTIPLE_REQUESTS_FOUND";
355          }
356          description "The status of the requested LCM action";
357      }
358
359     /**********************************************************************************
360      * Define the restart service
361      **********************************************************************************/
362     rpc restart {
363         description "An operation to restart a virtual network function (or VM)";
364         input {
365             uses common-header;
366             leaf action {
367                 type action;
368                 mandatory true;
369             }
370             uses action-identifiers;
371                  leaf payload {
372                  type payload;
373                  mandatory false;
374             }
375         }
376         output {
377             uses common-header;
378             uses status;
379         }
380     }
381
382     /**********************************************************************************
383      * Define the rebuild service
384      **********************************************************************************/
385     rpc rebuild {
386         description "An operation to rebuild a virtual network function (or VM)";
387         input {
388             uses common-header;
389             leaf action {
390                 type action;
391                 mandatory true;
392             }
393             uses action-identifiers;
394             leaf payload {
395             type payload;
396             mandatory false;
397         }
398     }
399         output {
400             uses common-header;
401             uses status;
402         }
403     }
404
405     /**********************************************************************************
406      * Define the migrate service
407      **********************************************************************************/
408     rpc migrate {
409         description "An operation to migrate a virtual network function (or VM)";
410         input {
411             uses common-header;
412             leaf action {
413                 type action;
414                 mandatory true;
415             }
416             uses action-identifiers;
417             leaf payload {
418                 type payload;
419                 mandatory false;
420             }
421         }
422         output {
423             uses common-header;
424             uses status;
425         }
426     }
427
428     /**********************************************************************************
429      * Define the evacuate service
430      **********************************************************************************/
431     rpc evacuate {
432         description "An operation to evacuate a virtual network function (or VM)";
433          input {
434              uses common-header;
435              leaf action {
436                  type action;
437                   mandatory true;
438              }
439              uses action-identifiers;
440              leaf payload {
441                  type payload;
442                  mandatory false;
443              }
444          }
445          output {
446              uses common-header;
447              uses status;
448          }
449     }
450
451     /**********************************************************************************
452      * Define the snapshot service
453      **********************************************************************************/
454     rpc snapshot {
455         description "An operation to create a snapshot of a virtual network function (or VM)";
456         input {
457             uses common-header;
458             leaf action {
459                 type action;
460                 mandatory true;
461              }
462               uses action-identifiers;
463               leaf payload {
464                   type payload;
465                   mandatory false;
466               }
467               leaf identity-url {
468                   type string;
469                   mandatory true;
470               }
471         }
472         output {
473             uses common-header;
474             uses status;
475             leaf snapshot-id {
476                 type string;
477             }
478         }
479     }
480     /**********************************************************************************
481      * Define the VNF quiesce traffic service
482      **********************************************************************************/
483     rpc quiesce-traffic {
484         description "An operation to stop traffic gracefully on the VF.
485                      It stops traffic gracefully without stopping the application";
486         input {
487             uses common-header;
488             leaf action {
489                 type action;
490                 mandatory true;
491             }
492             uses action-identifiers;
493             leaf payload {
494                 type payload;
495                 mandatory true;
496            }
497         }
498         output {
499             uses common-header;
500             uses status;
501         }
502     }
503
504     /**********************************************************************************
505      * Define the VNF resume traffic service
506      **********************************************************************************/
507     rpc resume-traffic {
508         description "An operation to resume traffic gracefully on the VF.
509                      It resumes traffic gracefully without stopping the application";
510         input {
511             uses common-header;
512             leaf action {
513                 type action;
514                 mandatory true;
515             }
516             uses action-identifiers;
517             leaf payload {
518                 type payload;
519                 mandatory true;
520            }
521     }
522         output {
523             uses common-header;
524             uses status;
525         }
526     }
527
528     /**********************************************************************************
529      * Define the VNF distribute traffic service
530      **********************************************************************************/
531     rpc distribute-traffic {
532         description "An operation to distribute traffic gracefully on the VF.
533                      It distributes traffic gracefully without stopping the application";
534         input {
535             uses common-header;
536             leaf action {
537                 type action;
538                 mandatory true;
539             }
540             uses action-identifiers;
541             leaf payload {
542                 type payload;
543                 mandatory true;
544            }
545     }
546         output {
547             uses common-header;
548             uses status;
549         }
550     }
551
552     /**********************************************************************************
553      * Define the VNF UpgradePreCheck service
554      **********************************************************************************/
555     rpc upgrade-pre-check {
556         description "An operation to check that the VNF has the correct software version needed for a software upgrade.";
557         input {
558             uses common-header;
559             leaf action {
560                 type action;
561                 mandatory true;
562             }
563             uses action-identifiers;
564             leaf payload {
565                 type payload;
566                 mandatory true;
567            }
568         }
569         output {
570             uses common-header;
571             uses status;
572             leaf payload {
573                 type payload;
574                 mandatory true;
575                     }
576         }
577     }
578
579     /**********************************************************************************
580      * Define the VNF UpgradeSoftware service
581      **********************************************************************************/
582     rpc upgrade-software {
583         description "An operation to upgrade the target VNF to a new version and expected that the VNF is in a quiesced status .";
584         input {
585             uses common-header;
586             leaf action {
587                 type action;
588                 mandatory true;
589             }
590             uses action-identifiers;
591             leaf payload {
592                 type payload;
593                 mandatory true;
594            }
595         }
596         output {
597             uses common-header;
598             uses status;
599         }
600     }
601
602     /**********************************************************************************
603      * Define the downloadNeSw operation
604      **********************************************************************************/
605     rpc download-ne-sw {
606         description "An operation to download NE software";
607         input {
608             uses common-header;
609             leaf action {
610                 type action;
611                 mandatory true;
612             }
613             uses action-identifiers;
614             leaf payload {
615                 type payload;
616                 mandatory true;
617            }
618         }
619         output {
620             uses common-header;
621             uses status;
622             leaf payload {
623                 type payload;
624                 mandatory true;
625             }
626         }
627     }
628
629     /**********************************************************************************
630      * Define the activateNeSw operation
631      **********************************************************************************/
632     rpc activate-ne-sw {
633         description "An operation to activate NE software";
634         input {
635             uses common-header;
636             leaf action {
637                 type action;
638                 mandatory true;
639             }
640             uses action-identifiers;
641             leaf payload {
642                 type payload;
643                 mandatory true;
644            }
645         }
646         output {
647             uses common-header;
648             uses status;
649             leaf payload {
650                 type payload;
651                 mandatory true;
652             }
653         }
654     }
655
656     /**********************************************************************************
657      * Define the VNF UpgradePostCheck service
658      **********************************************************************************/
659     rpc upgrade-post-check {
660         description "An operation to check the VNF upgrade has been successful completed and all processes are running properly.";
661         input {
662             uses common-header;
663             leaf action {
664                 type action;
665                 mandatory true;
666             }
667             uses action-identifiers;
668             leaf payload {
669                 type payload;
670                 mandatory true;
671            }
672         }
673         output {
674             uses common-header;
675             uses status;
676             leaf payload {
677                 type payload;
678                 mandatory true;
679                          }
680         }
681     }
682
683     /**********************************************************************************
684      * Define the VNF UpgradeBackup service
685      **********************************************************************************/
686     rpc upgrade-backup {
687         description "An operation to do full backup of the VNF data prior to an upgrade.";
688         input {
689             uses common-header;
690             leaf action {
691                 type action;
692                 mandatory true;
693             }
694             uses action-identifiers;
695             leaf payload {
696                 type payload;
697                 mandatory true;
698            }
699         }
700         output {
701             uses common-header;
702             uses status;
703         }
704     }
705
706     /**********************************************************************************
707      * Define the VNF UpgradeBackout service
708      **********************************************************************************/
709     rpc upgrade-backout {
710         description "An operation does a backout after an UpgradeSoftware is completed (either successfully or unsuccessfully).";
711         input {
712             uses common-header;
713             leaf action {
714                 type action;
715                 mandatory true;
716             }
717             uses action-identifiers;
718             leaf payload {
719                 type payload;
720                 mandatory true;
721            }
722         }
723         output {
724             uses common-header;
725             uses status;
726         }
727     }
728
729     /**********************************************************************************
730      * Define the rollback service
731      **********************************************************************************/
732     rpc rollback {
733         description "An operation to rollback to particular snapshot of a virtual network function (or VM)";
734         input {
735             uses common-header;
736             leaf action {
737                 type action;
738                  mandatory true;
739             }
740             uses action-identifiers;
741             leaf payload {
742                 type payload;
743                 mandatory false;
744             }
745             leaf identity-url {
746                 type string;
747                 mandatory false;
748             }
749             leaf snapshot-id {
750                 type string;
751                  mandatory false;
752             }
753         }
754         output {
755             uses common-header;
756             uses status;
757             leaf payload {
758                 type payload;
759                 mandatory false;
760             }
761         }
762     }
763
764
765     /**********************************************************************************
766      * Additional RPCs added here...
767      **********************************************************************************/
768
769
770     /**********************************************************************************
771      * Define the sync service
772      **********************************************************************************/
773     rpc sync {
774         description "An operation to sync the configurations of a virtual network function (or VM)";
775         input {
776             uses common-header;
777             leaf action {
778                        type action;
779                        mandatory true;
780             }
781             uses action-identifiers;
782             leaf payload {
783                 type payload;
784                 mandatory false;
785             }
786         }
787         output {
788             uses common-header;
789             uses status;
790             leaf payload {
791                 type payload;
792                 mandatory false;
793            }
794         }
795     }
796
797     /**********************************************************************************
798      * Define the terminate service
799      **********************************************************************************/
800     rpc terminate {
801         description "An operation to terminate the configurations of a virtual network function (or VM)";
802         input {
803             uses common-header;
804             leaf action {
805                        type action;
806                        mandatory true;
807             }
808             uses action-identifiers;
809             leaf payload {
810                         type payload;
811                         mandatory false;
812             }
813         }
814         output {
815             uses common-header;
816             uses status;
817         }
818     }
819
820
821     rpc configure {
822         description "An operation to configure the configurations of a virtual network
823                 function (or VM)";
824         input {
825             uses common-header;
826             leaf action {
827                 type action;
828                 mandatory true;
829             }
830             uses action-identifiers;
831             leaf payload {
832                 type payload;
833                 mandatory false;
834             }
835         }
836         output {
837             uses common-header;
838             uses status;
839             leaf payload {
840                  type payload;
841                  mandatory false;
842             }
843         }
844     }
845
846     rpc config-modify {
847         description "Use the ModifyConfig command when a full configuration cycle is either not required
848                      or is considered too costly. The ModifyConfig LCM action affects only a subset of the
849                      total configuration data of a VNF. The set of configuration parameters to be affected
850                      is a subset of the total configuration data of the target VNF type. The payload Stop
851                      Application must contain the configuration parameters to be modified and their values.
852                      A successful modify returns a success response. A failed modify returns a failure
853                      response and the specific failure messages in the response payload Stop Application";
854         input {
855             uses common-header;
856             leaf action {
857                 type action;
858                 mandatory true;
859             }
860             uses action-identifiers;
861             leaf payload {
862                 type payload;
863                 mandatory false;
864             }
865         }
866         output {
867             uses common-header;
868             uses status;
869             leaf payload {
870                  type payload;
871                  mandatory false;
872             }
873         }
874     }
875
876     rpc config-scale-out {
877             description "An operation to Modify the configuration or other action to support
878             a ConfigScaleOut of a VNF.";
879             input {
880                 uses common-header;
881                 leaf action {
882                     type action;
883                     mandatory true;
884                 }
885                 uses action-identifiers;
886                 leaf payload {
887                     type payload;
888                     mandatory true;
889                 }
890             }
891             output {
892                 uses common-header;
893                 uses status;
894                 leaf payload {
895                      type payload;
896                      mandatory false;
897                 }
898             }
899         }
900
901     rpc config-restore {
902         description "An operation to restore the configurations of a virtual network
903                 function (or VM)";
904         input {
905             uses common-header;
906             leaf action {
907                 type action;
908                 mandatory true;
909             }
910             uses action-identifiers;
911             leaf payload {
912                 type payload;
913                 mandatory false;
914             }
915         }
916         output {
917             uses common-header;
918             uses status;
919             leaf payload {
920                  type payload;
921                  mandatory false;
922             }
923         }
924     }
925
926     /**********************************************************************************
927      * Define the test service
928      **********************************************************************************/
929     rpc test {
930         description "An operation to test the configurations of a virtual network function (or VM)";
931         input {
932             uses common-header;
933             leaf action {
934                        type action;
935                        mandatory true;
936             }
937             uses action-identifiers;
938             leaf payload {
939                         type payload;
940                         mandatory false;
941             }
942         }
943         output {
944             uses common-header;
945             uses status;
946         }
947     }
948
949     /**********************************************************************************
950      * Define the stop service
951      **********************************************************************************/
952     rpc stop {
953         description "An operation to stop the configurations of a virtual network function (or VM)";
954         input {
955             uses common-header;
956             leaf action {
957                 type action;
958                 mandatory true;
959             }
960             uses action-identifiers;
961             leaf payload {
962                 type payload;
963                 mandatory false;
964             }
965         }
966         output {
967             uses common-header;
968             uses status;
969         }
970     }
971
972     rpc start {
973         description "An operation to start a virtual network function (or VM)";
974         input {
975             uses common-header;
976             leaf action {
977                 type action;
978                 mandatory true;
979             }
980             uses action-identifiers;
981             leaf payload {
982                 type payload;
983                 mandatory false;
984             }
985         }
986         output {
987             uses common-header;
988             uses status;
989         }
990     }
991
992     /**********************************************************************************
993      * Define the audit service
994      **********************************************************************************/
995     rpc audit {
996         description "An operation to audit the configurations of a virtual network function (or VM)";
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             leaf payload {
1013                 type payload;
1014                 mandatory false;
1015             }
1016         }
1017     }
1018
1019     /**********************************************************************************
1020      * Define the SoftwareUpload vSCP service
1021      **********************************************************************************/
1022     rpc software-upload {
1023         description "An operation to upload a new version of vSCP image to vSCP for updating it";
1024         input {
1025             uses common-header;
1026             leaf action {
1027                 type action;
1028                 mandatory true;
1029             }
1030             uses action-identifiers;
1031             leaf payload {
1032                 type payload;
1033                 mandatory false;
1034             }
1035         }
1036         output {
1037             uses common-header;
1038             uses status;
1039         }
1040     }
1041
1042     /**********************************************************************************
1043      * Define the PreHealthCheck vSCP service
1044      **********************************************************************************/
1045     rpc health-check {
1046         description "An operation to perform health check of vSCP prior its upgrading";
1047         input {
1048             uses common-header;
1049             leaf action {
1050                 type action;
1051                 mandatory true;
1052             }
1053             uses action-identifiers;
1054             leaf payload {
1055                 type payload;
1056                 mandatory false;
1057             }
1058         }
1059         output {
1060             uses common-header;
1061             uses status;
1062             leaf payload {
1063                 type payload;
1064                 mandatory true;
1065                          }
1066
1067         }
1068     }
1069
1070
1071     /**********************************************************************************
1072      * Define the Upgrade vSCP service
1073      **********************************************************************************/
1074     rpc live-upgrade {
1075         description "An operation to perform upgrade of vSCP";
1076         input {
1077             uses common-header;
1078             leaf action {
1079                  type action;
1080                  mandatory true;
1081             }
1082             uses action-identifiers;
1083             leaf payload {
1084                  type payload;
1085                  mandatory false;
1086             }
1087         }
1088         output {
1089             uses common-header;
1090             uses status;
1091         }
1092     }
1093
1094
1095     /**********************************************************************************
1096      * Define the VNF lock service
1097      **********************************************************************************/
1098     rpc lock {
1099          description "An operation to perform VNF lock operation";
1100           input {
1101               uses common-header;
1102                leaf action {
1103                    type action;
1104                    mandatory true;
1105                }
1106                uses action-identifiers;
1107                leaf payload {
1108                    type payload;
1109                    mandatory false;
1110                }
1111           }
1112           output {
1113               uses common-header;
1114               uses status;
1115           }
1116     }
1117
1118     /**********************************************************************************
1119      * Define the VNF unlock service
1120      **********************************************************************************/
1121     rpc unlock {
1122         description "An operation to perform VNF unlock operation";
1123          input {
1124              uses common-header;
1125              leaf action {
1126                  type action;
1127                  mandatory true;
1128              }
1129              uses action-identifiers;
1130              leaf payload {
1131                  type payload;
1132                  mandatory false;
1133              }
1134          }
1135          output {
1136              uses common-header;
1137              uses status;
1138          }
1139     }
1140
1141     /**********************************************************************************
1142      * Define the VNF check lock service
1143      **********************************************************************************/
1144     rpc check-lock {
1145         description "An operation to check VNF lock status";
1146         input {
1147             uses common-header;
1148             leaf action {
1149                        type action;
1150                        mandatory true;
1151             }
1152             uses action-identifiers;
1153         }
1154         output {
1155             uses common-header;
1156             uses status;
1157             leaf locked {
1158                 type enumeration {
1159                             enum "TRUE";
1160                             enum "FALSE";
1161                        }
1162                 description "TRUE/FALSE - returns TRUE when the given VNF was locked, otherwise returns FALSE";
1163                 mandatory false;
1164             }
1165         }
1166     }
1167
1168
1169     rpc config-backup {
1170         description "An operation to Backup configurations of a virtual network function
1171                 (or VM)";
1172         input {
1173             uses common-header;
1174             leaf action {
1175                 type action;
1176                 mandatory true;
1177             }
1178             uses action-identifiers;
1179             leaf payload {
1180                  type payload;
1181                  mandatory false;
1182             }
1183         }
1184         output {
1185             uses common-header;
1186             uses status;
1187             leaf payload {
1188                  type payload;
1189                  mandatory false;
1190             }
1191         }
1192     }
1193
1194     rpc config-backup-delete {
1195         description "An operation to Delete backup configurations of a virtual network
1196                 function (or VM)";
1197         input {
1198             uses common-header;
1199             leaf action {
1200                 type action;
1201                 mandatory true;
1202             }
1203             uses action-identifiers;
1204         }
1205         output {
1206             uses common-header;
1207             uses status;
1208             leaf payload {
1209                  type payload;
1210                  mandatory false;
1211             }
1212         }
1213     }
1214
1215     rpc config-export {
1216         description "An operation to Export configurations of a virtual network function
1217                 (or VM)";
1218         input {
1219             uses common-header;
1220             leaf action {
1221                 type action;
1222                 mandatory true;
1223             }
1224             uses action-identifiers;
1225         }
1226         output {
1227             uses common-header;
1228             uses status;
1229         }
1230     }
1231     rpc stop-application {
1232             description "An operation to Stop Application traffic to a virtual network function";
1233             input {
1234                 uses common-header;
1235                 leaf action {
1236                     type action;
1237                     mandatory true;
1238                 }
1239                 uses action-identifiers;
1240                 leaf payload {
1241                      type payload;
1242                      mandatory false;
1243                 }
1244             }
1245             output {
1246                 uses common-header;
1247                 uses status;
1248             }
1249         }
1250
1251     /**********************************************************************************
1252      * Define the VNF Start Application service
1253      **********************************************************************************/
1254     rpc start-application {
1255         description "An operation to perform VNF Start Application operation";
1256         input {
1257             uses common-header;
1258             leaf action {
1259                 type action;
1260                  mandatory true;
1261             }
1262             uses action-identifiers;
1263             leaf payload {
1264                 type payload;
1265                 mandatory false;
1266             }
1267         }
1268         output {
1269             uses common-header;
1270             uses status;
1271         }
1272     }
1273
1274
1275     /**********************************************************************************
1276      * Gets the current state of the previously submitted LCM request
1277      **********************************************************************************/
1278     rpc action-status {
1279         description "An operation to get the current state of the previously submitted LCM request";
1280         input {
1281             uses common-header;
1282             leaf action {
1283                 type action;
1284                 mandatory true;
1285             }
1286             uses action-identifiers;
1287             leaf payload {
1288                 type payload;
1289                 mandatory false;
1290             }
1291         }
1292         output {
1293            uses common-header;
1294            uses status;
1295            leaf payload {
1296                 type payload;
1297            }
1298         }
1299     }
1300
1301     /**********************************************************************************
1302      * Define the VNF Query service
1303      **********************************************************************************/
1304     rpc query {
1305         description "An operation to query the status of a targe VNF.
1306                      Returns information on each VM, including state (active or standby)
1307                      and status (healthy or unhealthy)";
1308         input {
1309             uses common-header;
1310             leaf action {
1311                 type action;
1312                 mandatory true;
1313             }
1314             uses action-identifiers;
1315         }
1316         output {
1317             uses common-header;
1318             uses status;
1319             list query-results {
1320                 leaf vserver-id {
1321                     description "Identifier of a VM";
1322                     type string;
1323                     mandatory true;
1324                 }
1325                 leaf vm-state {
1326                     description "The state of the VM";
1327                     type vm-state;
1328                     mandatory true;
1329                 }
1330                 leaf vm-status {
1331                     description "the status of the VM";
1332                     type vm-status;
1333                     mandatory true;
1334                 }
1335             }
1336         }
1337     }
1338
1339     /**********************************************************************************
1340      * Define the Reboot service
1341      **********************************************************************************/
1342     rpc reboot {
1343         description "An operation to reboot a specified virtual machine (VM)";
1344         input {
1345             uses common-header;
1346             leaf action {
1347                 type action;
1348                 mandatory true;
1349             }
1350             uses action-identifiers;
1351             leaf payload {
1352                 type payload;
1353                 mandatory false;
1354             }
1355          }
1356         output {
1357             uses common-header;
1358             uses status;
1359         }
1360     }
1361
1362     /**********************************************************************************
1363      * Define the VM attach volume service
1364      **********************************************************************************/
1365     rpc attach-volume {
1366         description "An operation to attach a cinder volume to a VM";
1367         input {
1368             uses common-header;
1369             leaf action {
1370                 type action;
1371                 mandatory true;
1372             }
1373             uses action-identifiers;
1374             leaf payload {
1375                  type payload;
1376                  mandatory true;
1377             }
1378         }
1379         output {
1380             uses common-header;
1381             uses status;
1382         }
1383     }
1384
1385     /**********************************************************************************
1386      * Define the VM detach volume service
1387      **********************************************************************************/
1388     rpc detach-volume {
1389         description "An operation to detach a cinder volume from a VM";
1390         input {
1391             uses common-header;
1392             leaf action {
1393                 type action;
1394                 mandatory true;
1395             }
1396             uses action-identifiers;
1397             leaf payload {
1398                  type payload;
1399                  mandatory true;
1400             }
1401         }
1402         output {
1403             uses common-header;
1404             uses status;
1405         }
1406     }
1407
1408
1409
1410  /**********************************************************************************
1411      * Additional RPCs added here...
1412  **********************************************************************************/
1413 }