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