Bug-6346: Allow over-ride of non-module capabilities
[netconf.git] / netconf / sal-netconf-connector / src / main / yang / odl-sal-netconf-connector-cfg.yang
1 module odl-sal-netconf-connector-cfg {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf";
4     prefix "sal-netconf";
5
6     import config { prefix config; revision-date 2013-04-05; }
7     import threadpool {prefix th;}
8     import netty {prefix netty;}
9     import opendaylight-md-sal-dom {prefix dom;}
10     import opendaylight-md-sal-binding {prefix md-sal-binding; revision-date 2013-10-28;}
11     import odl-netconf-cfg { prefix cfg-net; revision-date 2014-04-08; }
12     import ietf-inet-types {prefix inet; revision-date "2013-07-15";}
13
14     description
15         "Config definition for Netconf Connector modules";
16
17     revision "2015-08-03" {
18         description
19             "Non-mandatory keepalive executor";
20     }
21
22     revision "2013-10-28" {
23         description
24             "Initial revision";
25     }
26
27     identity sal-netconf-connector {
28         base config:module-type;
29         config:java-name-prefix NetconfConnector;
30         status deprecated;
31     }
32
33     grouping server {
34         leaf address {
35             type string;
36         }
37
38         leaf port {
39             type uint32;
40         }
41     }
42
43     augment "/config:modules/config:module/config:configuration" {
44         status deprecated;
45         case sal-netconf-connector {
46             when "/config:modules/config:module/config:type = 'sal-netconf-connector'";
47
48             leaf address {
49                 type inet:host;
50             }
51
52             leaf port {
53                 type inet:port-number;
54             }
55
56             leaf tcp-only {
57                 type boolean;
58             }
59
60             leaf username {
61                 type string;
62             }
63
64             leaf password {
65                 type string;
66             }
67
68             leaf concurrent-rpc-limit {
69                 type uint16;
70                 default 0;
71                 description "Limit of concurrent messages that can be send before reply messages are received.
72                              If value less than 1 is provided, no limit will be enforced";
73             }
74
75             leaf schema-cache-directory {
76                 type string;
77                 default "schema";
78                 description "The destination schema repository for yang files relative to the cache directory.  This may be specified per netconf mount
79                              so that the loaded yang files are stored to a distinct directory to avoid potential conflict.";
80             }
81
82             container yang-module-capabilities {
83                 leaf override {
84                     type boolean;
85                     default false;
86                     description "Whether to override or merge this list of capabilities with capabilities from device";
87                 }
88
89                 leaf-list capability {
90                     type string;
91                     description "Set a list of capabilities to override capabilities provided in device's hello message.
92                                  Can be used for devices that do not report any yang modules in their hello message";
93                 }
94             }
95
96             container non-module-capabilities {
97                 leaf override {
98                     type boolean;
99                     default false;
100                     description "Whether to override or merge this list of non-module based capabilities with non-module
101                                  based capabilities from device";
102                 }
103
104                 leaf-list capability {
105                     type string;
106                     description "Set a list of non-module based capabilities to override or merge non-module capabilities
107                                  provided in device's hello message. Can be used for devices that do not report or
108                                  incorrectly report non-module based capabilities in their hello message";
109                 }
110             }
111
112             leaf reconnect-on-changed-schema {
113                 type boolean;
114                 default false;
115                 description "If true, the connector would auto disconnect/reconnect when schemas are changed in the remote device.
116                              The connector subscribes (right after connect) to base netconf notifications and listens for netconf-capability-change notification";
117             }
118
119             container dom-registry {
120                 uses config:service-ref {
121                     refine type {
122                         mandatory false;
123                         config:required-identity dom:dom-broker-osgi-registry;
124                     }
125                 }
126             }
127
128             container binding-registry {
129                 uses config:service-ref {
130                     refine type {
131                         mandatory true;
132                         config:required-identity md-sal-binding:binding-broker-osgi-registry;
133                     }
134                 }
135             }
136
137             container event-executor {
138                 uses config:service-ref {
139                     refine type {
140                         mandatory true;
141                         config:required-identity netty:netty-event-executor;
142                     }
143                 }
144             }
145
146             container processing-executor {
147                 uses config:service-ref {
148                     refine type {
149                         mandatory true;
150                         config:required-identity th:threadpool;
151                     }
152                 }
153
154                 description "Makes up for flaws in netty threading design";
155             }
156
157             container client-dispatcher {
158                 uses config:service-ref {
159                     refine type {
160                         mandatory false;
161                         config:required-identity cfg-net:netconf-client-dispatcher;
162                     }
163                 }
164             }
165
166             leaf connection-timeout-millis {
167                 description "Specifies timeout in milliseconds after which connection must be established.";
168                 type uint32;
169                 default 20000;
170             }
171
172             leaf default-request-timeout-millis {
173                 description "Timeout for blocking operations within transactions.";
174                 type uint32;
175                 default 60000;
176             }
177
178             leaf max-connection-attempts {
179                 description "Maximum number of connection retries. Non positive value or null is interpreted as infinity.";
180                 type uint32;
181                 default 0; // retry forever
182             }
183
184             leaf between-attempts-timeout-millis {
185                 description "Initial timeout in milliseconds to wait between connection attempts. Will be multiplied by sleep-factor with every additional attempt";
186                 type uint16;
187                 default 2000;
188             }
189
190             leaf sleep-factor {
191                 type decimal64 {
192                     fraction-digits 1;
193                 }
194                 default 1.5;
195             }
196
197             // Keepalive configuration
198             leaf keepalive-delay {
199                 type uint32;
200                 default 120;
201                 description "Netconf connector sends keepalive RPCs while the session is idle, this delay specifies the delay between keepalive RPC in seconds
202                              If a value less than 1 is provided, no keepalives will be sent";
203             }
204
205             container keepalive-executor {
206                 uses config:service-ref {
207                     refine type {
208                         mandatory false;
209                         config:required-identity th:scheduled-threadpool;
210                     }
211                     refine name {
212                         mandatory false;
213                     }
214                 }
215
216                 description "Dedicated solely to keepalive execution";
217             }
218
219             container yang-library {
220                 leaf yang-library-url {
221                     config true;
222                     type inet:uri;
223                     description "Yang library to be plugged as additional source provider into the shared schema repository";
224                 }
225
226                 // credentials for basic http authentication for get request for yanglib data
227                 leaf username {
228                     config true;
229                     type string;
230                 }
231
232                 leaf password {
233                     config true;
234                     type string;
235                 }
236             }
237         }
238     }
239 }