6da825195eda43ce5c4ae470b59eea4a8d3e1957
[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                 list vm {
90                     ordered-by user;
91                     key "vserver-id";
92                     leaf vserver-id {
93                         type string;
94                     }
95                     container vnfc {
96                         leaf vnfc-type {
97                            type string;
98                         }
99                         leaf vnfc-name {
100                             type string;
101                         }
102                     }
103                 }
104             }
105         }
106     }
107
108     grouping dependency-info {
109         container dependency-info {
110             list vnfcs {
111                 leaf vnfc-type {
112                     type string;
113                 }
114                 leaf mandatory {
115                     type boolean;
116                 }
117                 leaf resilience {
118                     type string;
119                 }
120                 leaf-list parents {
121                     type string;
122                 }
123             }
124         }
125     }
126
127     grouping tunable-parameters {
128         container tunable-parameters {
129             leaf strategy {
130                 type enumeration {
131                     enum "FORWARD";
132                     enum "REVERSE";
133                 }
134             }
135             leaf wait-time {
136                 type uint16;
137             }
138             leaf retry-count {
139                 type uint16;
140             }
141         }
142     }
143
144     grouping capabilities {
145         container capabilities {
146             leaf-list vnf {
147                 type string;
148             }
149             leaf-list vf-module {
150                 type string;
151             }
152             leaf-list vm {
153                 type string;
154             }
155             leaf-list vnfc {
156                 type string;
157             }
158         }
159     }
160
161     grouping response {
162             container status {
163                 leaf code {
164                     type uint16;
165                 }
166                 leaf message {
167                     type string;
168                 }
169             }
170             list transactions{
171                 ordered-by user;
172                 key "transaction-id";
173                 leaf transaction-id{
174                     type uint16;
175                 }
176                 leaf action{
177                     type string;
178                 }
179                 leaf action-level{
180                     type string;
181                 }
182                 container action-identifier{
183                     leaf vserver-id {
184                         type string;
185                     }
186                     leaf vnfc-name {
187                         type string;
188                     }
189                     leaf vnf-id {
190                         type string;
191                     }
192                 }
193                 leaf payload{
194                     type string;
195                 }
196                 leaf precheck-operator{
197                     type string;
198                 }
199                 list precheck-options{
200                     leaf pre-transaction-id{
201                         type uint16;
202                     }
203                     leaf param-name{
204                         type string;
205                     }
206                     leaf param-value{
207                         type string;
208                     }
209                     leaf rule{
210                         type string;
211                     }
212                 }
213                 list responses{
214                     leaf response-message{
215                         type string;
216                     }
217                     container response-action{
218                         leaf wait{
219                             type uint16;
220                         }
221                         leaf retry{
222                             type uint16;
223                         }
224                         leaf continue{
225                             type boolean;
226                         }
227                         leaf stop{
228                             type boolean;
229                         }
230                         leaf ignore{
231                             type boolean;
232                         }
233                         leaf jump{
234                          type uint16;
235                         }
236                     }
237                 }
238             }
239     }
240
241     rpc generate-sequence {
242         input{
243             uses request-info;
244             uses inventory-info;
245             uses dependency-info;
246             uses tunable-parameters;
247             uses capabilities;
248         }
249         output{
250             uses response;
251         }
252     }
253    }