Fixup checkstyle
[controller.git] / benchmark / api / src / main / yang / dsbenchmark.yang
1 module dsbenchmark {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:dsbenchmark";
4     prefix "dsbenchmark";
5
6     description
7         "Copyright © 2015, 2018 Cisco Systems, Inc. and others.
8
9         This program and the accompanying materials are made available under the
10         terms of the Eclipse Public License v1.0 which accompanies this distribution,
11         and is available at http://www.eclipse.org/legal/epl-v10.html";
12
13     revision "2015-01-05" {
14         description "Initial revision of dsbenchmark model";
15     }
16     container test-exec {
17         config true;
18
19         list outer-list {
20             key id;
21             leaf id {
22                 type int32;
23             }
24             choice outer-choice {
25                 case one {
26                     leaf one {
27                         type string;
28                     }
29                 }
30                 case two-three {
31                     leaf two {
32                         type string;
33                     }
34                     leaf three {
35                         type string;
36                     }
37                }
38            }
39            list inner-list {
40                 key name;
41                 leaf name {
42                     type int32;
43                 }
44                 leaf value {
45                     type string;
46                 }
47             }
48         }
49     }
50
51     container test-status {
52         leaf execStatus {
53             type enumeration {
54                 enum "idle" {
55                     value 1;
56                 }
57                 enum "executing" {
58                     value 2;
59                 }
60             }
61             config false;
62             mandatory true;
63             description
64                 "Indicates whether a test run is in progress; only one test can run at a time";
65         }
66         leaf testsCompleted {
67             type uint32;
68             default 1;
69             description
70                 "Number of completed test runs";
71           }
72     }
73
74     rpc start-test {
75         description
76           "Start a new data store write test run";
77
78         input {
79             leaf operation {
80                 mandatory true;
81                 type enumeration {
82                     enum "PUT" {
83                         value 1;
84                         description
85                           "The put operation";
86                     }
87                     enum "MERGE" {
88                         value 2;
89                         description
90                           "The merge operation";
91                     }
92                     enum "DELETE" {
93                         value 3;
94                         description
95                             "Delete items from a list sorted in the data store";
96                     }
97                     enum "READ" {
98                         value 4;
99                         description
100                         "The read operation";
101                     }
102                 }
103                 description
104                     "Type of the transaction operation to benchmark";
105             }
106
107             leaf data-format {
108                 mandatory true;
109                 type enumeration {
110                     enum "BINDING-AWARE" {
111                         value 1;
112                     }
113                     enum "BINDING-INDEPENDENT" {
114                         value 2;
115                     }
116                 }
117                 description
118                     "Data format:-binding-aware or binding-independent";
119             }
120
121             leaf transaction-type {
122                 mandatory true;
123                 type enumeration {
124                     enum "SIMPLE-TX" {
125                         value 1;
126                     }
127                     enum "TX-CHAINING" {
128                         value 2;
129                     }
130                 }
131                 description
132                     "Data format:-binding-aware or binding-independent";
133             }
134
135             leaf data-store {
136                 mandatory true;
137                 type enumeration {
138                     enum "CONFIG" {
139                         value 1;
140                     }
141                     enum "OPERATIONAL" {
142                         value 2;
143                     }
144                     enum "BOTH" {
145                         value 3;
146                     }
147                 }
148             }
149             leaf outerElements {
150                 type uint32;
151                 default 100000;
152                 description
153                   "Number of elements in the OuterList";
154             }
155             leaf innerElements {
156                 type uint32;
157                 default 1;
158                 description
159                   "Number of elements in the InnerList";
160             }
161             leaf putsPerTx {
162                 type uint32;
163                 default 1;
164                 description
165                   "Number of write operations (PUT, MERGE, or DELETE)
166                    per transaction submit";
167             }
168             leaf listeners {
169                 type uint32;
170                 default 0;
171                 description
172                     "Number of data tree change listeners listening for
173                     changes on the test exec tree.";
174             }
175         }
176         output {
177             leaf status {
178                 mandatory true;
179                 type enumeration {
180                     enum "OK" {
181                         value 1;
182                     }
183                     enum "FAILED" {
184                         value 2;
185                     }
186                     enum "TEST-IN-PROGRESS" {
187                         value 3;
188                     }
189                 }
190                 description
191                     "Indicates whether the test finished successfuly";
192             }
193             leaf listBuildTime {
194                 type int64;
195                 units microseconds;
196                 description
197                   "The time it took to build the list of lists";
198             }
199             leaf execTime {
200                 type int64;
201                 units microseconds;
202                 description
203                   "The time it took to execute all transactions";
204             }
205             leaf txOk {
206                 type uint32;
207                 description
208                   "The number of successful transactions";
209             }
210             leaf txError {
211                 type uint32;
212                 description
213                   "The number of failed transactions";
214             }
215             leaf ntfOk {
216                 type uint32;
217                 description
218                   "The number of successfully received data tree change
219                    notifications";
220             }
221             leaf dataChangeEventsOk {
222                 type uint32;
223                 description
224                   "The number of data change events received in data tree
225                    change notifications";
226             }
227         }
228     }
229
230     rpc cleanup-store {
231         description
232           "Delete data in the test-exec container that may have been left behind from a previous test run";
233     }
234 }