Adding TestVNF netconf server
[demo.git] / vnfs / TestVNF / netconftemplates / netconftemplates / schema-reply.xml
1 <rpc-reply message-id="m-1"
2   xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
3   <data
4   xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
5 module turing-machine {
6   namespace "http://example.net/turing-machine";
7   prefix tm;
8
9   description
10     "Data model for the Turing Machine.";
11
12   revision 2013-12-27 {
13     description
14       "Initial revision.";
15   }
16
17   typedef tape-symbol {
18     type string {
19       length "0..1";
20     }
21     description
22       "Type of symbols appearing in tape cells.
23
24        A blank is represented as an empty string where necessary.";
25   }
26
27   typedef cell-index {
28     type int64;
29     description
30       "Type for indexing tape cells.";
31   }
32
33   typedef state-index {
34     type uint16;
35     description
36       "Type for indexing states of the control unit.";
37   }
38
39   typedef head-dir {
40     type enumeration {
41       enum "left";
42       enum "right";
43     }
44     default "right";
45     description
46       "Possible directions for moving the read/write head, one cell
47        to the left or right (default).";
48   }
49
50   grouping tape-cells {
51     description
52       "The tape of the Turing Machine is represented as a sparse
53        array.";
54     list cell {
55       key "coord";
56       description
57         "List of non-blank cells.";
58       leaf coord {
59         type cell-index;
60         description
61           "Coordinate (index) of the tape cell.";
62       }
63
64       leaf symbol {
65         type tape-symbol {
66           length "1";
67         }
68         description
69           "Symbol appearing in the tape cell.
70
71            Blank (empty string) is not allowed here because the
72            'cell' list only contains non-blank cells.";
73       }
74     }
75   }
76
77   container turing-machine {
78     description
79       "State data and configuration of a Turing Machine.";
80     leaf state {
81       type state-index;
82       config false;
83       mandatory true;
84       description
85         "Current state of the control unit.
86
87          The initial state is 0.";
88     }
89
90     leaf head-position {
91       type cell-index;
92       config false;
93       mandatory true;
94       description
95         "Position of tape read/write head.";
96     }
97
98     container tape {
99       config false;
100       description
101         "The contents of the tape.";
102       uses tape-cells;
103     }
104
105     container transition-function {
106       description
107         "The Turing Machine is configured by specifying the
108          transition function.";
109       list delta {
110         key "label";
111         unique "input/state input/symbol";
112         description
113           "The list of transition rules.";
114         leaf label {
115           type string;
116           description
117             "An arbitrary label of the transition rule.";
118         }
119
120         container input {
121           description
122             "Input parameters (arguments) of the transition rule.";
123           leaf state {
124             type state-index;
125             mandatory true;
126             description
127               "Current state of the control unit.";
128           }
129
130           leaf symbol {
131             type tape-symbol;
132             mandatory true;
133             description
134               "Symbol read from the tape cell.";
135           }
136         }
137
138         container output {
139           description
140             "Output values of the transition rule.";
141           leaf state {
142             type state-index;
143             description
144               "New state of the control unit. If this leaf is not
145                present, the state doesn't change.";
146           }
147
148           leaf symbol {
149             type tape-symbol;
150             description
151               "Symbol to be written to the tape cell. If this leaf is
152                not present, the symbol doesn't change.";
153           }
154
155           leaf head-move {
156             type head-dir;
157             description
158               "Move the head one cell to the left or right";
159           }
160         }
161       }
162     }
163   }
164
165   rpc initialize {
166     description
167       "Initialize the Turing Machine as follows:
168
169        1. Put the control unit into the initial state (0).
170
171        2. Move the read/write head to the tape cell with coordinate
172           zero.
173
174        3. Write the string from the 'tape-content' input parameter to
175           the tape, character by character, starting at cell 0. The
176           tape is othewise empty.";
177     input {
178       leaf tape-content {
179         type string;
180         default "";
181         description
182           "The string with which the tape shall be initialized. The
183            leftmost symbol will be at tape coordinate 0.";
184       }
185     }
186   }
187
188   rpc run {
189     description
190       "Start the Turing Machine operation.";
191   }
192
193   rpc run-until {
194     description
195       "Start the Turing Machine operation and let it run until it is halted
196        or ALL the defined breakpoint conditions are satisfied.";
197     input {
198       leaf state {
199         type state-index;
200         description
201           "What state the control unit has to be at for the execution to be paused.";
202       }
203
204       leaf head-position {
205         type cell-index;
206         description
207           "Position of tape read/write head for which the breakpoint applies.";
208       }
209
210       container tape {
211         description
212           "What content the tape has to have for the breakpoint to apply.";
213         uses tape-cells;
214       }
215     }
216
217     output {
218       leaf step-count {
219         type uint64;
220         description
221           "The number of steps executed since the last 'run-until' call.";
222       }
223
224       leaf halted {
225         type boolean;
226         description
227           "'True' if the Turing machine is halted, 'false' if it is only paused.";
228       }
229     }
230   }
231
232   notification halted {
233     description
234       "The Turing Machine has halted. This means that there is no
235        transition rule for the current state and tape symbol.";
236     leaf state {
237       type state-index;
238       mandatory true;
239       description
240         "The state of the control unit in which the machine has
241          halted.";
242     }
243   }
244
245   notification paused {
246     description
247       "The Turing machine has reached a breakpoint and was paused.";
248     leaf state {
249       type state-index;
250       mandatory true;
251       description
252         "State of the control unit in which the machine was paused.";
253     }
254
255     leaf head-position {
256       type cell-index;
257       mandatory true;
258       description
259         "Position of tape read/write head when the machine was paused.";
260     }
261
262     container tape {
263       description
264         "Content of the tape when the machine was paused.";
265       uses tape-cells;
266     }
267   }
268 }
269   </data>
270 </rpc-reply>