219b19203fccd9e0f37da21d115d338ac4128987
[nemo.git] / nemo-api / src / main / yang / nemo-operation.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-operation {\r
10 \r
11         yang-version 1; \r
12         namespace "urn:opendaylight:params:xml:ns:yang:nemo:operation"; \r
13         prefix "nemo-operation";\r
14         \r
15         import nemo-common {prefix nemo-common;}\r
16         \r
17         revision "2015-06-29" {\r
18         description\r
19             "Initial revision.";\r
20     }\r
21         \r
22         grouping parameter-definition {\r
23                 leaf name {\r
24                         description "A user-visible name for parameter";\r
25                         type nemo-common:parameter-name;\r
26                         mandatory true;\r
27                 }       \r
28                 leaf type {\r
29                         description "The type of the parameter";\r
30                         default string;\r
31                         type enumeration {\r
32                                 enum string {\r
33                                         description "A string-valued parameter";\r
34                                 }\r
35                                 enum int {\r
36                                         description "An integer-valued parameter";\r
37                                 }\r
38                                 enum range {\r
39                                         description "An integer-range parameter";\r
40                                 }\r
41                         }\r
42                 }       \r
43                 leaf is-required {\r
44                         description "Specify whether the parameter is required ";\r
45                         default optional;\r
46                         type enumeration {\r
47                                 enum required {\r
48                                         description "The parameter is required";\r
49                                 }\r
50                                 enum optional {\r
51                                         description "The parameter is optional";\r
52                                 }\r
53                         }\r
54                 }       \r
55         }\r
56         \r
57         \r
58         container action-definitions {\r
59             list action-definition {            \r
60                         key "action-name";\r
61                         leaf action-name {\r
62                                 description "A name for the action definition";\r
63                                 type nemo-common:action-definition-name;\r
64                             mandatory true;                     \r
65                     }                   \r
66                 list data {\r
67                                 description\r
68                                         "data for the action that can be passed in.";\r
69                                 key "name";                     \r
70                                 uses parameter-definition;              \r
71                     }           \r
72             }\r
73         }       \r
74         grouping action-parameter-instance{\r
75                 leaf data-name {\r
76                         type nemo-common:data-name;\r
77                         mandatory true;\r
78                 }\r
79                 leaf string-value {\r
80                         type string;\r
81                 }\r
82                 leaf int-value {\r
83                         type int64;\r
84                 }\r
85                 container range-value {\r
86                         leaf min {\r
87                                 type int64;\r
88                                 mandatory true;\r
89                         }\r
90                         leaf max {\r
91                                 type int64;\r
92                                 mandatory true;\r
93                         }\r
94                 }       \r
95         }       \r
96         grouping action-instance{\r
97                 description " ";\r
98                 leaf action-name{\r
99                         type nemo-common:action-instance-name;\r
100                         mandatory true;\r
101                 }\r
102                 list data {\r
103                         key "data-name";\r
104                         uses action-parameter-instance;                 \r
105                 }               \r
106         }\r
107                 \r
108         container condition-definitions {\r
109                 list condition-definition{\r
110                         key "condition-name";\r
111                         leaf condition-name{\r
112                                 type nemo-common:condition-definition-name;\r
113                                 mandatory true;         \r
114                         }\r
115                         list condition-parameter{\r
116                                 key "name";\r
117                                 uses parameter-definition;\r
118                                 min-elements 1;\r
119                         }       \r
120                 }\r
121         }\r
122         grouping conditon-parameter-instance{\r
123                 leaf parameter-name {\r
124                     type nemo-common:condition-parameter-name;\r
125                         mandatory true;\r
126                 }\r
127                 leaf string-value {\r
128                         type string;\r
129                 }\r
130                 leaf int-value {\r
131                         type int64;\r
132                 }\r
133                 container range-value {\r
134                         leaf min {\r
135                                 type int64;\r
136                                 mandatory true;\r
137                         }\r
138                         leaf max {\r
139                                 type int64;\r
140                                 mandatory true;\r
141                         }\r
142                 }       \r
143         }       \r
144         grouping condition-instance {\r
145                 description " ";\r
146                 leaf condition-name{\r
147                         type nemo-common:condition-instance-name;\r
148                         mandatory true;                         \r
149                 }       \r
150                 list condition-parameter{\r
151                         key "parameter-name";\r
152                         uses conditon-parameter-instance;\r
153                         min-elements 1;\r
154                 }\r
155         }\r
156         \r
157         \r
158         container constraint-definitions {\r
159                 list constraint-definition{\r
160                         key "constraint-name";\r
161                         leaf constraint-name{\r
162                                 type nemo-common:constraint-definition-name;\r
163                                 mandatory true;         \r
164                         }\r
165                         list constraint-parameter{\r
166                                 key "name";\r
167                                 uses parameter-definition;\r
168                                 min-elements 1;\r
169                         }       \r
170                 }\r
171         }\r
172         grouping constraint-parameter-instance{\r
173                 leaf parameter-name {\r
174                         type nemo-common:constraint-parameter-name;\r
175                         mandatory true;\r
176                 }\r
177                 leaf string-value {\r
178                         type string;\r
179                 }\r
180                 leaf int-value {\r
181                         type int64;\r
182                 }\r
183                 container range-value {\r
184                         leaf min {\r
185                                 type int64;\r
186                                 mandatory true;\r
187                         }\r
188                         leaf max {\r
189                                 type int64;\r
190                                 mandatory true;\r
191                         }\r
192                 }       \r
193         }       \r
194         grouping constraint-instance {\r
195                 description " ";\r
196                 leaf constraint-name{\r
197                         type nemo-common:constraint-instance-name;\r
198                         mandatory true;                         \r
199                 }       \r
200                 list constraint-parameter{\r
201                         key "parameter-name";\r
202                         uses constraint-parameter-instance;\r
203                         min-elements 1;\r
204                 }\r
205         }\r
206         \r
207 }