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