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