7af887671d21cf184cf7604284d1b58f77927e9f
[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                 config:java-name-prefix FileAppenderTO;
55             }
56
57             list rolling-appenders {
58                 leaf append {
59                     type boolean;
60                     mandatory false;
61                 }
62
63                 leaf file-name {
64                     type string;
65                     mandatory true;
66                 }
67
68                 leaf encoder-pattern {
69                     type string;
70                     mandatory true;
71                 }
72
73                 leaf min-index {
74                     type int32;
75                     mandatory true;
76                 }
77
78                 leaf max-index {
79                     type int32;
80                     mandatory true;
81                 }
82
83                 leaf max-file-size {
84                     type string;
85                     mandatory true;
86                 }
87
88                 leaf name {
89                     type string;
90                     mandatory true;
91                 }
92
93                 leaf file-name-pattern {
94                     type string;
95                     mandatory true;
96                 }
97
98                 leaf rolling-policy-type {
99                     type string;
100                     mandatory true;
101                 }
102
103                 leaf max-history {
104                     type int32;
105                     mandatory true;
106                 }
107
108                 leaf clean-history-on-start {
109                     type boolean;
110                     default 0;
111                 }
112                 config:java-name-prefix RollingFileAppenderTO;
113             }
114
115             list console-appenders {
116
117                 leaf encoder-pattern {
118                     type string;
119                     mandatory true;
120                 }
121
122                 leaf threshold-filter {
123                     type string;
124                     default 'ALL';
125                 }
126
127                 leaf name {
128                     type string;
129                     mandatory true;
130                 }
131                 config:java-name-prefix ConsoleAppenderTO;
132             }
133
134             list loggers {
135                 leaf logger-name {
136                     type string;
137                     mandatory true;
138                 }
139
140                 leaf level {
141                     type string;
142                     mandatory true;
143                 }
144
145                 leaf-list appenders {
146                     type string;
147                 }
148                 config:java-name-prefix LoggerTO;
149             }
150         }
151     }
152
153
154     augment "/config:modules/config:module/config:state" {
155         case logback {
156             when "/config:modules/config:module/config:type = 'logback'";
157
158             rpcx:rpc-context-instance "logback-rpc";
159
160             list status {
161                 config:java-name-prefix StatusTO;
162
163                 leaf level {
164                     type string;
165                 }
166
167                 leaf message {
168                     type string;
169                 }
170
171                 leaf date {
172                     type uint32;
173                 }
174             }
175         }
176     }
177
178     rpc reset {
179         input {
180             uses rpcx:rpc-context-ref {
181                 refine context-instance {
182                     rpcx:rpc-context-instance logback-rpc;
183                 }
184             }
185         }
186     }
187
188 }
189