Adding nemo engine.
[nemo.git] / nemo-impl / src / main / yang / nemo-engine-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-engine-common {\r
10     yang-version 1;\r
11 \r
12     namespace "urn:opendaylight:params:xml:ns:yang:nemo:engine:common";\r
13     prefix "nemo-engine-common";\r
14 \r
15     revision "2015-10-10" {\r
16         description\r
17             "Initial revision.";\r
18     }\r
19 \r
20     // *********************\r
21     // * Base Types\r
22     // *********************\r
23     typedef name {\r
24         description\r
25             "A generic string name type. Must start with a letter";\r
26         type string {\r
27             pattern '[a-zA-Z]([a-zA-Z0-9\-_.])*';\r
28             length "1..256";\r
29         }\r
30     }\r
31 \r
32     // UUID type from ietf-yang-types@2013-07-15\r
33     typedef uuid {\r
34         type string {\r
35             pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'\r
36                 + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';\r
37         }\r
38         description\r
39             "A Universally Unique IDentifier in the string representation\r
40              defined in RFC 4122.  The canonical representation uses\r
41              lower case characters.\r
42 \r
43              The following is an example of a UUID in string\r
44              representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6";\r
45         reference\r
46             "RFC 4122: A Universally Unique IDentifier (UUID) URN\r
47              Namespace";\r
48     }\r
49 \r
50     typedef unique-id {\r
51         description\r
52             "A globally unique identifier.";\r
53         type uuid;\r
54     }\r
55 \r
56     // *********************\r
57     // * Unique IDs\r
58     // *********************\r
59     typedef physical-port-id {\r
60         description\r
61             "A unique ID for a physical port.";\r
62         type string;\r
63     }\r
64 \r
65     typedef physical-node-id {\r
66         description\r
67             "A unique ID for a physical node.";\r
68         type string;\r
69     }\r
70 \r
71     typedef physical-link-id {\r
72         description\r
73             "A unique ID for a physical link.";\r
74         type string;\r
75     }\r
76 \r
77     typedef physical-host-id {\r
78         description\r
79             "A unique ID for a physical host.";\r
80         type unique-id;\r
81     }\r
82 \r
83     typedef physical-path-id {\r
84         description\r
85             "A unique ID for a physical path.";\r
86         type unique-id;\r
87     }\r
88 \r
89     typedef virtual-port-id {\r
90         description\r
91             "A unique ID for a virtual port.";\r
92         type unique-id;\r
93     }\r
94 \r
95     typedef virtual-node-id {\r
96         description\r
97             "A unique ID for a virtual node.";\r
98         type unique-id;\r
99     }\r
100 \r
101     typedef virtual-link-id {\r
102         description\r
103             "A unique ID for a virtual link.";\r
104         type unique-id;\r
105     }\r
106 \r
107     typedef virtual-path-id {\r
108         description\r
109             "A unique ID for a virtual path.";\r
110         type unique-id;\r
111     }\r
112 \r
113     typedef virtual-network-id {\r
114         description\r
115             "A unique ID for a virtual network.";\r
116         type unique-id;\r
117     }\r
118 \r
119     typedef virtual-resource-id {\r
120         description\r
121             "A unique ID for the virtual resource.";\r
122         type unique-id;\r
123     }\r
124 \r
125     typedef virtual-resource-entity-id {\r
126         description\r
127             "A unique ID for a virtual resource entity.";\r
128         type unique-id;\r
129     }\r
130 \r
131     typedef physical-resource-id {\r
132         description\r
133             "A unique ID for the physical resource.";\r
134         type unique-id;\r
135     }\r
136 \r
137     typedef physical-resource-entity-id {\r
138         description\r
139             "A unique ID for a physical resource entity.";\r
140         type string;\r
141     }\r
142 \r
143     // *********************\r
144     // * Names\r
145     // *********************\r
146     typedef attribute-name {\r
147         description\r
148             "A name for a physical port or node attribute.";\r
149         type name;\r
150     }\r
151 \r
152     typedef physical-host-name {\r
153         description\r
154             "A name for a physical host.";\r
155         type name;\r
156     }\r
157 }\r