Merge "Fix for possible NPE if Bundle is stopped."
[controller.git] / opendaylight / md-sal / sal-rest-docgen / src / test / resources / yang / toaster_short.yang
1   module toaster2 {
2
3     yang-version 1;
4
5     namespace
6       "http://netconfcentral.org/ns/toaster2";
7
8     prefix toast;
9
10     organization "Netconf Central";
11
12     contact
13       "Andy Bierman <andy@netconfcentral.org>";
14
15     description
16       "YANG version of the TOASTER-MIB.";
17
18     revision "2009-11-20" {
19       description
20         "Toaster module in progress.";
21     }
22
23
24     identity toast-type {
25       description
26         "Base for all bread types supported by the toaster.
27            New bread types not listed here nay be added in the
28            future.";
29     }
30
31     identity white-bread {
32       base toast:toast-type;
33       description "White bread.";
34     }
35
36     identity wheat-bread {
37       base toast-type;
38       description "Wheat bread.";
39     }
40
41     identity wonder-bread {
42       base toast-type;
43       description "Wonder bread.";
44     }
45
46     identity frozen-waffle {
47       base toast-type;
48       description "Frozen waffle.";
49     }
50
51     identity frozen-bagel {
52       base toast-type;
53       description "Frozen bagel.";
54     }
55
56     identity hash-brown {
57       base toast-type;
58       description "Hash browned potatos.";
59     }
60
61     typedef DisplayString {
62       type string {
63         length "0 .. 255";
64       }
65       description
66         "YANG version of the SMIv2 DisplayString TEXTUAL-CONVENTION.";
67       reference
68         "RFC 2579, section 2.";
69
70     }
71
72     container toaster {
73       presence
74         "Indicates the toaster service is available";
75       description
76         "Top-level container for all toaster database objects.";
77       leaf toasterManufacturer {
78         type DisplayString;
79         config false;
80         mandatory true;
81         description
82           "The name of the toaster's manufacturer. For instance,
83                 Microsoft Toaster.";
84       }
85
86       list toasterSlot {
87         key "slotId";
88         leaf slotId {
89             type string;
90         }
91       }
92
93       leaf toasterModelNumber {
94         type DisplayString;
95         config false;
96         mandatory true;
97         description
98           "The name of the toaster's model. For instance,
99                Radiant Automatic.";
100       }
101
102       leaf toasterStatus {
103         type enumeration {
104           enum "up" {
105             value 1;
106             description
107               "The toaster knob position is up.
108                       No toast is being made now.";
109           }
110           enum "down" {
111             value 2;
112             description
113               "The toaster knob position is down.
114                       Toast is being made now.";
115           }
116         }
117         config false;
118         mandatory true;
119         description
120           "This variable indicates the current state of
121                the toaster.";
122       }
123
124       leaf darknessFactor {
125         type uint32;
126         config true;
127         default 1000;
128         description
129           "The darkness factor. Basically, the number of ms to multiple the doneness value by.";
130       }
131     }  // container toaster
132     
133     list lst {
134         container cont1 {
135             container cont11 {
136                 leaf lf111 {
137                     type uint32;
138                 }
139                 leaf lf112 {
140                     type string;
141                 }
142             }
143             list lst11 {
144                 leaf lf111 {
145                     type string;
146                 }
147             }
148         }
149         list lst1 {
150             key "key1 key2";
151             leaf key1 {
152                 type int32;
153             }
154             leaf key2 {
155                 type int8;
156             }
157             leaf lf11 {
158                 type int16;
159             }
160         }
161         leaf lf1 {
162             type string;
163         }
164     }    
165
166     rpc make-toast {
167       description
168         "Make some toast.
169            The toastDone notification will be sent when
170            the toast is finished.
171            An 'in-use' error will be returned if toast
172            is already being made.
173            A 'resource-denied' error will be returned
174            if the toaster service is disabled.";
175       input {
176         leaf toasterDoneness {
177           type uint32 {
178             range "1 .. 10";
179           }
180           default '5';
181           description
182             "This variable controls how well-done is the
183                    ensuing toast. It should be on a scale of 1 to 10.
184                    Toast made at 10 generally is considered unfit
185                    for human consumption; toast made at 1 is warmed
186                    lightly.";
187         }
188
189         leaf toasterToastType {
190           type identityref {
191             base toast:toast-type;
192           }
193           default 'wheat-bread';
194           description
195             "This variable informs the toaster of the type of
196                    material that is being toasted. The toaster
197                    uses this information, combined with
198                    toasterDoneness, to compute for how
199                    long the material must be toasted to achieve
200                    the required doneness.";
201         }
202       }
203     }  // rpc make-toast
204
205     rpc cancel-toast {
206       description
207         "Stop making toast, if any is being made.
208            A 'resource-denied' error will be returned
209            if the toaster service is disabled.";
210     }  // rpc cancel-toast
211
212     rpc restock-toaster {
213         description
214           "Restocks the toaster with the amount of bread specified.";
215
216         input {
217             leaf amountOfBreadToStock {
218                 type uint32;
219                 description
220                   "Indicates the amount of bread to re-stock";
221             }
222         }
223     }
224
225     notification toasterOutOfBread {
226       description
227         "Indicates that the toaster has run of out bread.";
228     }  // notification toasterOutOfStock
229
230     notification toasterRestocked {
231       description
232         "Indicates that the toaster has run of out bread.";
233       leaf amountOfBread {
234         type uint32;
235         description
236           "Indicates the amount of bread that was re-stocked";
237       }
238     }  // notification toasterOutOfStock
239
240   }  // module toaster