Bug 4577 Allow specification of a distinct schema cache directory per netconf device
[controller.git] / opendaylight / md-sal / 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         "Service definition for Binding Aware MD-SAL.";
16
17     revision "2013-10-28" {
18         description
19             "Initial revision";
20     }
21
22     identity sal-netconf-connector {
23         base config:module-type;
24         config:java-name-prefix NetconfConnector;
25     }
26
27     grouping server {
28         leaf address {
29             type string;
30         }
31
32         leaf port {
33             type uint32;
34         }
35     }
36
37     augment "/config:modules/config:module/config:configuration" {
38         case sal-netconf-connector {
39             when "/config:modules/config:module/config:type = 'sal-netconf-connector'";
40
41             leaf address {
42                 type inet:host;
43             }
44
45             leaf port {
46                 type inet:port-number;
47             }
48
49             leaf tcp-only {
50                 type boolean;
51             }
52
53             leaf username {
54                 type string;
55             }
56
57             leaf password {
58                 type string;
59             }
60
61             leaf schema-cache-directory {
62                 type string;
63                 default "schema";
64                 description "The destination schema repository for yang files relative to the cache directory.  This may be specified per netconf mount
65                              so that the loaded yang files are stored to a distinct directory to avoid potential conflict.";
66             }
67
68             container yang-module-capabilities {
69                 leaf-list capability {
70                     type string;
71                     description "Set a list of capabilities to override capabilities provided in device's hello message.
72                                  Can be used for devices that do not report any yang modules in their hello message";
73                 }
74             }
75
76             leaf reconnect-on-changed-schema {
77                 type boolean;
78                 default false;
79                 description "If true, the connector would auto disconnect/reconnect when schemas are changed in the remote device.
80                              The connector subscribes (right after connect) to base netconf notifications and listens for netconf-capability-change notification";
81             }
82
83             container dom-registry {
84                 uses config:service-ref {
85                     refine type {
86                         mandatory true;
87                         config:required-identity dom:dom-broker-osgi-registry;
88                     }
89                 }
90             }
91
92             container binding-registry {
93                 uses config:service-ref {
94                     refine type {
95                         mandatory true;
96                         config:required-identity md-sal-binding:binding-broker-osgi-registry;
97                     }
98                 }
99             }
100
101             container event-executor {
102                 uses config:service-ref {
103                     refine type {
104                         mandatory true;
105                         config:required-identity netty:netty-event-executor;
106                     }
107                 }
108             }
109
110             container processing-executor {
111                 uses config:service-ref {
112                     refine type {
113                         mandatory true;
114                         config:required-identity th:threadpool;
115                     }
116                 }
117
118                 description "Makes up for flaws in netty threading design";
119             }
120
121             container client-dispatcher {
122                 uses config:service-ref {
123                     refine type {
124                         mandatory false;
125                         config:required-identity cfg-net:netconf-client-dispatcher;
126                     }
127                 }
128             }
129
130             leaf connection-timeout-millis {
131                 description "Specifies timeout in milliseconds after which connection must be established.";
132                 type uint32;
133                 default 20000;
134             }
135
136             leaf default-request-timeout-millis {
137                 description "Timeout for blocking operations within transactions.";
138                 type uint32;
139                 default 60000;
140             }
141
142             leaf max-connection-attempts {
143                 description "Maximum number of connection retries. Non positive value or null is interpreted as infinity.";
144                 type uint32;
145                 default 0; // retry forever
146             }
147
148             leaf between-attempts-timeout-millis {
149                 description "Initial timeout in milliseconds to wait between connection attempts. Will be multiplied by sleep-factor with every additional attempt";
150                 type uint16;
151                 default 2000;
152             }
153
154             leaf sleep-factor {
155                 type decimal64 {
156                     fraction-digits 1;
157                 }
158                 default 1.5;
159             }
160
161             // Keepalive configuration
162             leaf keepalive-delay {
163                 type uint32;
164                 default 120;
165                 description "Netconf connector sends keepalive RPCs while the session is idle, this delay specifies the delay between keepalive RPC in seconds
166                              If a value <1 is provided, no keepalives will be sent";
167             }
168
169             container keepalive-executor {
170                 uses config:service-ref {
171                     refine type {
172                         mandatory false;
173                         config:required-identity th:scheduled-threadpool;
174                     }
175                 }
176
177                 description "Dedicated solely to keepalive execution";
178             }
179         }
180     }
181 }