0aa1eef2bc5b12c3eb2a3d3346fabe39a278fcf5
[openflowplugin.git] / openflowplugin / src / main / yang / openflow-plugin-cfg-impl.yang
1 module openflow-provider-impl {
2         yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:openflow:common:config:impl";
4     prefix "ofplugin-cfg-impl";
5
6     import config {prefix config; revision-date 2013-04-05;}
7     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
8     import openflow-provider { prefix openflow-provider;   revision-date 2014-03-26;  }
9     import openflow-switch-connection-provider {prefix openflow-switch-connection-provider;revision-date 2014-03-28;}
10     import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
11     import openflowplugin-extension-registry {prefix ofp-ext-reg; revision-date 2015-04-25;}
12     import opendaylight-entity-ownership-service { prefix entity-ownership-service; }
13
14     description
15         "openflow-plugin-custom-config-impl";
16
17     revision "2014-03-26" {
18         description
19             "Initial revision";
20     }
21
22     identity openflow-provider-impl {
23         base config:module-type;
24         config:provided-service openflow-provider:openflow-provider;
25         config:provided-service ofp-ext-reg:openflow-extension-registry-provider;
26         config:java-name-prefix ConfigurableOpenFlowProvider;
27     }
28
29     identity msg-spy-service {
30         description
31             "MessageCountDumperServiceInterface as a MsgSpyService interface identity";
32         base config:service-type;
33         config:java-class "org.opendaylight.openflowplugin.api.openflow.statistics.MessageCountDumper";
34     }
35
36     identity msg-spy-service-impl {
37         description
38             "This is the definition of MsgSpyService implementation module identity.";
39         base config:module-type;
40         config:provided-service msg-spy-service;
41         config:java-name-prefix MsgSpyService;
42     }
43
44     // role of OFPlugin instance
45     typedef ofp-role {
46         type enumeration {
47             enum NOCHANGE {
48                 description "no change to role";
49             }
50             enum BECOMEMASTER {
51                 description "promote current role to MASTER";
52             }
53             enum BECOMESLAVE {
54                 description "demote current role to SLAVE";
55             }
56         }
57     }
58
59     augment "/config:modules/config:module/config:configuration" {
60         case openflow-provider-impl {
61             when "/config:modules/config:module/config:type = 'openflow-provider-impl'";
62
63             container data-broker {
64                 uses config:service-ref {
65                     refine type {
66                         mandatory true;
67                         config:required-identity md-sal-binding:binding-async-data-broker;
68                     }
69                 }
70             }
71
72             container ownership-service {
73                 uses config:service-ref {
74                     refine type {
75                         mandatory true;
76                         config:required-identity entity-ownership-service:entity-ownership-service;
77                     }
78                 }
79             }
80
81             container rpc-registry {
82                 uses config:service-ref {
83                     refine type {
84                         mandatory true;
85                         config:required-identity md-sal-binding:binding-rpc-registry;
86                     }
87                 }
88             }
89             container notification-service {
90                 uses config:service-ref {
91                     refine type {
92                         mandatory true;
93                         config:required-identity md-sal-binding:binding-notification-service;
94                     }
95                 }
96             }
97
98             list openflow-switch-connection-provider {
99                 uses config:service-ref {
100                     refine type {
101                         mandatory true;
102                         config:required-identity openflow-switch-connection-provider:openflow-switch-connection-provider;
103                     }
104                 }
105             }
106             leaf role {
107                 type ofp-role;
108                 default "NOCHANGE";
109             }
110         }
111
112         case msg-spy-service-impl {
113             when "/config:modules/config:module/config:type = 'msg-spy-service-impl'";
114
115             container openflow-plugin-provider {
116                 uses config:service-ref {
117                     refine type {
118                         mandatory true;
119                         config:required-identity openflow-provider:openflow-provider;
120                     }
121                 }
122             }
123         }
124     }
125
126     augment "/config:modules/config:module/config:state" {
127         case msg-spy-service-impl {
128             when "/config:modules/config:module/config:type = 'msg-spy-service-impl'";
129
130             description
131                 "MXBean designed for Message Statistic providing to JConsole.";
132
133             leaf msgStatistics {
134                 type string;
135             }
136
137             rpcx:rpc-context-instance "make-msg-statistics-rpc";
138         }
139     }
140
141     identity make-msg-statistics-rpc;
142
143     rpc make-msg-statistics {
144
145         description
146             "Shortcut JMX call to getMsgStatistics.";
147
148         input {
149             uses rpcx:rpc-context-ref {
150                 refine context-instance {
151                     rpcx:rpc-context-instance make-msg-statistics-rpc;
152                 }
153             }
154         }
155
156         output {
157             leaf result {
158                 type string;
159             }
160         }
161     }
162 }