fd25878949ca5df366a65d041846ddbfbfd8813e
[controller.git] / opendaylight / md-sal / samples / toaster-consumer / src / main / yang / kitchen-service-impl.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module kitchen-service-impl {
3
4     yang-version 1;
5     namespace "urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl";
6     prefix "kitchen-service-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 opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
12     import opendaylight-sal-binding-broker-impl { prefix binding-impl; revision-date 2013-10-28; }
13
14     description
15         "This module contains the base YANG definitions for
16         kitchen-service impl implementation.";
17
18     revision "2014-01-31" {
19         description
20             "Initial revision.";
21     }
22
23     // This is the definition of kitchen service interface identity.
24     identity kitchen-service {
25         base "config:service-type";
26         config:java-class "org.opendaylight.controller.sample.kitchen.api.KitchenService";
27     }
28
29     // This is the definition of kitchen service implementation module identity. 
30     identity kitchen-service-impl {
31             base config:module-type;
32             config:provided-service kitchen-service;
33             config:java-name-prefix KitchenService;
34     }
35
36     augment "/config:modules/config:module/config:configuration" {
37         case kitchen-service-impl {
38             when "/config:modules/config:module/config:type = 'kitchen-service-impl'";
39
40             container rpc-registry {
41                 uses config:service-ref {
42                     refine type {
43                         mandatory true;
44                         config:required-identity mdsal:binding-rpc-registry;
45                     }
46                 }
47             }
48
49             container notification-service {
50                 uses config:service-ref {
51                     refine type {
52                         mandatory true;
53                         config:required-identity binding-impl:binding-new-notification-service;
54                     }
55                 }
56             }
57         }
58     }
59     
60     augment "/config:modules/config:module/config:state" {
61         case kitchen-service-impl {
62             when "/config:modules/config:module/config:type = 'kitchen-service-impl'";
63             
64             rpcx:rpc-context-instance "make-scrambled-with-wheat-rpc";
65         }
66     }
67
68     identity make-scrambled-with-wheat-rpc;
69
70     rpc make-scrambled-with-wheat  {
71         description
72           "Shortcut JMX call to make breakfast with scrambled eggs and wheat toast for testing.";
73           
74         input {
75             uses rpcx:rpc-context-ref {
76                 refine context-instance {
77                     rpcx:rpc-context-instance make-scrambled-with-wheat-rpc;
78                 }
79             }
80         }
81         
82         output {
83             leaf result {
84                 type boolean;
85             }
86         }
87     }
88 }