Modify nemo template model.
[nemo.git] / nemo-api / src / main / yang / nemo-template.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-template {\r
10     yang-version 1;\r
11 \r
12     namespace "urn:opendaylight:params:xml:ns:yang:nemo:template";\r
13     prefix "nemo-template";\r
14 \r
15     import nemo-common {prefix nemo-common;}\r
16     import nemo-object {prefix nemo-object;}\r
17     import nemo-operation {prefix nemo-operation;}\r
18 \r
19     revision "2015-12-01" {\r
20         description\r
21             "Initial revision.";\r
22     }\r
23 \r
24     grouping template-definition-grouping {\r
25         description\r
26             "It represents a template definition and its metadata.\r
27              A template defines a reusable function which could\r
28              be used many times.";\r
29 \r
30         leaf template-name {\r
31             description\r
32                 "A unique name for a template.";\r
33             type nemo-common:template-name;\r
34             mandatory true;\r
35         }\r
36 \r
37         container abstract-intents {\r
38             description\r
39                 "All abstract intents included in this template.";\r
40 \r
41             container abstract-objects {\r
42                 description\r
43                     "The element could be operated and managed by users.\r
44                      It includes resources to construct users' virtual networks,\r
45                      and the services in this network. In NEMO project, it is\r
46                      abstracted into node, connection and flow.";\r
47 \r
48                 list abstract-node {\r
49                     key "node-id";\r
50                     uses nemo-object:node-instance;\r
51                 }\r
52 \r
53                 list abstract-connection {\r
54                     key "connection-id";\r
55                     uses nemo-object:connection-instance;\r
56                 }\r
57 \r
58                 list abstract-flow {\r
59                     key "flow-id";\r
60                     uses nemo-object:flow-instance;\r
61                 }\r
62             }\r
63 \r
64             container abstract-operations {\r
65                 description\r
66                     "The operation is to dynamically adjust the behavior of network,\r
67                      and it is applied on objects, that is, node, connection and flow.";\r
68 \r
69                 list abstract-operation {\r
70                     key "operation-id";\r
71                     uses nemo-operation:operation-instance;\r
72                 }\r
73             }\r
74 \r
75             container abstract-results {\r
76                 // TBD\r
77             }\r
78         }\r
79 \r
80         list template-parameter {\r
81             description\r
82                 "List all the parameters included in the template. That is,\r
83                  other instance could have different values when instancing the\r
84                  template.";\r
85 \r
86             key "parameter-name";\r
87             leaf parameter-name {\r
88                 description\r
89                     "The name of the parameter.";\r
90                 type nemo-common:parameter-name;\r
91                 mandatory true;\r
92             }\r
93 \r
94             leaf parameter-value-type {\r
95                 description\r
96                     "List all value types could exist in the parameters.";\r
97                 default string;\r
98                 type enumeration {\r
99                     enum string {\r
100                         description\r
101                             "An string-valued property.";\r
102                     }\r
103                     enum int {\r
104                         description\r
105                             "An integer-valued property.";\r
106                     }\r
107                     enum range {\r
108                         description\r
109                             "An integer-range property.";\r
110                     }\r
111                 }\r
112             }\r
113         }\r
114     }\r
115 \r
116     grouping template-instance-grouping {\r
117         description\r
118             "A template instance which put specific values in the parameter list.";\r
119 \r
120         leaf template-instance-id {\r
121             description\r
122                 "A unique identifier for the template instance.";\r
123             type nemo-common:template-instance-id;\r
124             mandatory true;\r
125         }\r
126 \r
127         leaf template-instance-name {\r
128             description\r
129                 "A unique name for the template instance.";\r
130             type nemo-common:template-instance-name;\r
131             mandatory true;\r
132         }\r
133 \r
134         leaf template-name {\r
135             description\r
136                 "The template name instanced by this template instance.";\r
137             type nemo-common:template-name;\r
138             mandatory true;\r
139         }\r
140 \r
141         list template-parameter {\r
142             description\r
143                 "All specific parameters putted by this instance.";\r
144 \r
145             key "parameter-name";\r
146             leaf parameter-name {\r
147                 description\r
148                     "The name of the parameter.";\r
149                 type nemo-common:parameter-name;\r
150                 mandatory true;\r
151             }\r
152 \r
153             container parameter-values {\r
154                 description\r
155                     "The values for the parameter.";\r
156 \r
157                 list string-value {\r
158                     key "value order";\r
159                     leaf value {\r
160                         type string;\r
161                     }\r
162 \r
163                     leaf order {\r
164                         type uint32;\r
165                     }\r
166                 }\r
167 \r
168                 list int-value {\r
169                     key "value order";\r
170                     leaf value {\r
171                         type int64;\r
172                     }\r
173 \r
174                     leaf order {\r
175                         type uint32;\r
176                     }\r
177                 }\r
178 \r
179                 container range-value {\r
180                     leaf min {\r
181                         type int64;\r
182                         mandatory true;\r
183                     }\r
184 \r
185                     leaf max {\r
186                         type int64;\r
187                         mandatory true;\r
188                     }\r
189                 }\r
190             }\r
191         }\r
192     }\r
193 }\r