Adding nemo engine.
[nemo.git] / nemo-api / src / main / yang / nemo-common.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-common {\r
10     yang-version 1;\r
11 \r
12     namespace "urn:opendaylight:params:xml:ns:yang:nemo:common";\r
13     prefix "nemo-common";\r
14 \r
15     description\r
16         "Common types and definitions for NEMO models";\r
17 \r
18     revision "2015-10-10" {\r
19         description\r
20             "Initial revision.";\r
21     }\r
22 \r
23     // *********************\r
24     // * Base Types\r
25     // *********************\r
26     typedef description {\r
27         description\r
28             "A human-readable description for a object.";\r
29         type string {\r
30             length "1..4096";\r
31         }\r
32     }\r
33 \r
34     typedef name {\r
35         description\r
36             "A generic string name type. Must start with a letter";\r
37         type string {\r
38             pattern '[a-zA-Z]([a-zA-Z0-9\-_.])*';\r
39             length "1..256";\r
40         }\r
41     }\r
42 \r
43     // UUID type from ietf-yang-types@2013-07-15\r
44     typedef uuid {\r
45         type string {\r
46             pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'\r
47                 + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';\r
48         }\r
49         description\r
50             "A Universally Unique IDentifier in the string representation\r
51              defined in RFC 4122. The canonical representation uses\r
52              lower case characters.\r
53 \r
54              The following is an example of a UUID in string\r
55              representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6";\r
56         reference\r
57             "RFC 4122: A Universally Unique IDentifier (UUID) URN\r
58              Namespace";\r
59     }\r
60 \r
61     typedef unique-id {\r
62         description\r
63             "A globally unique identifier.";\r
64         type uuid;\r
65     }\r
66 \r
67     // *********************\r
68     // * Unique IDs\r
69     // *********************\r
70     typedef object-id {\r
71         description\r
72             "A unique ID for a parameterized object.";\r
73         type unique-id;\r
74     }\r
75 \r
76     typedef node-id {\r
77         description\r
78             "A unique ID for a node.";\r
79         type object-id;\r
80     }\r
81 \r
82     typedef connection-id {\r
83         description\r
84             "A unique ID for a connection.";\r
85         type object-id;\r
86     }\r
87 \r
88     typedef flow-id {\r
89         description\r
90             "A unique ID for a flow.";\r
91         type object-id;\r
92     }\r
93 \r
94     typedef intent-id {\r
95         description\r
96             "A unique ID for an intent.";\r
97         type unique-id;\r
98     }\r
99 \r
100     typedef user-id {\r
101         description\r
102             "A unique ID for a user.";\r
103         type unique-id;\r
104     }\r
105 \r
106     typedef operation-id {\r
107         description\r
108             "A unique ID for an operation.";\r
109         type unique-id;\r
110     }\r
111 \r
112     typedef condition-segment-id {\r
113         description\r
114             "A unique ID for a segment of the condition in an operation.";\r
115         type unique-id;\r
116     }\r
117 \r
118     typedef query-condition-id {\r
119         description\r
120             "A unique ID for a condition of the advanced query.";\r
121         type unique-id;\r
122     }\r
123 \r
124     // *********************\r
125     // * Names\r
126     // *********************\r
127     typedef object-name {\r
128         description\r
129             "A name for a parameterized object";\r
130         type name;\r
131     }\r
132 \r
133     typedef node-name {\r
134         description\r
135             "A name for a node instance.";\r
136         type object-name;\r
137     }\r
138 \r
139     typedef connection-name {\r
140         description\r
141             "A name for a connection instance.";\r
142         type object-name;\r
143     }\r
144 \r
145     typedef flow-name {\r
146         description\r
147             "A name for a flow instance.";\r
148         type object-name;\r
149     }\r
150 \r
151     typedef  match-item-name {\r
152         description\r
153             "A name for a match item.";\r
154         type name;\r
155     }\r
156 \r
157     typedef property-name {\r
158         description\r
159             "A name for a property.";\r
160         type name;\r
161     }\r
162 \r
163     typedef parameter-name {\r
164         description\r
165             "A name for a parameter.";\r
166         type name;\r
167     }\r
168 \r
169     typedef action-name {\r
170         description\r
171             "A name for an action.";\r
172         type name;\r
173     }\r
174 \r
175     typedef condition-parameter-name {\r
176         description\r
177             "A name for a parameter of condition.";\r
178         type name;\r
179     }\r
180 \r
181     typedef user-name {\r
182         description\r
183             "A name for a user.";\r
184         type name;\r
185     }\r
186 \r
187     typedef user-password {\r
188         description\r
189             "A password for a user.";\r
190         type name;\r
191     }\r
192 \r
193     typedef operation-name {\r
194         description\r
195             "A name for an operation.";\r
196         type name;\r
197     }\r
198 \r
199     typedef query-condition-name {\r
200         description\r
201             "A name for a query with condition.";\r
202         type name;\r
203     }\r
204 \r
205     typedef user-role-name {\r
206         description\r
207             "A role name for a user.";\r
208         type name;\r
209     }\r
210 \r
211     typedef user-role-description {\r
212         description\r
213             "It describes the role characteristic and responsibility range.";\r
214         type string;\r
215     }\r
216 \r
217     // *********************\r
218     // * Types\r
219     // *********************\r
220     typedef node-type {\r
221         description\r
222             "The type for a node.";\r
223         type name;\r
224     }\r
225 \r
226     typedef connection-type {\r
227         description\r
228             "The type for a connection.";\r
229         type name;\r
230     }\r
231 \r
232     typedef flow-type {\r
233         description\r
234             "The type for a flow.";\r
235         type name;\r
236     }\r
237 }\r