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