Merge "Breaking up 6360: Adding base features"
[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
13     description
14         "This module contains the base YANG definitions for
15         kitchen-service impl implementation.";
16
17     revision "2014-01-31" {
18         description
19             "Initial revision.";
20     }
21
22     // This is the definition of kitchen service interface identity.
23     identity kitchen-service {
24         base "config:service-type";
25         config:java-class "org.opendaylight.controller.sample.kitchen.api.KitchenService";
26     }
27
28     // This is the definition of kitchen service implementation module identity. 
29     identity kitchen-service-impl {
30             base config:module-type;
31             config:provided-service kitchen-service;
32             config:java-name-prefix KitchenService;
33     }
34
35     augment "/config:modules/config:module/config:configuration" {
36         case kitchen-service-impl {
37             when "/config:modules/config:module/config:type = 'kitchen-service-impl'";
38
39             container rpc-registry {
40                 uses config:service-ref {
41                     refine type {
42                         mandatory true;
43                         config:required-identity mdsal:binding-rpc-registry;
44                     }
45                 }
46             }
47
48             container notification-service {
49                 uses config:service-ref {
50                     refine type {
51                         mandatory true;
52                         config:required-identity mdsal:binding-notification-service;
53                     }
54                 }
55             }
56         }
57     }
58     
59     augment "/config:modules/config:module/config:state" {
60         case kitchen-service-impl {
61             when "/config:modules/config:module/config:type = 'kitchen-service-impl'";
62             
63             rpcx:rpc-context-instance "make-scrambled-with-wheat-rpc";
64         }
65     }
66
67     identity make-scrambled-with-wheat-rpc;
68
69     rpc make-scrambled-with-wheat  {
70         description
71           "Shortcut JMX call to make breakfast with scrambled eggs and wheat toast for testing.";
72           
73         input {
74             uses rpcx:rpc-context-ref {
75                 refine context-instance {
76                     rpcx:rpc-context-instance make-scrambled-with-wheat-rpc;
77                 }
78             }
79         }
80         
81         output {
82             leaf result {
83                 type boolean;
84             }
85         }
86     }
87 }