Added seq generator changes for vnf level actions
[appc.git] / appc-sequence-generator / appc-sequence-generator-model / src / main / yang / sequence-generator.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 module sequence-generator {
26     yang-version 1;
27
28     namespace "org:onap:appc:sequencegenerator";
29     prefix sequencegenerator;
30
31     description
32         "Defines sequence generator api interface for App-C services";
33
34     revision "2017-07-06" {
35         description
36                 "Initial draft";
37     }
38
39     grouping request-info {
40         container request-info{
41             leaf action {
42                 type enumeration {
43                    enum "Start";
44                    enum "Stop";
45                    enum "Restart";
46                 }
47             }
48             leaf action-level {
49                 type enumeration {
50                    enum "vm";
51                    enum "vnfc";
52                    enum "vnf";
53                    enum "vf-module";
54                 }
55             }
56         container action-identifier {
57             leaf vnf-id {
58                 description "identifies the VNF to which this action is to be applied(vnf-id uniquely identifies the service-instance referred to).";
59                 type string;
60             }
61             leaf vnfc-name {
62                   type string;
63             }
64             leaf vserver-id {
65                   type string;
66             }
67         }
68             leaf payload {
69                 description "An action-specific value opaque to the APPC handler.
70                              The value can be any valid JSON type (primitive, object, collection of those two).
71                              APPC will pass the value as raw JSON string";
72                 type string;
73             }
74         }
75     }
76
77     grouping inventory-info {
78         container inventory-info {
79             container vnf-info {
80                 leaf vnf-id {
81                     type string;
82                 }
83                 leaf vnf-name {
84                     type string;
85                 }
86                 leaf vnf-type {
87                     type string;
88                 }
89                 leaf identity-url {
90                     type string;
91                 }
92                 list vm {
93                     ordered-by user;
94                     key "vserver-id";
95                     leaf vserver-id {
96                         type string;
97                     }
98                     leaf vm-id {
99                         type string;
100                     }
101                     container vnfc {
102                         leaf vnfc-type {
103                            type string;
104                         }
105                         leaf vnfc-name {
106                             type string;
107                         }
108                     }
109                 }
110             }
111         }
112     }
113
114     grouping dependency-info {
115         container dependency-info {
116             list vnfcs {
117                 leaf vnfc-type {
118                     type string;
119                 }
120                 leaf mandatory {
121                     type boolean;
122                 }
123                 leaf resilience {
124                     type string;
125                 }
126                 leaf-list parents {
127                     type string;
128                 }
129             }
130         }
131     }
132
133     grouping tunable-parameters {
134         container tunable-parameters {
135             leaf strategy {
136                 type enumeration {
137                     enum "FORWARD";
138                     enum "REVERSE";
139                 }
140             }
141             leaf wait-time {
142                 type uint16;
143             }
144             leaf retry-count {
145                 type uint16;
146             }
147         }
148     }
149
150     grouping capabilities {
151         container capabilities {
152             leaf-list vnf {
153                 type string;
154             }
155             leaf-list vf-module {
156                 type string;
157             }
158             leaf-list vm {
159                 type string;
160             }
161             leaf-list vnfc {
162                 type string;
163             }
164         }
165     }
166
167     grouping response {
168             container status {
169                 leaf code {
170                     type uint16;
171                 }
172                 leaf message {
173                     type string;
174                 }
175             }
176             list transactions{
177                 ordered-by user;
178                 key "transaction-id";
179                 leaf transaction-id{
180                     type uint16;
181                 }
182                 leaf action{
183                     type string;
184                 }
185                 leaf action-level{
186                     type string;
187                 }
188                 container action-identifier{
189                     leaf vserver-id {
190                         type string;
191                     }
192                     leaf vnfc-name {
193                         type string;
194                     }
195                     leaf vnf-id {
196                         type string;
197                     }
198                 }
199                 leaf payload{
200                     type string;
201                 }
202                 leaf precheck-operator{
203                     type string;
204                 }
205                 list precheck-options{
206                     leaf pre-transaction-id{
207                         type uint16;
208                     }
209                     leaf param-name{
210                         type string;
211                     }
212                     leaf param-value{
213                         type string;
214                     }
215                     leaf rule{
216                         type string;
217                     }
218                 }
219                 list responses{
220                     leaf response-message{
221                         type string;
222                     }
223                     container response-action{
224                         leaf wait{
225                             type uint16;
226                         }
227                         leaf retry{
228                             type uint16;
229                         }
230                         leaf continue{
231                             type boolean;
232                         }
233                         leaf stop{
234                             type boolean;
235                         }
236                         leaf ignore{
237                             type boolean;
238                         }
239                         leaf jump{
240                          type uint16;
241                         }
242                     }
243                 }
244             }
245     }
246
247     rpc generate-sequence {
248         input{
249             uses request-info;
250             uses inventory-info;
251             uses dependency-info;
252             uses tunable-parameters;
253             uses capabilities;
254         }
255         output{
256             uses response;
257         }
258     }
259    }