Merge "Bug 451 - Fix netconf exception handling"
[controller.git] / opendaylight / md-sal / samples / toaster-consumer / src / main / yang / toaster-consumer-impl.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module toaster-consumer-impl {
3
4     yang-version 1;
5     namespace "urn:opendaylight:params:xml:ns:yang:controller:config:toaster-consumer:impl";
6     prefix "toaster-consumer-impl";
7
8     import config { prefix config; revision-date 2013-04-05; }
9     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
10
11     import toaster-consumer { prefix toaster-consumer; revision-date 2014-01-31; }
12     import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
13
14     description
15         "This module contains the base YANG definitions for
16         toaster-consumer impl implementation.";
17
18     revision "2014-01-31" {
19         description
20             "Initial revision.";
21     }
22
23     // This is the definition of a service implementation
24     identity toaster-consumer-impl {
25             base config:module-type;
26             config:provided-service toaster-consumer:toaster-consumer;
27             config:java-name-prefix ToasterConsumer;
28     }
29
30     augment "/config:modules/config:module/config:configuration" {
31         case toaster-consumer-impl {
32             when "/config:modules/config:module/config:type = 'toaster-consumer-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         }
53     }
54
55     augment "/config:modules/config:module/config:state" {
56         case toaster-consumer-impl {
57             when "/config:modules/config:module/config:type = 'toaster-consumer-impl'";
58             rpcx:rpc-context-instance "make-hash-brown-toast-rpc";
59         }
60     }
61
62     identity make-hash-brown-toast-rpc;
63
64     rpc make-hash-brown-toast {
65         input {
66             uses rpcx:rpc-context-ref {
67                 refine context-instance {
68                     rpcx:rpc-context-instance make-hash-brown-toast-rpc;
69                 }
70             }
71             leaf doneness {
72                 type uint16;
73             }
74         }
75         output {
76             leaf result {
77                 type boolean;
78             }
79         }
80     }
81 }