Write failed node data on recovery to a file
[controller.git] / opendaylight / md-sal / samples / toaster-provider / src / main / yang / toaster-provider-impl.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module toaster-provider-impl {
3
4     yang-version 1;
5     namespace "urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl";
6     prefix "toaster-provider-impl";
7
8     import config { prefix config; revision-date 2013-04-05; }
9     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
10     import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
11     import opendaylight-sal-binding-broker-impl { prefix binding-impl; revision-date 2013-10-28; }
12
13     description
14         "This module contains the base YANG definitions for
15         toaster-provider impl implementation.";
16
17     revision "2014-01-31" {
18         description
19             "Initial revision.";
20     }
21
22     // This is the definition of the service implementation as a module identity.
23     identity toaster-provider-impl {
24             base config:module-type;
25             
26             // Specifies the prefix for generated java classes.
27             config:java-name-prefix ToasterProvider;
28     }
29
30     // Augments the 'configuration' choice node under modules/module.
31     augment "/config:modules/config:module/config:configuration" {
32         case toaster-provider-impl {
33             when "/config:modules/config:module/config:type = 'toaster-provider-impl'";
34
35             container rpc-registry {
36                 uses config:service-ref {
37                     refine type {
38                         mandatory true;
39                         config:required-identity mdsal:binding-rpc-registry;
40                     }
41                 }
42             }
43
44             container notification-service {
45                 uses config:service-ref {
46                     refine type {
47                         mandatory true;
48                         config:required-identity binding-impl:binding-new-notification-publish-service;
49                     }
50                 }
51             }
52
53             container data-broker {
54                 uses config:service-ref {
55                     refine type {
56                         mandatory false;
57                         config:required-identity mdsal:binding-async-data-broker;
58                     }
59                 }
60             }
61         }
62     }
63
64     augment "/config:modules/config:module/config:state" {
65         case toaster-provider-impl {
66             when "/config:modules/config:module/config:type = 'toaster-provider-impl'";
67             
68             leaf toasts-made {
69                 type uint32;
70             }
71             
72             rpcx:rpc-context-instance "clear-toasts-made-rpc";
73         }
74     }
75
76     identity clear-toasts-made-rpc;
77
78     rpc clear-toasts-made  {
79         description
80           "JMX call to clear the toasts-made counter.";
81           
82         input {
83             uses rpcx:rpc-context-ref {
84                 refine context-instance {
85                     rpcx:rpc-context-instance clear-toasts-made-rpc;
86                 }
87             }
88         }
89     }
90 }