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