Merge "Re-added config.version to config-module-archetype."
[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
12     description
13         "This module contains the base YANG definitions for
14         toaster-provider impl implementation.";
15
16     revision "2014-01-31" {
17         description
18             "Initial revision.";
19     }
20
21     // This is the definition of the service implementation as a module identity.
22     identity toaster-provider-impl {
23             base config:module-type;
24             
25             // Specifies the prefix for generated java classes.
26             config:java-name-prefix ToasterProvider;
27     }
28
29     // Augments the 'configuration' choice node under modules/module.
30     augment "/config:modules/config:module/config:configuration" {
31         case toaster-provider-impl {
32             when "/config:modules/config:module/config:type = 'toaster-provider-impl'";
33
34             container rpc-registry {
35                 uses config:service-ref {
36                     refine type {
37                         mandatory true;
38                         config:required-identity mdsal:binding-rpc-registry;
39                     }
40                 }
41             }
42
43             container notification-service {
44                 uses config:service-ref {
45                     refine type {
46                         mandatory true;
47                         config:required-identity mdsal:binding-notification-service;
48                     }
49                 }
50             }
51
52             container data-broker {
53                 uses config:service-ref {
54                     refine type {
55                         mandatory false;
56                         config:required-identity mdsal:binding-async-data-broker;
57                     }
58                 }
59             }
60         }
61     }
62
63     augment "/config:modules/config:module/config:state" {
64         case toaster-provider-impl {
65             when "/config:modules/config:module/config:type = 'toaster-provider-impl'";
66             
67             leaf toasts-made {
68                 type uint32;
69             }
70             
71             rpcx:rpc-context-instance "clear-toasts-made-rpc";
72         }
73     }
74
75     identity clear-toasts-made-rpc;
76
77     rpc clear-toasts-made  {
78         description
79           "JMX call to clear the toasts-made counter.";
80           
81         input {
82             uses rpcx:rpc-context-ref {
83                 refine context-instance {
84                     rpcx:rpc-context-instance clear-toasts-made-rpc;
85                 }
86             }
87         }
88     }
89 }