477876c66979dd6d3a0db8ce224d26174499ab5f
[controller.git] / opendaylight / config / logback-config / src / main / yang / config-logging.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module config-logging {
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:controller:logback:config";
5     prefix "logging";
6
7     import config { prefix config; revision-date 2013-04-05; }
8     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
9
10     organization "Cisco Systems, Inc.";
11
12     description
13         "This module contains the base YANG definitions for NS-OS
14          logging module.";
15
16     revision "2013-07-16" {
17         description
18             "Initial revision.";
19     }
20
21     identity logback {
22         description
23             "Actual state of logback configuration.";
24         base config:module-type;
25         config:java-name-prefix Logback;
26     }
27
28     identity logback-rpc;
29
30     augment "/config:modules/config:module/config:configuration" {
31         case logback {
32             when "/config:modules/config:module/config:type = 'logback'";
33
34             list file-appenders {
35                 leaf append {
36                     type boolean;
37                     mandatory false;
38                 }
39
40                 leaf file-name {
41                     type string;
42                     mandatory true;
43                 }
44
45                 leaf encoder-pattern {
46                     type string;
47                     mandatory true;
48                 }
49
50                 leaf name {
51                     type string;
52                     mandatory true;
53                 }
54                 key name;
55                 config:java-name-prefix FileAppenderTO;
56             }
57
58             list rolling-appenders {
59                 leaf append {
60                     type boolean;
61                     mandatory false;
62                 }
63
64                 leaf file-name {
65                     type string;
66                     mandatory true;
67                 }
68
69                 leaf encoder-pattern {
70                     type string;
71                     mandatory true;
72                 }
73
74                 leaf min-index {
75                     type int32;
76                     mandatory true;
77                 }
78
79                 leaf max-index {
80                     type int32;
81                     mandatory true;
82                 }
83
84                 leaf max-file-size {
85                     type string;
86                     mandatory true;
87                 }
88
89                 leaf name {
90                     type string;
91                     mandatory true;
92                 }
93                 key name;
94
95                 leaf file-name-pattern {
96                     type string;
97                     mandatory true;
98                 }
99
100                 leaf rolling-policy-type {
101                     type string;
102                     mandatory true;
103                 }
104
105                 leaf max-history {
106                     type int32;
107                     mandatory true;
108                 }
109
110                 leaf clean-history-on-start {
111                     type boolean;
112                     default false;
113                 }
114                 config:java-name-prefix RollingFileAppenderTO;
115             }
116
117             list console-appenders {
118
119                 leaf encoder-pattern {
120                     type string;
121                     mandatory true;
122                 }
123
124                 leaf threshold-filter {
125                     type string;
126                     default 'ALL';
127                 }
128
129                 leaf name {
130                     type string;
131                     mandatory true;
132                 }
133                 key name;
134
135                 config:java-name-prefix ConsoleAppenderTO;
136             }
137
138             list loggers {
139                 leaf logger-name {
140                     type string;
141                     mandatory true;
142                 }
143                 key logger-name;
144
145                 leaf level {
146                     type string;
147                     mandatory true;
148                 }
149
150                 leaf-list appenders {
151                     type string;
152                 }
153                 config:java-name-prefix LoggerTO;
154             }
155         }
156     }
157
158
159     augment "/config:modules/config:module/config:state" {
160         case logback {
161             when "/config:modules/config:module/config:type = 'logback'";
162
163             rpcx:rpc-context-instance "logback-rpc";
164
165             list status {
166                 config:java-name-prefix StatusTO;
167
168                 leaf level {
169                     type string;
170                 }
171
172                 leaf message {
173                     type string;
174                 }
175
176                 leaf date {
177                     type uint32;
178                 }
179             }
180         }
181     }
182
183     rpc reset {
184         input {
185             uses rpcx:rpc-context-ref {
186                 refine context-instance {
187                     rpcx:rpc-context-instance logback-rpc;
188                 }
189             }
190         }
191     }
192
193 }
194