035fca2238a5fb9b718b0ec8e385b8eae4f10f94
[appc.git] / appc-provider / appc-provider-model / src / main / yang / appc-provider-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  * Modifications Copyright (C) 2018-2019 Orange Nokia
10  * =============================================================================
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  *      http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  *
23  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
24  * ============LICENSE_END=========================================================
25  */
26
27 /*
28  * Yang model for the Application Controller (APP-C) component of ECOMP
29  *
30  * This model is used to define the data and services of the Application Controller
31  * component of ECOMP.  The APP-C controller initiates the processing of directed
32  * graphs, which define the actual process implementations used.  The name of the
33  * directed graph is set by properties and cannot be changed dynamically.
34  *
35  * The services exposed by this provider are:
36  *
37  * restart-vnf:
38  *    Used to request a restart of a virtual network function (a VM).
39  *
40  * rebuild-vnf:
41  *    Used to request a rebuild of a virtual network function (a VM).
42  *
43  */
44
45 module appc-provider-lcm {
46
47     yang-version 1;
48     namespace "org:onap:appc:lcm";
49     prefix appc-provider-lcm;
50         
51     description
52       "Defines the services and request/response requirements for the ECOMP APP-C component.";
53
54     /*
55      * Note, the revision changes the package name of the generated java code.  Do not
56      * change the revision unless you also update all references to the bindings.
57      */
58     revision "2016-01-08" {
59       description
60         "APP-C interface version 1.0.48";
61     }
62
63     /**********************************************************************************
64      * Data type definitions
65      *
66      * The following data type definitions are used to define common data structures,
67      * define constraints, or to impart special meanings to data objects related to the
68      * APP-C controller functions.
69      **********************************************************************************/
70
71     typedef ZULU {
72         description "Define a common definition of a time stamp (expressed as a formatted
73                 string) as follows yyyy-MM-ddTHH:mm:ss.SSSSSSSSZ";
74         type string {
75             length "16..28";
76             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";
77         }
78     }
79
80     typedef payload {
81            type string ;
82            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";
83     }
84
85     typedef action {
86         type enumeration {
87             enum "Restart";
88             enum "Rebuild";
89             enum "Migrate";
90             enum "Evacuate";
91             enum "Snapshot";
92             enum "Rollback";
93             enum "Sync";
94             enum "Audit";
95             enum "Stop";
96             enum "Start";
97             enum "Terminate";
98             enum "SoftwareUpload";
99             enum "HealthCheck";
100             enum "LicenseManagement";
101             enum "LiveUpgrade";
102             enum "Lock";
103             enum "Unlock";
104             enum "Test";
105             enum "CheckLock";
106             enum "Configure";
107             enum "ConfigModify";
108             enum "ConfigScaleOut";
109             enum "ConfigRestore";
110             enum "ConfigBackup";
111             enum "ConfigBackupDelete";
112             enum "ConfigExport";
113             enum "StopApplication";
114             enum "StartApplication";
115             enum "QuiesceTraffic";
116             enum "ResumeTraffic";
117             enum "UpgradePreCheck";
118             enum "UpgradeSoftware";
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             enum "PreConfigure";
128             enum "GetConfig";
129             enum "DistributeTraffic";
130             enum "DistributeTrafficCheck";
131             enum "PostRebuild";
132             enum "PreRebuild";
133             enum "PreEvacuate";
134             enum "PostEvacuate";
135             enum "PreMigrate";
136             enum "PostMigrate";
137             enum "Provisioning";
138             enum "StartTraffic";
139             enum "StatusTraffic";
140             enum "StopTraffic";
141             enum "ConfigScaleIn";
142             enum "DownloadNESw";
143             enum "ActivateNESw";
144         }
145         description "The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate";
146     }
147
148     typedef vm-state {
149         description "The state of a VM";
150         type enumeration {
151             enum "active";
152             enum "standby";
153             enum "inactive";
154             enum "unknown";
155         }
156     }
157
158     typedef vm-status {
159         description "The status of a VM";
160         type enumeration {
161             enum "healthy";
162             enum "unhealthy";
163             enum "unknown";
164         }
165     }
166
167
168     /**********************************************************************************
169      * Basic manipulation of a VNF (or VM) will typically include querying the current
170      * state, restarting, rebuilding, stopping, starting, etc.  In all of these basic
171      * "state"-type operations, the services require the identification of the VNF to
172      * be operated on, and the region or LCP that contains that resource.  This
173      * information is used across all of these services, so it has been defined as a
174      * common structure here and is referenced in the appropriate RPC definitions.
175      **********************************************************************************/
176     
177
178     /**********************************************************************************
179      * All requests will include this standard header
180      *
181      * The standard request header is used to define a correlation identification for
182      * the request that is returned on all responses.  This correlation identifier
183      * (called the service-request-id) is meaningful to the caller and is included on
184      * all responses from the services.
185      **********************************************************************************/
186
187     /**********************************************************************************
188      * All responses will include this standard header
189      *
190      * The standard response header includes the time of completion as well as a
191      * success|failure indication
192      **********************************************************************************/
193
194     grouping common-header {
195         description "A common header for all APP-C requests";
196         container common-header {
197             description "A common header for all APP-C requests";
198             leaf timestamp {
199                 description "timestamp is in ISO 8601 timestamp format ZULU offset";
200                 type ZULU;
201                 mandatory true;
202             }
203
204             leaf api-ver {
205                 description "api-ver is the API version identifier. A given release of APPC
206                                 should support all previous versions of APPC API (correlate with
207                                 general requirements)";
208                 type string {
209                     pattern "[2]\.\d\d" {
210                         error-message "API Version 2.XX is supported at this end point";
211                     }
212                 }
213                 mandatory true;
214             }
215
216             leaf originator-id {
217                 description "originator-id an identifier of the calling system which can be
218                                 used addressing purposes, i.e. returning asynchronous response
219                                 to the proper destination over DMaaP (especially in case of multiple
220                                 consumers of APP-C APIs)";
221                 type string;
222                 mandatory true;
223             }
224
225             leaf request-id {
226                 description "UUID for the request ID. An OSS/BSS identifier for the request
227                                 that caused the current action. Multiple API calls may be made
228                                 with the same request-id The request-id shall be recorded throughout
229                                 the operations on a single request";
230                 type string;
231                 mandatory true;
232             }
233
234             leaf sub-request-id {
235                 description "Uniquely identifies a specific LCM action. It is persistent over
236                                 the life-cycle of a single request";
237                 type string;
238                 mandatory false;
239             }
240
241
242             /**********************************************************************************
243              * Flags are generic flags that apply to any and all commands, all are optional
244              *  force = TRUE/FALSE - Execute command even if target is in unstable (i.e. locked, transiting, etc)
245              *                       state. Specific behaviour of forced commands varies, but implies cancellation
246              *                       of previous command and an override by the new command. The FALSE value is
247              *                       used by default.
248              *  ttl = <0....N> - The timeout value for command execution, expressed in seconds
249              *  mode = EXCLUSIVE/NORMAL - defines execution mode as follows:
250              *        - EXCLUSIVE ? on encountering an exclusive command, the APP-C will:
251              *          * Cease accepting additional command requests
252              *          * Complete execution of outstanding commands
253              *          * Execute the exclusive command to completion
254              *          * Optionally report the result of the command
255              *          * Optionally resume command acceptance and processing
256              *        - NORMAL - Obverse of EXCLUSIVE, the default one.
257              **********************************************************************************/
258             container flags {
259                 description "Flags are generic flags that apply to any and all commands, all are optional";
260                 leaf mode {
261                     type enumeration {
262                         enum "EXCLUSIVE";
263                         enum "NORMAL";
264                     }
265                     description "EXCLUSIVE (accept no queued requests on this VNF while processing)
266                                         or NORMAL (queue other requests until complete)";
267                     mandatory false;
268                 }
269                 leaf force {
270                     type enumeration {
271                         enum "TRUE";
272                         enum "FALSE";
273                     }
274                     description "TRUE/FALSE - Execute action even if target is in unstable (i.e.
275                                         locked, transiting, etc.) state";
276                     mandatory false;
277                 }
278                 leaf ttl {
279                     description "<0....N> - The timeout value (expressed in seconds) for action
280                                         execution, between action being received by APPC and action initiation";
281                     type uint16;
282                     mandatory false;
283                 }
284             }
285         }
286     }
287
288
289     grouping action-identifiers {
290         description "A block containing the action arguments. These are used to specify
291                 the object upon which APP-C LCM command is to operate";
292         container action-identifiers {
293             description "A block containing the action arguments. These are used to specify
294                         the object upon which APP-C LCM command is to operate";
295             leaf service-instance-id {
296                 description "identifies a specific service the command refers to. When multiple
297                                 APP-C instances are used and applied to a subset of services,
298                                 this will become significant . The field is mandatory when the
299                                 vnf-id is empty";
300                 type string;
301                 mandatory false;
302             }
303             leaf vnf-id {
304                 description "identifies the VNF to which this action is to be applied(vnf-id
305                                 uniquely identifies the service-instance referred to). Note that
306                                 some actions are applied to multiple VNFs in the same service.
307                                 When this is the case, vnf-id may be left out, but service-instance-id
308                                 must appear. The field is mandatory when service-instance-id is
309                                 empty";
310                 type string;
311                 mandatory false;
312             }
313             leaf vf-module-id {
314                 description "identifies the VF module to which this action is to be applied.";
315                 type string;
316                 mandatory false;
317             }
318             leaf vnfc-name {
319                 description "identifies the VNFC to which this action is to be applied. Some
320                                 actions apply only to a component within a VNF (e.g. RESTART is
321                                 sometimes applied to on VM only). In such a case, the name of
322                                 the VNFC is used to search for the component within the VNF";
323                 type string;
324                 mandatory false;
325             }
326             leaf vserver-id {
327                 description "identifies a specific VM within the given service/vnf to which
328                                 this action is to be applied";
329                 type string;
330                 mandatory false;
331             }
332         }
333     }
334
335
336      grouping status {
337             description "The specific response codes are to be aligned with SDC reference doc
338                          (main table removed to avoid duplication and digression from main table).
339                          See SDC and ECOMP Distribution Consumer Interface Agreement";
340             container status {
341                 description "The specific response codes are to be aligned with SDC reference doc
342                              (main table removed to avoid duplication and digression from main table).
343                              See SDC and ECOMP Distribution Consumer Interface Agreement";
344                 leaf code {
345                     description "Response code";
346                     type uint16;
347                     mandatory true;
348                 }
349                 leaf message {
350                     description "Response message";
351                     type string;
352                     mandatory true;
353                 }
354             }
355       }
356
357      typedef lcm-action-status {
358          type enumeration {
359                  enum "IN_PROGRESS";
360                  enum "SUCCESSFUL";
361                  enum "FAILED";
362                  enum "NOT_FOUND";
363                  enum "ABORTED";
364                  enum "MULTIPLE_REQUESTS_FOUND";
365          }
366          description "The status of the requested LCM action";
367      }
368
369     /**********************************************************************************
370      * Define the restart service
371      **********************************************************************************/
372     rpc restart {
373         description "An operation to restart a virtual network function (or VM)";
374         input {
375             uses common-header;
376             leaf action {
377                 type action;
378                 mandatory true;
379             }
380             uses action-identifiers;
381                  leaf payload {
382                  type payload;
383                  mandatory false;
384             }
385         }
386         output {
387             uses common-header;
388             uses status;
389         }
390     }
391
392     /**********************************************************************************
393      * Define the rebuild service
394      **********************************************************************************/
395     rpc rebuild {
396         description "An operation to rebuild a virtual network function (or VM)";
397         input {
398             uses common-header;
399             leaf action {
400                 type action;
401                 mandatory true;
402             }
403             uses action-identifiers;
404             leaf payload {
405             type payload;
406             mandatory false;
407         }
408     }
409         output {
410             uses common-header;
411             uses status;
412         }
413     }
414
415     /**********************************************************************************
416      * Define the migrate service
417      **********************************************************************************/
418     rpc migrate {
419         description "An operation to migrate a virtual network function (or VM)";
420         input {
421             uses common-header;
422             leaf action {
423                 type action;
424                 mandatory true;
425             }
426             uses action-identifiers;
427             leaf payload {
428                 type payload;
429                 mandatory false;
430             }
431         }
432         output {
433             uses common-header;
434             uses status;
435         }
436     }
437
438     /**********************************************************************************
439      * Define the evacuate service
440      **********************************************************************************/
441     rpc evacuate {
442         description "An operation to evacuate a virtual network function (or VM)";
443          input {
444              uses common-header;
445              leaf action {
446                  type action;
447                   mandatory true;
448              }
449              uses action-identifiers;
450              leaf payload {
451                  type payload;
452                  mandatory false;
453              }
454          }
455          output {
456              uses common-header;
457              uses status;
458          }
459     }
460
461     /**********************************************************************************
462      * Define the snapshot service
463      **********************************************************************************/
464     rpc snapshot {
465         description "An operation to create a snapshot of a virtual network function (or VM)";
466         input {
467             uses common-header;
468             leaf action {
469                 type action;
470                 mandatory true;
471              }
472               uses action-identifiers;
473               leaf payload {
474                   type payload;
475                   mandatory false;
476               }
477               leaf identity-url {
478                   type string;
479                   mandatory true;
480               }
481         }
482         output {
483             uses common-header;
484             uses status;
485             leaf snapshot-id {
486                 type string;
487             }
488         }
489     }
490     /**********************************************************************************
491      * Define the VNF quiesce traffic service
492      **********************************************************************************/
493     rpc quiesce-traffic {
494         description "An operation to stop traffic gracefully on the VF.
495                      It stops traffic gracefully without stopping the application";
496         input {
497             uses common-header;
498             leaf action {
499                 type action;
500                 mandatory true;
501             }
502             uses action-identifiers;
503             leaf payload {
504                 type payload;
505                 mandatory true;
506            }
507         }
508         output {
509             uses common-header;
510             uses status;
511             leaf payload {
512                 type payload;
513                 mandatory false;
514             }
515         }
516     }
517
518     /**********************************************************************************
519      * Define the VNF resume traffic service
520      **********************************************************************************/
521     rpc resume-traffic {
522         description "An operation to resume traffic gracefully on the VF.
523                      It resumes traffic gracefully without stopping the application";
524         input {
525             uses common-header;
526             leaf action {
527                 type action;
528                 mandatory true;
529             }
530             uses action-identifiers;
531             leaf payload {
532                 type payload;
533                 mandatory true;
534            }
535     }
536         output {
537             uses common-header;
538             uses status;
539             leaf payload {
540                 type payload;
541                 mandatory false;
542             }
543         }
544     }
545
546     /**********************************************************************************
547      * Define the VNF UpgradePreCheck service
548      **********************************************************************************/
549     rpc upgrade-pre-check {
550         description "An operation to check that the VNF has the correct software version needed for a software upgrade.";
551         input {
552             uses common-header;
553             leaf action {
554                 type action;
555                 mandatory true;
556             }
557             uses action-identifiers;
558             leaf payload {
559                 type payload;
560                 mandatory true;
561            }
562         }
563         output {
564             uses common-header;
565             uses status;
566             leaf payload {
567                 type payload;
568                 mandatory true;
569                     }
570         }
571     }
572
573     /**********************************************************************************
574      * Define the VNF UpgradeSoftware service
575      **********************************************************************************/
576     rpc upgrade-software {
577         description "An operation to upgrade the target VNF to a new version and expected that the VNF is in a quiesced status .";
578         input {
579             uses common-header;
580             leaf action {
581                 type action;
582                 mandatory true;
583             }
584             uses action-identifiers;
585             leaf payload {
586                 type payload;
587                 mandatory true;
588            }
589         }
590         output {
591             uses common-header;
592             uses status;
593             leaf payload {
594                 type payload;
595                 mandatory false;
596             }
597         }
598     }
599
600     /**********************************************************************************
601      * Define the VNF UpgradePostCheck service
602      **********************************************************************************/
603     rpc upgrade-post-check {
604         description "An operation to check the VNF upgrade has been successful completed and all processes are running properly.";
605         input {
606             uses common-header;
607             leaf action {
608                 type action;
609                 mandatory true;
610             }
611             uses action-identifiers;
612             leaf payload {
613                 type payload;
614                 mandatory true;
615            }
616         }
617         output {
618             uses common-header;
619             uses status;
620             leaf payload {
621                 type payload;
622                 mandatory true;
623                          }
624         }
625     }
626
627     /**********************************************************************************
628      * Define the VNF UpgradeBackup service
629      **********************************************************************************/
630     rpc upgrade-backup {
631         description "An operation to do full backup of the VNF data prior to an upgrade.";
632         input {
633             uses common-header;
634             leaf action {
635                 type action;
636                 mandatory true;
637             }
638             uses action-identifiers;
639             leaf payload {
640                 type payload;
641                 mandatory true;
642            }
643         }
644         output {
645             uses common-header;
646             uses status;
647             leaf payload {
648                 type payload;
649                 mandatory false;
650             }
651         }
652     }
653
654     /**********************************************************************************
655      * Define the VNF UpgradeBackout service
656      **********************************************************************************/
657     rpc upgrade-backout {
658         description "An operation does a backout after an UpgradeSoftware is completed (either successfully or unsuccessfully).";
659         input {
660             uses common-header;
661             leaf action {
662                 type action;
663                 mandatory true;
664             }
665             uses action-identifiers;
666             leaf payload {
667                 type payload;
668                 mandatory true;
669            }
670         }
671         output {
672             uses common-header;
673             uses status;
674             leaf payload {
675                 type payload;
676                 mandatory false;
677              }
678         }
679     }
680
681     /**********************************************************************************
682      * Define the rollback service
683      **********************************************************************************/
684     rpc rollback {
685         description "An operation to rollback to particular snapshot of a virtual network function (or VM)";
686         input {
687             uses common-header;
688             leaf action {
689                 type action;
690                  mandatory true;
691             }
692             uses action-identifiers;
693             leaf payload {
694                 type payload;
695                 mandatory false;
696             }
697             leaf identity-url {
698                 type string;
699                 mandatory true;
700             }
701             leaf snapshot-id {
702                 type string;
703                  mandatory true;
704             }
705         }
706         output {
707             uses common-header;
708             uses status;
709             leaf payload {
710                 type payload;
711                 mandatory false;
712             }
713         }
714     }
715
716
717     /**********************************************************************************
718      * Additional RPCs added here...
719      **********************************************************************************/
720
721
722     /**********************************************************************************
723      * Define the sync service
724      **********************************************************************************/
725     rpc sync {
726         description "An operation to sync the configurations of a virtual network function (or VM)";
727         input {
728             uses common-header;
729             leaf action {
730                        type action;
731                        mandatory true;
732             }
733             uses action-identifiers;
734             leaf payload {
735                 type payload;
736                 mandatory false;
737             }
738         }
739         output {
740             uses common-header;
741             uses status;
742             leaf payload {
743                 type payload;
744                 mandatory false;
745            }
746         }
747     }
748
749     /**********************************************************************************
750      * Define the terminate service
751      **********************************************************************************/
752     rpc terminate {
753         description "An operation to terminate the configurations of a virtual network function (or VM)";
754         input {
755             uses common-header;
756             leaf action {
757                        type action;
758                        mandatory true;
759             }
760             uses action-identifiers;
761             leaf payload {
762                         type payload;
763                         mandatory false;
764             }
765         }
766         output {
767             uses common-header;
768             uses status;
769         }
770     }
771
772
773     rpc configure {
774         description "An operation to configure the configurations of a virtual network
775                 function (or VM)";
776         input {
777             uses common-header;
778             leaf action {
779                 type action;
780                 mandatory true;
781             }
782             uses action-identifiers;
783             leaf payload {
784                 type payload;
785                 mandatory false;
786             }
787         }
788         output {
789             uses common-header;
790             uses status;
791             leaf payload {
792                  type payload;
793                  mandatory false;
794             }
795         }
796     }
797
798     rpc config-modify {
799         description "Use the ModifyConfig command when a full configuration cycle is either not required
800                      or is considered too costly. The ModifyConfig LCM action affects only a subset of the
801                      total configuration data of a VNF. The set of configuration parameters to be affected
802                      is a subset of the total configuration data of the target VNF type. The payload Stop
803                      Application must contain the configuration parameters to be modified and their values.
804                      A successful modify returns a success response. A failed modify returns a failure
805                      response and the specific failure messages in the response payload Stop Application";
806         input {
807             uses common-header;
808             leaf action {
809                 type action;
810                 mandatory true;
811             }
812             uses action-identifiers;
813             leaf payload {
814                 type payload;
815                 mandatory false;
816             }
817         }
818         output {
819             uses common-header;
820             uses status;
821             leaf payload {
822                  type payload;
823                  mandatory false;
824             }
825         }
826     }
827
828     rpc config-scale-out {
829             description "An operation to Modify the configuration or other action to support
830             a ConfigScaleOut of a VNF.";
831             input {
832                 uses common-header;
833                 leaf action {
834                     type action;
835                     mandatory true;
836                 }
837                 uses action-identifiers;
838                 leaf payload {
839                     type payload;
840                     mandatory false;
841                 }
842             }
843             output {
844                 uses common-header;
845                 uses status;
846                 leaf payload {
847                      type payload;
848                      mandatory false;
849                 }
850             }
851         }
852
853     rpc config-restore {
854         description "An operation to restore the configurations of a virtual network
855                 function (or VM)";
856         input {
857             uses common-header;
858             leaf action {
859                 type action;
860                 mandatory true;
861             }
862             uses action-identifiers;
863             leaf payload {
864                 type payload;
865                 mandatory false;
866             }
867         }
868         output {
869             uses common-header;
870             uses status;
871             leaf payload {
872                  type payload;
873                  mandatory false;
874             }
875         }
876     }
877
878     /**********************************************************************************
879      * Define the test service
880      **********************************************************************************/
881     rpc test {
882         description "An operation to test the configurations of a virtual network function (or VM)";
883         input {
884             uses common-header;
885             leaf action {
886                        type action;
887                        mandatory true;
888             }
889             uses action-identifiers;
890             leaf payload {
891                         type payload;
892                         mandatory false;
893             }
894         }
895         output {
896             uses common-header;
897             uses status;
898         }
899     }
900
901     /**********************************************************************************
902      * Define the stop service
903      **********************************************************************************/
904     rpc stop {
905         description "An operation to stop the configurations of a virtual network function (or VM)";
906         input {
907             uses common-header;
908             leaf action {
909                 type action;
910                 mandatory true;
911             }
912             uses action-identifiers;
913             leaf payload {
914                 type payload;
915                 mandatory false;
916             }
917         }
918         output {
919             uses common-header;
920             uses status;
921         }
922     }
923
924     rpc start {
925         description "An operation to start a virtual network function (or VM)";
926         input {
927             uses common-header;
928             leaf action {
929                 type action;
930                 mandatory true;
931             }
932             uses action-identifiers;
933             leaf payload {
934                 type payload;
935                 mandatory false;
936             }
937         }
938         output {
939             uses common-header;
940             uses status;
941         }
942     }
943
944     /**********************************************************************************
945      * Define the audit service
946      **********************************************************************************/
947     rpc audit {
948         description "An operation to audit the configurations of a virtual network function (or VM)";
949         input {
950             uses common-header;
951             leaf action {
952                 type action;
953                 mandatory true;
954             }
955             uses action-identifiers;
956             leaf payload {
957                 type payload;
958                 mandatory false;
959             }
960         }
961         output {
962             uses common-header;
963             uses status;
964             leaf payload {
965                 type payload;
966                 mandatory false;
967             }
968         }
969     }
970
971     /**********************************************************************************
972      * Define the SoftwareUpload vSCP service
973      **********************************************************************************/
974     rpc software-upload {
975         description "An operation to upload a new version of vSCP image to vSCP for updating it";
976         input {
977             uses common-header;
978             leaf action {
979                 type action;
980                 mandatory true;
981             }
982             uses action-identifiers;
983             leaf payload {
984                 type payload;
985                 mandatory false;
986             }
987         }
988         output {
989             uses common-header;
990             uses status;
991         }
992     }
993
994     /**********************************************************************************
995      * Define the PreHealthCheck vSCP service
996      **********************************************************************************/
997     rpc health-check {
998         description "An operation to perform health check of vSCP prior its upgrading";
999         input {
1000             uses common-header;
1001             leaf action {
1002                 type action;
1003                 mandatory true;
1004             }
1005             uses action-identifiers;
1006             leaf payload {
1007                 type payload;
1008                 mandatory false;
1009             }
1010         }
1011         output {
1012             uses common-header;
1013             uses status;
1014             leaf payload {
1015                 type payload;
1016                 mandatory false;
1017             }
1018         }
1019     }
1020
1021
1022     /**********************************************************************************
1023      * Define the Upgrade vSCP service
1024      **********************************************************************************/
1025     rpc live-upgrade {
1026         description "An operation to perform upgrade of vSCP";
1027         input {
1028             uses common-header;
1029             leaf action {
1030                  type action;
1031                  mandatory true;
1032             }
1033             uses action-identifiers;
1034             leaf payload {
1035                  type payload;
1036                  mandatory false;
1037             }
1038         }
1039         output {
1040             uses common-header;
1041             uses status;
1042         }
1043     }
1044
1045
1046     /**********************************************************************************
1047      * Define the VNF lock service
1048      **********************************************************************************/
1049     rpc lock {
1050          description "An operation to perform VNF lock operation";
1051           input {
1052               uses common-header;
1053                leaf action {
1054                    type action;
1055                    mandatory true;
1056                }
1057                uses action-identifiers;
1058                leaf payload {
1059                    type payload;
1060                    mandatory false;
1061                }
1062           }
1063           output {
1064               uses common-header;
1065               uses status;
1066           }
1067     }
1068
1069     /**********************************************************************************
1070      * Define the VNF unlock service
1071      **********************************************************************************/
1072     rpc unlock {
1073         description "An operation to perform VNF unlock operation";
1074          input {
1075              uses common-header;
1076              leaf action {
1077                  type action;
1078                  mandatory true;
1079              }
1080              uses action-identifiers;
1081              leaf payload {
1082                  type payload;
1083                  mandatory false;
1084              }
1085          }
1086          output {
1087              uses common-header;
1088              uses status;
1089          }
1090     }
1091
1092     /**********************************************************************************
1093      * Define the VNF check lock service
1094      **********************************************************************************/
1095     rpc check-lock {
1096         description "An operation to check VNF lock status";
1097         input {
1098             uses common-header;
1099             leaf action {
1100                        type action;
1101                        mandatory true;
1102             }
1103             uses action-identifiers;
1104         }
1105         output {
1106             uses common-header;
1107             uses status;
1108             leaf locked {
1109                 type enumeration {
1110                             enum "TRUE";
1111                             enum "FALSE";
1112                        }
1113                 description "TRUE/FALSE - returns TRUE when the given VNF was locked, otherwise returns FALSE";
1114                 mandatory false;
1115             }
1116         }
1117     }
1118
1119
1120     rpc config-backup {
1121         description "An operation to Backup configurations of a virtual network function
1122                 (or VM)";
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             leaf payload {
1139                  type payload;
1140                  mandatory false;
1141             }
1142         }
1143     }
1144
1145     rpc config-backup-delete {
1146         description "An operation to Delete backup configurations of a virtual network
1147                 function (or VM)";
1148         input {
1149             uses common-header;
1150             leaf action {
1151                 type action;
1152                 mandatory true;
1153             }
1154             uses action-identifiers;
1155         }
1156         output {
1157             uses common-header;
1158             uses status;
1159             leaf payload {
1160                  type payload;
1161                  mandatory false;
1162             }
1163         }
1164     }
1165
1166     rpc config-export {
1167         description "An operation to Export configurations of a virtual network function
1168                 (or VM)";
1169         input {
1170             uses common-header;
1171             leaf action {
1172                 type action;
1173                 mandatory true;
1174             }
1175             uses action-identifiers;
1176         }
1177         output {
1178             uses common-header;
1179             uses status;
1180         }
1181     }
1182     rpc stop-application {
1183             description "An operation to Stop Application traffic to a virtual network function";
1184             input {
1185                 uses common-header;
1186                 leaf action {
1187                     type action;
1188                     mandatory true;
1189                 }
1190                 uses action-identifiers;
1191                 leaf payload {
1192                      type payload;
1193                      mandatory false;
1194                 }
1195             }
1196             output {
1197                 uses common-header;
1198                 uses status;
1199                 leaf payload {
1200                     type payload;
1201                     mandatory false;
1202                 }
1203             }
1204         }
1205
1206     /**********************************************************************************
1207      * Define the VNF Start Application service
1208      **********************************************************************************/
1209     rpc start-application {
1210         description "An operation to perform VNF Start Application operation";
1211         input {
1212             uses common-header;
1213             leaf action {
1214                 type action;
1215                  mandatory true;
1216             }
1217             uses action-identifiers;
1218             leaf payload {
1219                 type payload;
1220                 mandatory false;
1221             }
1222         }
1223         output {
1224             uses common-header;
1225             uses status;
1226             leaf payload {
1227                 type payload;
1228                 mandatory false;
1229             }
1230         }
1231     }
1232
1233
1234     /**********************************************************************************
1235      * Gets the current state of the previously submitted LCM request
1236      **********************************************************************************/
1237     rpc action-status {
1238         description "An operation to get the current state of the previously submitted LCM request";
1239         input {
1240             uses common-header;
1241             leaf action {
1242                 type action;
1243                 mandatory true;
1244             }
1245             uses action-identifiers;
1246             leaf payload {
1247                 type payload;
1248                 mandatory false;
1249             }
1250         }
1251         output {
1252            uses common-header;
1253            uses status;
1254            leaf payload {
1255                 type payload;
1256            }
1257         }
1258     }
1259
1260     /**********************************************************************************
1261      * Define the VNF Query service
1262      **********************************************************************************/
1263     rpc query {
1264         description "An operation to query the status of a targe VNF.
1265                      Returns information on each VM, including state (active or standby)
1266                      and status (healthy or unhealthy)";
1267         input {
1268             uses common-header;
1269             leaf action {
1270                 type action;
1271                 mandatory true;
1272             }
1273             uses action-identifiers;
1274         }
1275         output {
1276             uses common-header;
1277             uses status;
1278             list query-results {
1279                 leaf vserver-id {
1280                     description "Identifier of a VM";
1281                     type string;
1282                     mandatory true;
1283                 }
1284                 leaf vm-state {
1285                     description "The state of the VM";
1286                     type vm-state;
1287                     mandatory true;
1288                 }
1289                 leaf vm-status {
1290                     description "the status of the VM";
1291                     type vm-status;
1292                     mandatory true;
1293                 }
1294             }
1295         }
1296     }
1297
1298     /**********************************************************************************
1299      * Define the Reboot service
1300      **********************************************************************************/
1301     rpc reboot {
1302         description "An operation to reboot a specified virtual machine (VM)";
1303         input {
1304             uses common-header;
1305             leaf action {
1306                 type action;
1307                 mandatory true;
1308             }
1309             uses action-identifiers;
1310             leaf payload {
1311                 type payload;
1312                 mandatory false;
1313             }
1314          }
1315         output {
1316             uses common-header;
1317             uses status;
1318         }
1319     }
1320
1321     /**********************************************************************************
1322      * Define the VM attach volume service
1323      **********************************************************************************/
1324     rpc attach-volume {
1325         description "An operation to attach a cinder volume to a VM";
1326         input {
1327             uses common-header;
1328             leaf action {
1329                 type action;
1330                 mandatory true;
1331             }
1332             uses action-identifiers;
1333             leaf payload {
1334                  type payload;
1335                  mandatory true;
1336             }
1337         }
1338         output {
1339             uses common-header;
1340             uses status;
1341         }
1342     }
1343
1344     /**********************************************************************************
1345      * Define the VM detach volume service
1346      **********************************************************************************/
1347     rpc detach-volume {
1348         description "An operation to detach a cinder volume from a VM";
1349         input {
1350             uses common-header;
1351             leaf action {
1352                 type action;
1353                 mandatory true;
1354             }
1355             uses action-identifiers;
1356             leaf payload {
1357                  type payload;
1358                  mandatory true;
1359             }
1360         }
1361         output {
1362             uses common-header;
1363             uses status;
1364         }
1365     }
1366
1367     /**********************************************************************************
1368      * Define the PreConfigure service
1369     **********************************************************************************/
1370     rpc pre-configure {
1371         description "An operation to retrieve the current config";
1372         input {
1373             uses common-header;
1374             leaf action {
1375                 type action;
1376                 mandatory true;
1377             }
1378             uses action-identifiers;
1379             leaf payload {
1380                 type payload;
1381                 mandatory true; 
1382             }
1383         }
1384         output {
1385             uses common-header;
1386             uses status;
1387             leaf payload {
1388                 type payload;
1389                 mandatory false;
1390             }
1391         }
1392     }
1393
1394     /**********************************************************************************
1395      * Define the VNF GetConfig service
1396     **********************************************************************************/
1397     rpc get-config {
1398         description "An operation to retrieve the current running config";
1399         input {
1400             uses common-header;
1401             leaf action {
1402                 type action;
1403                 mandatory true;
1404             }
1405             uses action-identifiers;
1406             leaf payload {
1407                 type payload;
1408                 mandatory true; 
1409             }
1410         }
1411         output {
1412             uses common-header;
1413             uses status;
1414             leaf payload {
1415                 type payload;
1416                 mandatory false;
1417             }
1418         }
1419     }
1420
1421     /**********************************************************************************
1422      * Define the traffic distribution service
1423      **********************************************************************************/
1424     rpc distribute-traffic {
1425         description "An operation to distribute traffic between VMs";
1426         input {
1427             uses common-header;
1428             leaf action {
1429                 type action;
1430                 mandatory true;
1431             }
1432             uses action-identifiers;
1433             leaf payload {
1434                 type payload;
1435                 mandatory true;
1436             }
1437         }
1438         output {
1439             uses common-header;
1440             uses status;
1441         }
1442     }
1443
1444     /**********************************************************************************
1445      * Define the distribute traffic check service
1446      **********************************************************************************/
1447     rpc distribute-traffic-check {
1448         description "An operation to check conditions and the result of DistributeTraffic.";
1449         input {
1450             uses common-header;
1451             leaf action {
1452                 type action;
1453                 mandatory true;
1454             }
1455             uses action-identifiers;
1456             leaf payload {
1457                 type payload;
1458                 mandatory true;
1459             }
1460         }
1461         output {
1462             uses common-header;
1463             uses status;
1464         }
1465     }
1466
1467     /**********************************************************************************
1468      * Define the PreRebuild service
1469     **********************************************************************************/
1470     rpc pre-rebuild {
1471         description "An operation to perform prerequisite steps before a rebuild action";
1472         input {
1473             uses common-header;
1474             leaf action {
1475                 type action;
1476                 mandatory true;
1477             }
1478             uses action-identifiers;
1479             leaf payload {
1480                 type payload;
1481                 mandatory true; 
1482             }
1483         }
1484         output {
1485             uses common-header;
1486             uses status;
1487             leaf payload {
1488                 type payload;
1489                 mandatory false;
1490                            }
1491         }
1492     }
1493
1494     /**********************************************************************************
1495      * Define the PostRebuild service
1496     **********************************************************************************/
1497     rpc post-rebuild {
1498         description "An operation to perform subsequent steps after a rebuild action";
1499         input {
1500             uses common-header;
1501             leaf action {
1502                 type action;
1503                 mandatory true;
1504             }
1505             uses action-identifiers;
1506             leaf payload {
1507                 type payload;
1508                 mandatory true; 
1509             }
1510         }
1511         output {
1512             uses common-header;
1513             uses status;
1514             leaf payload {
1515                 type payload;
1516                 mandatory false;
1517                            }
1518         }
1519     }
1520
1521     /**********************************************************************************
1522      * Define the PreEvacuate service
1523      **********************************************************************************/
1524     rpc pre-evacuate {
1525         description "An operation to perform prerequisite steps before an evacuate action";
1526         input {
1527             uses common-header;
1528             leaf action {
1529                 type action;
1530                 mandatory true;
1531             }
1532             uses action-identifiers;
1533             leaf payload {
1534                 type payload;
1535                 mandatory false; 
1536             }
1537         }
1538         output {
1539             uses common-header;
1540             uses status;
1541             leaf payload {
1542                 type payload;
1543                 mandatory false;
1544             }
1545         }
1546     }
1547
1548     /**********************************************************************************
1549      * Define the PostEvacuate service
1550      **********************************************************************************/
1551     rpc post-evacuate {
1552         description "An operation to perform postevacuate on  specified Ansible virtual machine (VM)";
1553         input {
1554             uses common-header;
1555             leaf action {
1556                 type action;
1557                 mandatory true;
1558             }
1559             uses action-identifiers;
1560             leaf payload {
1561                 type payload;
1562                 mandatory false;
1563             }
1564          }
1565         output {
1566             uses common-header;
1567             uses status;
1568             leaf payload {
1569                 type payload;
1570                 mandatory false;
1571             }
1572         }
1573     }
1574
1575     /**********************************************************************************
1576      * Define the PreMigrate service
1577      **********************************************************************************/
1578     rpc pre-migrate {
1579         description "An operation to perform premigrate on  specified Ansible virtual machine (VM)";
1580         input {
1581             uses common-header;
1582             leaf action {
1583                 type action;
1584                 mandatory true;
1585             }
1586             uses action-identifiers;
1587             leaf payload {
1588                 type payload;
1589                 mandatory false;
1590             }
1591          }
1592         output {
1593             uses common-header;
1594             uses status;
1595             leaf payload {
1596                 type payload;
1597                 mandatory false;
1598             }
1599         }
1600     }
1601
1602     /**********************************************************************************
1603      * Define the PostMigrate service
1604      **********************************************************************************/
1605     rpc post-migrate {
1606         description "An operation to perform postmigrate on  specified Ansible virtual machine (VM)";
1607         input {
1608             uses common-header;
1609             leaf action {
1610                 type action;
1611                 mandatory true;
1612             }
1613             uses action-identifiers;
1614             leaf payload {
1615                 type payload;
1616                 mandatory false;
1617             }
1618          }
1619         output {
1620             uses common-header;
1621             uses status;
1622             leaf payload {
1623                 type payload;
1624                 mandatory false;
1625             }
1626         }
1627     }
1628
1629     /**********************************************************************************
1630      * Define the StartTraffic service
1631      **********************************************************************************/
1632     rpc start-traffic {
1633         description "An operation to start a traffic action on specified Ansible virtual machine (VM)";
1634         input {
1635             uses common-header;
1636             leaf action {
1637                 type action;
1638                 mandatory true;
1639             }
1640             uses action-identifiers;
1641             leaf payload {
1642                 type payload;
1643                 mandatory false; 
1644             }
1645         }
1646         output {
1647             uses common-header;
1648             uses status;
1649             leaf payload {
1650                 type payload;
1651                 mandatory false; 
1652             }
1653         }
1654     }
1655
1656     /**********************************************************************************
1657      * Define the StatusTraffic service
1658      **********************************************************************************/
1659     rpc status-traffic {
1660         description "An operation to perform status-traffic on specified Ansible virtual machine (VM)";
1661         input {
1662             uses common-header;
1663             leaf action {
1664                 type action;
1665                 mandatory true;
1666             }
1667             uses action-identifiers;
1668             leaf payload {
1669                 type payload;
1670                 mandatory false; 
1671             }
1672         }
1673         output {
1674             uses common-header;
1675             uses status;
1676             leaf payload {
1677                 type payload;
1678                 mandatory false; 
1679             }
1680         }
1681     }
1682
1683     /**********************************************************************************
1684      * Define the StopTraffic service
1685      **********************************************************************************/
1686     rpc stop-traffic {
1687         description "An operation to stop an in-process traffic action";
1688         input {
1689             uses common-header;
1690             leaf action {
1691                 type action;
1692                 mandatory true;
1693             }
1694             uses action-identifiers;
1695             leaf payload {
1696                 type payload;
1697                 mandatory false; 
1698             }
1699         }
1700         output {
1701             uses common-header;
1702             uses status;
1703             leaf payload {
1704                 type payload;
1705                 mandatory false; 
1706             }
1707         }
1708     }
1709
1710     /**********************************************************************************
1711      * Define the VNF provisioning service
1712      **********************************************************************************/
1713     rpc provisioning {
1714         description "An vnf operation for  provisioning";
1715         input {
1716             uses common-header;
1717             leaf action {
1718                 type action;
1719                 mandatory true;
1720             }
1721             uses action-identifiers;
1722             leaf payload {
1723                 type payload;
1724                 mandatory true; 
1725             }
1726         }
1727         output {
1728             uses common-header;
1729             uses status;
1730             leaf payload {
1731                 type payload;
1732                 mandatory false;
1733                            }
1734         }
1735     }
1736
1737     /**********************************************************************************
1738      * Define the VNF LicenseManagement service
1739      **********************************************************************************/
1740     rpc license-management {
1741         description "An vnf operation for  provisioning";
1742         input {
1743             uses common-header;
1744             leaf action {
1745                 type action;
1746                 mandatory true;
1747             }
1748             uses action-identifiers;
1749             leaf payload {
1750                 type payload;
1751                 mandatory true; 
1752             }
1753         }
1754         output {
1755             uses common-header;
1756             uses status;
1757             leaf payload {
1758                 type payload;
1759                 mandatory false;
1760                            }
1761         }
1762     }
1763
1764     /**********************************************************************************
1765      * Define the VNF ConfigScaleIn service
1766      **********************************************************************************/
1767     rpc config-scale-in {
1768             description "An operation to Modify the configuration or other action to support
1769             a ConfigScaleIn of a VNF.";
1770             input {
1771                 uses common-header;
1772                 leaf action {
1773                     type action;
1774                     mandatory true;
1775                 }
1776                 uses action-identifiers;
1777                 leaf payload {
1778                     type payload;
1779                     mandatory false;
1780                 }
1781             }
1782             output {
1783                 uses common-header;
1784                 uses status;
1785                 leaf payload {
1786                      type payload;
1787                      mandatory false;
1788                 }
1789             }
1790         }
1791
1792     /**********************************************************************************
1793      * Define the downloadNESw operation
1794      **********************************************************************************/
1795     rpc download-n-e-sw {
1796         description "An operation to download NE software";
1797         input {
1798             uses common-header;
1799             leaf action {
1800                 type action;
1801                 mandatory true;
1802             }
1803             uses action-identifiers;
1804             leaf payload {
1805                 type payload;
1806                 mandatory true;
1807            }
1808         }
1809         output {
1810             uses common-header;
1811             uses status;
1812             leaf payload {
1813                 type payload;
1814                 mandatory true;
1815             }
1816         }
1817     }
1818
1819     /**********************************************************************************
1820      * Define the activateNESw operation
1821      **********************************************************************************/
1822     rpc activate-n-e-sw {
1823         description "An operation to activate NE software";
1824         input {
1825             uses common-header;
1826             leaf action {
1827                 type action;
1828                 mandatory true;
1829             }
1830             uses action-identifiers;
1831             leaf payload {
1832                 type payload;
1833                 mandatory true;
1834            }
1835         }
1836         output {
1837             uses common-header;
1838             uses status;
1839             leaf payload {
1840                 type payload;
1841                 mandatory true;
1842             }
1843         }
1844     }
1845
1846     /**********************************************************************************
1847      *  Additional RPCs added here...
1848      **********************************************************************************/
1849 }