unifying statistics manager api packages
[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;}
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
12
13     description
14         "openflow-plugin-custom-config-impl";
15
16     revision "2014-03-26" {
17         description
18             "Initial revision";
19     }
20
21     identity openflow-provider-impl {
22         base config:module-type;
23         config:provided-service openflow-provider:openflow-provider;
24         config:java-name-prefix ConfigurableOpenFlowProvider;
25     }
26
27     identity msg-spy-service {
28         description
29             "MessageCountDumperServiceInterface as a MsgSpyService interface identity";
30         base config:service-type;
31         config:java-class "org.opendaylight.openflowplugin.api.openflow.statistics.MessageCountDumper";
32     }
33
34     identity msg-spy-service-impl {
35         description
36             "This is the definition of MsgSpyService implementation module identity.";
37         base config:module-type;
38         config:provided-service msg-spy-service;
39         config:java-name-prefix MsgSpyService;
40     }
41
42     // role of OFPlugin instance
43     typedef ofp-role {
44         type enumeration {
45             enum NOCHANGE {
46                 description "no change to role";
47             }
48             enum BECOMEMASTER {
49                 description "promote current role to MASTER";
50             }
51             enum BECOMESLAVE {
52                 description "demote current role to SLAVE";
53             }
54         }
55     }
56
57     augment "/config:modules/config:module/config:configuration" {
58         case openflow-provider-impl {
59             when "/config:modules/config:module/config:type = 'openflow-provider-impl'";
60
61             container binding-aware-broker {
62                 uses config:service-ref {
63                     refine type {
64                         mandatory true;
65                         config:required-identity md-sal-binding:binding-broker-osgi-registry;
66                     }
67                 }
68             }
69             list openflow-switch-connection-provider {
70                 uses config:service-ref {
71                     refine type {
72                         mandatory true;
73                         config:required-identity openflow-switch-connection-provider:openflow-switch-connection-provider;
74                     }
75                 }
76             }
77             leaf role {
78                 type ofp-role;
79                 default "NOCHANGE";
80             }
81         }
82
83         case msg-spy-service-impl {
84             when "/config:modules/config:module/config:type = 'msg-spy-service-impl'";
85
86             container openflow-plugin-provider {
87                 uses config:service-ref {
88                     refine type {
89                         mandatory true;
90                         config:required-identity openflow-provider:openflow-provider;
91                     }
92                 }
93             }
94         }
95     }
96
97     augment "/config:modules/config:module/config:state" {
98         case msg-spy-service-impl {
99             when "/config:modules/config:module/config:type = 'msg-spy-service-impl'";
100
101             description
102                 "MXBean designed for Message Statistic providing to JConsole.";
103
104             leaf msgStatistics {
105                 type string;
106             }
107
108             rpcx:rpc-context-instance "make-msg-statistics-rpc";
109         }
110     }
111
112     identity make-msg-statistics-rpc;
113
114     rpc make-msg-statistics {
115
116         description 
117             "Shortcut JMX call to getMsgStatistics.";
118
119         input {
120             uses rpcx:rpc-context-ref {
121                 refine context-instance {
122                     rpcx:rpc-context-instance make-msg-statistics-rpc;
123                 }
124             }
125         }
126
127         output {
128             leaf result {
129                 type string;
130             }
131         }
132     }
133 }