Rename common.yang
[groupbasedpolicy.git] / groupbasedpolicy / src / main / yang / model / gbp-common.yang
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 module gbp-common {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:common";
13     prefix "gbp-common";
14
15     description
16         "Common types and definitions for group-based policy models";
17
18     revision "2014-04-21" {
19         description "Initial revision";
20     }
21
22     // **********
23     // Base types
24     // **********
25
26     typedef description {
27         description "A human-readable description for a object.";
28         type string {
29             length "1..4096";
30         }
31     }
32
33     typedef name {
34         description
35             "A generic string name type.
36              Must start with a letter";
37         type string {
38             pattern '[a-zA-Z]([a-zA-Z0-9\-_.])*';
39             length "1..256";
40         }
41     }
42
43     // UUID type from ietf-yang-types@2013-07-15
44     typedef uuid {
45
46         status deprecated;
47
48         type string {
49             pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'
50                 + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';
51         }
52         description
53             "A Universally Unique IDentifier in the string representation
54              defined in RFC 4122.  The canonical representation uses
55              lowercase characters.
56
57              The following is an example of a UUID in string
58              representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6";
59         reference
60             "RFC 4122: A Universally Unique IDentifier (UUID) URN
61              Namespace";
62     }
63
64     typedef unique-id {
65         type unique-id-string;
66         description "A globally unique identifier";
67     }
68
69     typedef unique-id-string {
70         type string {
71             length "1..256";
72         }
73         description "A globally unique identifier (based on String)";
74     }
75
76     // *************
77     // Relator names
78     // *************
79
80     typedef relator-name {
81         type name;
82         description "A name for a relator.";
83     }
84
85     typedef target-name {
86         type relator-name;
87         description "A name for a target.";
88     }
89
90     typedef selector-name {
91         type relator-name;
92         description "A name for a selector.";
93     }
94
95     // *****************
96     // Unique object IDs
97     // *****************
98
99     typedef network-domain-id {
100         type unique-id;
101         description "A unique ID for a network domain";
102     }
103
104     typedef subnet-id {
105
106         status deprecated;
107
108         type network-domain-id;
109         description "A unique ID for a subnet";
110     }
111
112     typedef context-id {
113         type network-domain-id;
114         description "A unique ID for a forwarding context";
115     }
116
117     typedef l2-context-id {
118
119         status deprecated;
120
121         type context-id;
122         description "A unique ID for a layer 2 context";
123     }
124
125     typedef l2-bridge-domain-id {
126
127         status deprecated;
128
129         type l2-context-id;
130         description "A unique ID for a bridge domain";
131     }
132
133     typedef l2-flood-domain-id {
134
135         status deprecated;
136
137         type l2-context-id;
138         description "A unique ID for a flood domain";
139     }
140
141     typedef l3-context-id {
142
143         status deprecated;
144
145         type context-id;
146         description "A unique ID for a layer 3 context";
147     }
148
149     typedef tenant-id {
150         type unique-id;
151         description "A unique ID for a tenant";
152     }
153
154     typedef endpoint-group-id {
155         type unique-id;
156         description "A unique ID for an endpoint group";
157     }
158
159     typedef contract-id {
160         type unique-id;
161         description "A unique ID for a contract";
162     }
163
164     // *************
165     // Matcher names
166     // *************
167
168     typedef matcher-name {
169         type name;
170         description "A name for a matcher";
171     }
172
173     typedef quality-matcher-name {
174         type matcher-name;
175         description "A name for a quality matcher";
176     }
177
178     typedef requirement-matcher-name {
179         type matcher-name;
180         description "A name for a requirement matcher";
181     }
182
183     typedef condition-matcher-name {
184         type matcher-name;
185         description "A name for a condition matcher";
186     }
187
188     typedef capability-matcher-name {
189         type matcher-name;
190         description "A name for a capability matcher";
191     }
192
193     // *************
194     // Label names
195     // *************
196
197     typedef label-name {
198         type name;
199         description "A name for a label";
200     }
201
202     typedef capability-name {
203         type label-name;
204         description "A name for a capability";
205     }
206
207     typedef requirement-name {
208         type label-name;
209         description "A name for a requirement";
210     }
211
212     typedef quality-name {
213         type label-name;
214         description "A name for a quality.";
215     }
216
217     typedef condition-name {
218         type label-name;
219         description "A name for a condition.";
220     }
221
222     // ****************************
223     // Subject/clause-related names
224     // ****************************
225
226     typedef clause-name {
227         type name;
228         description "A name for a clause.";
229     }
230
231     typedef subject-name {
232         type name;
233         description "A name for a subject.";
234     }
235
236     typedef rule-name {
237         type name;
238         description "A name for a rule.";
239     }
240
241     // ****************
242     // Subject features
243     // ****************
244
245     typedef subject-feature-id {
246         type unique-id-string;
247         description "A unique ID for a parameterized object";
248     }
249
250     typedef classifier-definition-id {
251         type subject-feature-id;
252         description "A unique ID for a classifier.";
253     }
254
255     typedef action-definition-id {
256         type subject-feature-id;
257         description "A unique ID for an action.";
258     }
259
260     typedef subject-feature-name {
261         type name;
262         description "A name for a parameterized object";
263     }
264
265     typedef classifier-name {
266         type subject-feature-name;
267         description "A name for a classifier.";
268     }
269
270     typedef action-name {
271         type subject-feature-name;
272         description "A name for an action.";
273     }
274
275     typedef parameter-name {
276         type name;
277         description "A name for a parameter.";
278     }
279 }