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