cbccc32a9d3a5dd444206673c481277ae7c2aff6
[nemo.git] / nemo-api / src / main / yang / nemo-common.yang
1 /*\r
2  * Copyright (c) 2015  Huawei Technologies Co., Ltd. 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-common{\r
10         yang-version 1; \r
11         namespace "urn:opendaylight:params:xml:ns:yang:nemo:common";    \r
12         prefix "nemo-common";\r
13         \r
14         revision "2015-06-29" {\r
15         description\r
16             "Initial revision.";\r
17     }\r
18         \r
19         /**********************\r
20      * Base types\r
21     **********************/\r
22         typedef description {\r
23         description "A human-readable description for a object.";\r
24         type string {\r
25             length "1..4096";\r
26         }\r
27     }\r
28         \r
29         typedef name {\r
30         description\r
31             "A generic string name type. Must start with a letter";\r
32         type string {\r
33             pattern '[a-zA-Z]([a-zA-Z0-9\-_.])*';\r
34             length "1..256";\r
35         }\r
36     }\r
37         \r
38         // UUID type from ietf-yang-types@2013-07-15\r
39     typedef uuid {\r
40         type string {\r
41             pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'\r
42                 + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';\r
43         }\r
44         description\r
45             "A Universally Unique IDentifier in the string representation\r
46              defined in RFC 4122.  The canonical representation uses\r
47              lowercase characters.\r
48 \r
49              The following is an example of a UUID in string\r
50              representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6";\r
51         reference\r
52             "RFC 4122: A Universally Unique IDentifier (UUID) URN\r
53              Namespace";\r
54     }\r
55 \r
56     typedef unique-id {\r
57         type uuid;\r
58         description "A globally unique identifier";\r
59     }\r
60         \r
61         /*********************\r
62      * Unique IDs\r
63      *********************/     \r
64         typedef object-id {\r
65         type unique-id;\r
66         description "A unique ID for a parameterized object";\r
67     }\r
68         \r
69         typedef node-definition-id {\r
70         type object-id;\r
71         description "A unique ID for a node definition.";\r
72     }\r
73         typedef node-instance-id {\r
74         type object-id;\r
75         description "A unique ID for a node instance.";\r
76     }           \r
77         \r
78         typedef connection-definition-id {\r
79         type object-id;\r
80         description "A unique ID for a connection definition.";\r
81     }\r
82         typedef connection-instance-id {\r
83         type object-id;\r
84         description "A unique ID for a connection instance.";\r
85     }           \r
86         \r
87         typedef flow-definition-id {\r
88         type object-id;\r
89         description "A unique ID for a flow definition.";\r
90     }\r
91         typedef flow-instance-id {\r
92         type object-id;\r
93         description "A unique ID for a flow instance.";\r
94     }\r
95         \r
96         typedef expected-definition-id {\r
97         type unique-id;\r
98         description "A unique ID for an expected definition.";\r
99     }\r
100         typedef expected-instance-id {\r
101         type unique-id;\r
102         description "A unique ID for an expected instance.";\r
103     }\r
104         \r
105         typedef avoid-definition-id {\r
106         type unique-id;\r
107         description "A unique ID for an avoid definition.";\r
108     }\r
109         typedef avoid-instance-id {\r
110         type unique-id;\r
111         description "A unique ID for an avoid instance.";\r
112     }\r
113         \r
114         typedef context-id {\r
115                 type unique-id;\r
116         description "A unique ID for a context.";\r
117         }\r
118         \r
119         typedef intent-id {\r
120         type unique-id;\r
121         description "A unique ID for an intent.";\r
122     }\r
123         \r
124         typedef user-id {\r
125         type unique-id;\r
126         description "A unique ID for a user.";\r
127     }\r
128         \r
129         \r
130         \r
131         /*********************\r
132      * names\r
133      *********************/     \r
134         typedef object-name {\r
135         type name;\r
136         description "A name for a parameterized object";\r
137     }\r
138         \r
139         typedef node-instance-name {\r
140         type object-name;\r
141         description "A name for a node instance.";\r
142     } \r
143         \r
144         typedef connection-instance-name {\r
145         type object-name;\r
146         description "A name for a connection instance.";\r
147     }   \r
148                  \r
149         typedef flow-instance-name {\r
150         type object-name;\r
151         description "A name for a flow instance.";\r
152     } \r
153         \r
154         typedef node-property-name {\r
155         type name;\r
156         description "A name for a node property.";\r
157     } \r
158         \r
159         typedef connection-property-name {\r
160         type name;\r
161         description "A name for a connection property.";\r
162     } \r
163 \r
164         typedef  match-item-name {\r
165         type name;\r
166         description "A name for a flow match item.";\r
167     }\r
168         \r
169         typedef property-name {\r
170         type name;\r
171         description "A name for a property.";\r
172     }\r
173         \r
174         typedef parameter-name {\r
175         type name;\r
176         description "A name for a parameter.";\r
177     }\r
178         \r
179         typedef action-definition-name {\r
180         type name;\r
181         description "A name for an action definition.";\r
182     }   \r
183         typedef action-instance-name {\r
184         type name;\r
185         description "A name for an action instance.";\r
186     }   \r
187         typedef condition-definition-name {\r
188         type name;\r
189         description "A name for a condition definition.";\r
190     }\r
191         typedef condition-instance-name {\r
192                 type name;\r
193         description "A name for a condition instance.";\r
194         }\r
195         typedef condition-parameter-name {\r
196                 type name;\r
197         description "A name for a condition parameter.";\r
198         }\r
199         typedef constraint-definition-name {\r
200         type name;\r
201         description "A name for a constraint definition.";\r
202     }\r
203         typedef constraint-instance-name {\r
204                 type name;\r
205         description "A name for a constraint instance.";\r
206         }\r
207         typedef constraint-parameter-name {\r
208                 type name;\r
209         description "A name for a constraint parameter.";\r
210         }\r
211         \r
212 \r
213     typedef data-name {\r
214                 type name;\r
215                 description "A name for an action data.";\r
216         }\r
217         \r
218         typedef context-name {\r
219                 type name;\r
220                 description "A name for an context";\r
221         }\r
222         \r
223         typedef intent-name {\r
224         type name;\r
225         description "A name for an intent.";\r
226     }\r
227         typedef user-name {\r
228         type name;\r
229         description "A name for a user.";\r
230     }\r
231         typedef expected-instance-name {\r
232         type name;\r
233         description "A name for an expected instance.";\r
234     }\r
235         typedef avoid-instance-name {\r
236         type name;\r
237         description "A name for an avoid instance.";\r
238     }\r
239         \r
240         \r
241         \r
242         /*********************\r
243      * types\r
244      *********************/     \r
245         typedef node-definition-type {\r
246                 type name;\r
247             description "A type for a node."; \r
248         }\r
249         typedef connection-definition-type {\r
250                 type name;\r
251             description "A type for a connection."; \r
252         }\r
253         typedef flow-definition-type {\r
254                 type name;\r
255             description "A type for a flow."; \r
256         }       \r
257         typedef node-instance-type  {\r
258                 type name;\r
259             description "A type for a node instance."; \r
260         }       \r
261         typedef connection-instance-type  {\r
262                 type name;\r
263             description "A type for a connection instance."; \r
264         }\r
265         typedef flow-instance-type {\r
266                 type name;\r
267                 description "A type for a flow instance."; \r
268         }\r
269 \r
270 }\r
271  \r
272  \r
273  \r
274  \r
275  \r
276  \r
277  \r
278  \r
279  \r
280  \r
281  \r
282  \r
283  \r
284  \r
285  \r
286  \r
287  \r
288  \r
289  \r
290  \r
291  \r
292  \r
293  \r
294  \r
295  \r
296  \r
297  \r
298  \r
299  \r
300  \r
301  \r
302  \r
303  \r
304  \r
305  \r
306  \r
307  \r
308  \r
309  \r
310  \r
311  \r
312  \r
313  \r
314  \r
315  \r
316  \r
317  \r
318