Adding nemo engine.
[nemo.git] / nemo-api / src / main / yang / nemo-object.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-object {\r
10     yang-version 1;\r
11 \r
12     namespace "urn:opendaylight:params:xml:ns:yang:nemo:object";\r
13     prefix "nemo-object";\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     grouping property-definitions {\r
23         list property-definition {\r
24             description\r
25                 "The property definitions for the type of node or connection.";\r
26 \r
27             key "property-name";\r
28             leaf property-name {\r
29                 description\r
30                     "A user-visible and unique name for the property.";\r
31                 type nemo-common:property-name;\r
32                 mandatory true;\r
33             }\r
34 \r
35             leaf property-value-type {\r
36                 description\r
37                     "The type of the property value.";\r
38                 default string;\r
39                 type enumeration {\r
40                     enum string {\r
41                         description\r
42                             "An string-valued property.";\r
43                     }\r
44                     enum int {\r
45                         description\r
46                             "An integer-valued property.";\r
47                     }\r
48                     enum range {\r
49                         description\r
50                             "An integer-range property.";\r
51                     }\r
52                 }\r
53             }\r
54 \r
55             leaf is-required {\r
56                 description\r
57                     "Specify whether the property is required for the object.";\r
58                 default optional;\r
59                 type enumeration {\r
60                     enum required {\r
61                         description\r
62                             "The property is required";\r
63                     }\r
64                     enum optional {\r
65                         description\r
66                             "The property is optional";\r
67                     }\r
68                 }\r
69             }\r
70 \r
71             leaf is-read-only {\r
72                 description\r
73                     "Specify whether the property is read-only for object.";\r
74                 default write-read;\r
75                 type enumeration {\r
76                     enum write-read {\r
77                         description\r
78                             "The property can be read and written.";\r
79                     }\r
80                     enum read-only {\r
81                         description\r
82                             "The property is read-only.";\r
83                     }\r
84                 }\r
85             }\r
86         }\r
87     }\r
88 \r
89     container node-definitions {\r
90         list node-definition {\r
91             description\r
92                 "Define new node model/type which can be used in other places,\r
93                  and include node type name and its property.";\r
94 \r
95             key "node-type";\r
96             leaf node-type {\r
97                 description\r
98                     "A user-visible and unique identifier for the node type.";\r
99                 type nemo-common:node-type;\r
100                 mandatory true;\r
101             }\r
102 \r
103             uses property-definitions;\r
104         }\r
105     }\r
106 \r
107     container connection-definitions {\r
108         list connection-definition {\r
109             description\r
110                 "Define new connection model/type which can be used in other places,\r
111                  and include connection type name and its property.";\r
112 \r
113             key "connection-type";\r
114             leaf connection-type {\r
115                 description\r
116                     "A user-visible and unique identifier for the connection type.";\r
117                 type nemo-common:connection-type;\r
118                 mandatory true;\r
119             }\r
120 \r
121             uses property-definitions;\r
122         }\r
123     }\r
124 \r
125     container match-item-definitions {\r
126         list match-item-definition {\r
127             description\r
128                 "Define the match item which uses to match the flow.";\r
129 \r
130             key "match-item-name";\r
131             leaf match-item-name {\r
132                 description\r
133                     "A user-visible and unique name for the match item.";\r
134                 type nemo-common:match-item-name;\r
135                 mandatory true;\r
136             }\r
137 \r
138             leaf match-item-value-type {\r
139                 description\r
140                     "The value type of the match item.";\r
141                 default string;\r
142                 type enumeration {\r
143                     enum string {\r
144                         description\r
145                             "A string-valued match item.";\r
146                     }\r
147                     enum int {\r
148                         description\r
149                             "An integer-valued match item.";\r
150                     }\r
151                     enum range {\r
152                         description\r
153                             "An integer-range match item.";\r
154                     }\r
155                 }\r
156             }\r
157         }\r
158     }\r
159 \r
160     container flow-property-definitions {\r
161         description\r
162             "Contains the property definitions for the flow.";\r
163 \r
164         uses property-definitions;\r
165     }\r
166 \r
167     grouping property-instance {\r
168         description\r
169             "The property instance and its associated metadata.";\r
170 \r
171         leaf property-name {\r
172             description\r
173                 "The name for the property which can be seen as a unique\r
174                  identifier of the property.";\r
175             type nemo-common:property-name;\r
176             mandatory true;\r
177         }\r
178 \r
179         container property-values {\r
180             description\r
181                 "The value list of the property.";\r
182 \r
183             list string-value {\r
184                 key "value order";\r
185                 leaf value {\r
186                     type string;\r
187                 }\r
188 \r
189                 leaf order {\r
190                     type uint32;\r
191                 }\r
192             }\r
193 \r
194             list int-value {\r
195                 key "value order";\r
196                 leaf value {\r
197                     type int64;\r
198                 }\r
199 \r
200                 leaf order {\r
201                     type uint32;\r
202                 }\r
203             }\r
204 \r
205             container range-value {\r
206                 leaf min {\r
207                     type int64;\r
208                     mandatory true;\r
209                 }\r
210 \r
211                 leaf max {\r
212                     type int64;\r
213                     mandatory true;\r
214                 }\r
215             }\r
216         }\r
217     }\r
218 \r
219     grouping node-instance {\r
220         description\r
221             "It represents the node instance and its metadata.\r
222              A node represents the functions a network node may provide in a\r
223              network such as network services,or a group of network elements.";\r
224 \r
225         leaf node-id {\r
226             description\r
227                 "A unique ID for a node instance";\r
228             type nemo-common:node-id;\r
229             mandatory true;\r
230         }\r
231 \r
232         leaf node-name {\r
233             description\r
234                 "A user-visible and unique name for a node instance.";\r
235             type nemo-common:node-name;\r
236             mandatory true;\r
237         }\r
238 \r
239         leaf node-type {\r
240             description\r
241                 "A user-visible and unique type identifier for a node instance.";\r
242             type nemo-common:node-type;\r
243             mandatory true;\r
244         }\r
245 \r
246         list sub-node {\r
247             description\r
248                 "Represents the sub-nodes which have been included\r
249                  by the node instance logically.";\r
250 \r
251             key "node-id";\r
252             leaf node-id {\r
253                 description\r
254                     "A unique ID for a node instance.";\r
255                 type nemo-common:node-id;\r
256             }\r
257 \r
258             leaf order {\r
259                 description\r
260                     "Specify the order of the node in a sequence node list.";\r
261                 type uint32;\r
262             }\r
263         }\r
264 \r
265         list property {\r
266             description\r
267                 "The property list of a node instance.";\r
268 \r
269             key "property-name";\r
270             uses property-instance;\r
271         }\r
272     }\r
273 \r
274     grouping connection-instance {\r
275         description\r
276             "It represents the connection instance and its metadata.\r
277              The Connection describes the resource between node entities.\r
278              This connection is not limited to any physical link, but just\r
279              expresses the communication capacity between nodes.";\r
280 \r
281         leaf connection-id {\r
282             description\r
283                 "A unique ID for a connection instance.";\r
284             type nemo-common:connection-id;\r
285             mandatory true;\r
286         }\r
287 \r
288         leaf connection-name {\r
289             description\r
290                 "A user-visible and unique name for a connection instance.";\r
291             type nemo-common:connection-name;\r
292             mandatory true;\r
293         }\r
294 \r
295         leaf connection-type {\r
296             description\r
297                 "A user-visible and unique type identifier for a connection instance.";\r
298             type nemo-common:connection-type;\r
299             mandatory true;\r
300         }\r
301 \r
302         list end-node {\r
303             description\r
304                 "Represents the nodes which will be connected by connection.\r
305                  At least two nodes in the list.";\r
306 \r
307             key "node-id";\r
308             leaf node-id {\r
309                 description\r
310                     "A unique ID for a node instance.";\r
311                 type nemo-common:node-id;\r
312             }\r
313 \r
314             leaf order {\r
315                 description\r
316                     "Specify the order of the node in a sequence node list";\r
317                 type uint32;\r
318             }\r
319 \r
320             min-elements 2;\r
321         }\r
322 \r
323         list property {\r
324             description\r
325                 "The property list of a connection instance.";\r
326 \r
327             key "property-name";\r
328             uses property-instance;\r
329         }\r
330     }\r
331 \r
332     grouping match-item-instance {\r
333         description\r
334             "Represents the match item and its metadata.";\r
335 \r
336         leaf match-item-name {\r
337             description\r
338                 "A name for a match item.";\r
339             type nemo-common:match-item-name;\r
340             mandatory true;\r
341         }\r
342 \r
343         container match-item-value {\r
344             description\r
345                 "The value of a match item.";\r
346 \r
347             leaf string-value {\r
348                 type string;\r
349             }\r
350 \r
351             leaf int-value {\r
352                 type int64;\r
353             }\r
354 \r
355             container range-value {\r
356                 leaf min {\r
357                     type int64;\r
358                     mandatory true;\r
359                 }\r
360 \r
361                 leaf max {\r
362                     type int64;\r
363                     mandatory true;\r
364                 }\r
365             }\r
366         }\r
367     }\r
368 \r
369     grouping flow-instance {\r
370         description\r
371             "Represents the flow instance and its metadata.\r
372              The flow refers to the traffic in network which describes\r
373              data packets have some certain characters.";\r
374 \r
375         leaf flow-id {\r
376             description\r
377                 "A unique ID for a flow instance.";\r
378             type nemo-common:flow-id;\r
379             mandatory true;\r
380         }\r
381 \r
382         leaf flow-name {\r
383             description\r
384                 "A user-visible and unique name for a flow instance.";\r
385             type nemo-common:flow-name;\r
386             mandatory true;\r
387         }\r
388 \r
389         list match-item {\r
390             description\r
391                 "The match item list of a flow instance.";\r
392 \r
393             key "match-item-name";\r
394             uses match-item-instance;\r
395         }\r
396 \r
397         list property {\r
398             description\r
399                 "The property list of a flow instance.";\r
400 \r
401             key "property-name";\r
402             uses property-instance;\r
403         }\r
404     }\r
405 }\r