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