Adding nemo engine.
[nemo.git] / nemo-api / src / main / yang / nemo-operation.yang
1 /*\r
2  * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 \r
9 module nemo-operation {\r
10     yang-version 1;\r
11 \r
12     namespace "urn:opendaylight:params:xml:ns:yang:nemo:operation";\r
13     prefix "nemo-operation";\r
14 \r
15     import nemo-common {prefix nemo-common;}\r
16 \r
17     revision "2015-10-10" {\r
18         description\r
19             "Initial revision.";\r
20     }\r
21 \r
22     container condition-parameter-definitions {\r
23         list condition-parameter-definition {\r
24             description\r
25                 "Defines the condition parameter with its metadata.";\r
26 \r
27             key "parameter-name";\r
28             leaf parameter-name {\r
29                 description\r
30                     "A name for the condition parameter.";\r
31                 type nemo-common:parameter-name;\r
32                 mandatory true;\r
33             }\r
34 \r
35             leaf parameter-value-type {\r
36                 description\r
37                     "A type of value for the condition parameter.";\r
38                 type enumeration {\r
39                     enum string {\r
40                         description\r
41                             "A string-valued parameter.";\r
42                     }\r
43                     enum int {\r
44                         description\r
45                             "An integer-valued parameter.";\r
46                     }\r
47                     enum range {\r
48                         description\r
49                             "An integer-range parameter.";\r
50                     }\r
51                 }\r
52             }\r
53 \r
54             container parameter-match-patterns {\r
55                 description\r
56                     "Defines the match patterns of the condition parameter.";\r
57 \r
58                 leaf-list parameter-match-pattern {\r
59                     type enumeration {\r
60                         enum less-than;\r
61                         enum not-less-than;\r
62                         enum equal;\r
63                         enum not-equal;\r
64                         enum greater-than;\r
65                         enum not-greater-than;\r
66                         enum between;\r
67                         enum periodical;\r
68                     }\r
69                 }\r
70             }\r
71         }\r
72     }\r
73 \r
74     container action-definitions {\r
75         list action-definition {\r
76             description\r
77                 "Defines the actions which will be supported by the NEMO project.";\r
78 \r
79             key "action-name";\r
80             leaf action-name {\r
81                 description\r
82                     "A name for the action definition.";\r
83                 type nemo-common:action-name;\r
84                 mandatory true;\r
85             }\r
86 \r
87             leaf parameter-value-type {\r
88                 description\r
89                     "The type of the action parameter.";\r
90                 default string;\r
91                 type enumeration {\r
92                     enum string {\r
93                         description\r
94                             "A string-valued parameter.";\r
95                     }\r
96                     enum int {\r
97                         description\r
98                             "An integer-valued parameter.";\r
99                     }\r
100                     enum range {\r
101                         description\r
102                             "An integer-range parameter.";\r
103                     }\r
104                 }\r
105             }\r
106         }\r
107     }\r
108 \r
109     grouping condition-instance {\r
110         description\r
111             "Specific a instance of condition whose metadata has been filled in.";\r
112 \r
113         list condition-segment {\r
114             description\r
115                 "The segment entities will be composed into a whole condition entity.\r
116                  Each segment will be a sub expression of the condition.";\r
117 \r
118             key "condition-segment-id";\r
119             leaf condition-segment-id {\r
120                 description\r
121                     "A unique ID for a condition segment.";\r
122                 type nemo-common:condition-segment-id;\r
123                 mandatory true;\r
124             }\r
125 \r
126             leaf condition-parameter-name {\r
127                 description\r
128                     "A name for a conditon parameter.";\r
129                 type nemo-common:condition-parameter-name;\r
130             }\r
131 \r
132             leaf condition-parameter-match-pattern {\r
133                 description\r
134                     "The operator for the condition parameter and it's target value.";\r
135                 type enumeration {\r
136                     enum less-than;\r
137                     enum not-less-than;\r
138                     enum equal;\r
139                     enum not-equal;\r
140                     enum greater-than;\r
141                     enum not-greater-than;\r
142                     enum between;\r
143                     enum periodical;\r
144                 }\r
145             }\r
146 \r
147             container condition-parameter-target-value {\r
148                 description\r
149                     "The target value of condition parameter.";\r
150 \r
151                 leaf string-value {\r
152                     type string;\r
153                 }\r
154 \r
155                 leaf int-value {\r
156                     type int64;\r
157                 }\r
158 \r
159                 container range-value {\r
160                     leaf min {\r
161                         type int64;\r
162                         mandatory true;\r
163                     }\r
164 \r
165                     leaf max {\r
166                         type int64;\r
167                         mandatory true;\r
168                     }\r
169                 }\r
170             }\r
171 \r
172             leaf precursor-relation-operator {\r
173                 description\r
174                     "The logical operator between current segment and the next segment.";\r
175                 type enumeration {\r
176                     enum none;\r
177                     enum and;\r
178                     enum or;\r
179                     enum not;\r
180                 }\r
181             }\r
182 \r
183             leaf order {\r
184                 description\r
185                     "The order of the segment in the whole condition entity.";\r
186                 type uint32;\r
187             }\r
188         }\r
189     }\r
190 \r
191     grouping action-instance {\r
192         description\r
193             "Specific a action instance whose metadata has been filled in.";\r
194 \r
195         leaf action-name {\r
196             description\r
197                 "A name for a action instance.";\r
198             type nemo-common:action-name;\r
199             mandatory true;\r
200         }\r
201 \r
202         container parameter-values {\r
203             description\r
204                 "The parameter value list of an action.";\r
205 \r
206             list string-value {\r
207                 key "value order";\r
208                 leaf value {\r
209                     type string;\r
210                 }\r
211 \r
212                 leaf order {\r
213                     type uint32;\r
214                 }\r
215             }\r
216 \r
217             list int-value {\r
218                 key "value order";\r
219                 leaf value {\r
220                     type int64;\r
221                 }\r
222 \r
223                 leaf order {\r
224                     type uint32;\r
225                 }\r
226             }\r
227 \r
228             container range-value {\r
229                 leaf min {\r
230                     type int64;\r
231                     mandatory true;\r
232                 }\r
233 \r
234                 leaf max {\r
235                     type int64;\r
236                     mandatory true;\r
237                 }\r
238             }\r
239         }\r
240     }\r
241 \r
242     grouping operation-instance {\r
243         description\r
244             "Specific an operation instance whose metadata has been filled in.\r
245              Operation is a type of intent which refers to taking for some specific\r
246              actions to realize the purpose.";\r
247 \r
248         leaf operation-id {\r
249             description\r
250                 "A unique ID for a operation instance.";\r
251             type nemo-common:operation-id;\r
252             mandatory true;\r
253         }\r
254 \r
255         leaf operation-name {\r
256             description\r
257                 "A user-visible and unique name for a operation instance.";\r
258             type nemo-common:operation-name;\r
259             mandatory true;\r
260         }\r
261 \r
262         leaf priority {\r
263             description\r
264                 "Defines the priority of a operation instance.";\r
265             type uint32;\r
266             default 0;\r
267         }\r
268 \r
269         leaf target-object {\r
270             description\r
271                 "The target object which the operation instance will apply to.";\r
272             type nemo-common:object-id;\r
273             mandatory true;\r
274         }\r
275 \r
276         uses condition-instance;\r
277 \r
278         list action {\r
279             description\r
280                 "The action list for the operation instance.";\r
281 \r
282             key "action-name";\r
283             uses action-instance;\r
284 \r
285             leaf order {\r
286                 description\r
287                     "The order of an action instance in execution sequence.";\r
288                 type uint32;\r
289             }\r
290 \r
291             min-elements 1;\r
292         }\r
293     }\r
294 }\r