d0307f619490b83d7ddd34f68b22260f1b23134f
[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 rolling-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 min-index {
51                     type int32;
52                     mandatory true;
53                 }
54
55                 leaf max-index {
56                     type int32;
57                     mandatory true;
58                 }
59
60                 leaf max-file-size {
61                     type string;
62                     mandatory true;
63                 }
64
65                 leaf name {
66                     type string;
67                     mandatory true;
68                 }
69
70                 leaf file-name-pattern {
71                     type string;
72                     mandatory true;
73                 }
74
75                 config:java-name-prefix RollingFileAppenderTO;
76             }
77
78             list console-appenders {
79
80                 leaf encoder-pattern {
81                     type string;
82                     mandatory true;
83                 }
84
85                 leaf threshold-filter {
86                     type string;
87                     default 'ALL';
88                 }
89
90                 leaf name {
91                     type string;
92                     mandatory true;
93                 }
94                 config:java-name-prefix ConsoleAppenderTO;
95             }
96
97             list loggers {
98                 leaf logger-name {
99                     type string;
100                     mandatory true;
101                 }
102
103                 leaf level {
104                     type string;
105                     mandatory true;
106                 }
107
108                 leaf-list appenders {
109                     type string;
110                 }
111                 config:java-name-prefix LoggerTO;
112             }
113         }
114     }
115
116
117     augment "/config:modules/config:module/config:state" {
118         case logback {
119             when "/config:modules/config:module/config:type = 'logback'";
120
121             rpcx:rpc-context-instance "logback-rpc";
122
123             list status {
124                 config:java-name-prefix StatusTO;
125
126                 leaf level {
127                     type string;
128                 }
129
130                 leaf message {
131                     type string;
132                 }
133
134                 leaf date {
135                     type uint32;
136                 }
137             }
138         }
139     }
140
141     rpc reset {
142         input {
143             uses rpcx:rpc-context-ref {
144                 refine context-instance {
145                     rpcx:rpc-context-instance logback-rpc;
146                 }
147             }
148         }
149     }
150
151 }
152