Bug 1585 - switch features removed after node updated
[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     rpc make-toast {
134       description
135         "Make some toast.
136            The toastDone notification will be sent when
137            the toast is finished.
138            An 'in-use' error will be returned if toast
139            is already being made.
140            A 'resource-denied' error will be returned
141            if the toaster service is disabled.";
142       input {
143         leaf toasterDoneness {
144           type uint32 {
145             range "1 .. 10";
146           }
147           default '5';
148           description
149             "This variable controls how well-done is the
150                    ensuing toast. It should be on a scale of 1 to 10.
151                    Toast made at 10 generally is considered unfit
152                    for human consumption; toast made at 1 is warmed
153                    lightly.";
154         }
155
156         leaf toasterToastType {
157           type identityref {
158             base toast:toast-type;
159           }
160           default 'wheat-bread';
161           description
162             "This variable informs the toaster of the type of
163                    material that is being toasted. The toaster
164                    uses this information, combined with
165                    toasterDoneness, to compute for how
166                    long the material must be toasted to achieve
167                    the required doneness.";
168         }
169       }
170     }  // rpc make-toast
171
172     rpc cancel-toast {
173       description
174         "Stop making toast, if any is being made.
175            A 'resource-denied' error will be returned
176            if the toaster service is disabled.";
177     }  // rpc cancel-toast
178
179     rpc restock-toaster {
180         description
181           "Restocks the toaster with the amount of bread specified.";
182
183         input {
184             leaf amountOfBreadToStock {
185                 type uint32;
186                 description
187                   "Indicates the amount of bread to re-stock";
188             }
189         }
190     }
191
192     notification toasterOutOfBread {
193       description
194         "Indicates that the toaster has run of out bread.";
195     }  // notification toasterOutOfStock
196
197     notification toasterRestocked {
198       description
199         "Indicates that the toaster has run of out bread.";
200       leaf amountOfBread {
201         type uint32;
202         description
203           "Indicates the amount of bread that was re-stocked";
204       }
205     }  // notification toasterOutOfStock
206
207   }  // module toaster