BUG-5636: making table features configurable for the He plugin.
[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             leaf skip-table-features {
112                 description "Ability to skip pulling and storing of large table features. These features are still
113                     available via rpc, so if use set it to true, it won't store table feature data in DataStore.";
114                 type boolean;
115                 default "false";
116             }
117         }
118
119         case msg-spy-service-impl {
120             when "/config:modules/config:module/config:type = 'msg-spy-service-impl'";
121
122             container openflow-plugin-provider {
123                 uses config:service-ref {
124                     refine type {
125                         mandatory true;
126                         config:required-identity openflow-provider:openflow-provider;
127                     }
128                 }
129             }
130         }
131     }
132
133     augment "/config:modules/config:module/config:state" {
134         case msg-spy-service-impl {
135             when "/config:modules/config:module/config:type = 'msg-spy-service-impl'";
136
137             description
138                 "MXBean designed for Message Statistic providing to JConsole.";
139
140             leaf msgStatistics {
141                 type string;
142             }
143
144             rpcx:rpc-context-instance "make-msg-statistics-rpc";
145         }
146     }
147
148     identity make-msg-statistics-rpc;
149
150     rpc make-msg-statistics {
151
152         description
153             "Shortcut JMX call to getMsgStatistics.";
154
155         input {
156             uses rpcx:rpc-context-ref {
157                 refine context-instance {
158                     rpcx:rpc-context-instance make-msg-statistics-rpc;
159                 }
160             }
161         }
162
163         output {
164             leaf result {
165                 type string;
166             }
167         }
168     }
169 }