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