Code

Fix for POD error by Sebasian Harl
[rrdtool-all.git] / website / rrdtool-dump.xsd
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3         XML schema definition for the RRDTool dump output.
5         Author: 
6                 Tobias Lindenmann <tobias.lindenmann at 1und1.de>
7 -->
8 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
9         xmlns:ns="http://oss.oetiker.ch/rrdtool/rrdtool-dump.xml" 
10         targetNamespace="http://oss.oetiker.ch/rrdtool/rrdtool-dump.xml" 
11         elementFormDefault="qualified">
12         
13         <!-- Root element -->
14         <xsd:element name="rrd" type="ns:RrdType">
15                 <!-- Check datasource name of unique. -->
16                 <xsd:unique name="Ds.Name">
17                         <xsd:selector xpath="ns:ds/ns:name"/>
18                         <xsd:field xpath="."/>
19                 </xsd:unique>
20         </xsd:element>
21         
22         <!-- Start of complexTypes -->
23         <xsd:complexType name="RrdType">
24                 <xsd:sequence>
25                         <!-- RRD file version/RRD Archiv version number-->
26                         <xsd:element name="version" type="xsd:nonNegativeInteger"/>
27                         <!-- The primary RRD Archiv step in seconds.-->
28                         <xsd:element name="step" type="xsd:nonNegativeInteger"/>
29                         <!-- The unixtime from the last rrd_update.-->
30                         <xsd:element name="lastupdate" type="xsd:nonNegativeInteger"/>
31                         <xsd:element name="ds" type="ns:DsType" minOccurs="1" maxOccurs="unbounded"/>
32                         <!-- Round Robin Archive (rra). This is the place where the
33                              consolidated data points (cdp) get stored. The data is
34                              organized in rows (row) and columns (col). The Round Robin
35                              Archive got its name from the method data is stored in
36                              there. An RRD database can contain several Round Robin
37                              Archives. Each Round Robin Archive can have a different row
38                              spacing along the time axis (pdp_cnt) and a different
39                              consolidation function (cf) used to build its consolidated
40                              data points (cdp). -->
41                         <xsd:element name="rra" type="ns:RraType" minOccurs="1" maxOccurs="unbounded"/>
42                 </xsd:sequence>
43         </xsd:complexType>
44         
45         <xsd:complexType name="DsType">
46                 <xsd:sequence>
47                         <!-- The name of the data source. -->
48                         <xsd:element name="name" type="ns:DataSourceNameType"/>
49                         <!-- The Data Source Type (GAUGE, COUNTER, DERIVE, ABSOLUTE, COMPUTE)
50                              defines the applied to Build Primary Data Points from the 
51                              input provided by the data sources (ds). -->
52                         <xsd:element name="type" type="ns:DataSourceType"/>
53                         <!-- Chocie one groups of elements. -->
54                         <xsd:choice>
55                                 <!-- Group with the elements min,max and heartbeat_min. -->
56                                 <xsd:group ref="ns:Ds.NormalType"/>
57                                 <!-- Group with the element cdef.-->
58                                 <xsd:group ref="ns:Ds.CdefType"/>
59                         </xsd:choice>
60                         <xsd:element name="last_ds" type="ns:NumberWithUNKNType"/>
61                         <!-- Current value of the primary data point, this depends on the data source type. -->
62                         <xsd:element name="value" type="ns:LexicalNumberWithNaNType"/>
63                         <!-- How many seconds of the current 
64                                         * pdp value is unknown data?-->
65                         <xsd:element name="unknown_sec" type="xsd:nonNegativeInteger"/>
66                 </xsd:sequence>
67         </xsd:complexType>
69         <xsd:complexType name="RraType">
70                 <xsd:sequence>
71                         <!-- Consolidation Function (cf). An arbitrary Consolidation Function (cf)
72                              (averaging, min, max) is applied to the primary data points (pdp) to
73                              calculate the consolidated data point. -->
74                         <xsd:element name="cf" type="ns:ConsolidationFunctionType"/>
75                         <xsd:element name="pdp_per_row" type="xsd:nonNegativeInteger"/>
76                         <xsd:element name="params">
77                                 <!-- Chocie one groups of elements. -->
78                                 <xsd:complexType>
79                                         <xsd:choice>
80                                                 <xsd:group ref="ns:Params.HwPredictType"/> 
81                                                 <xsd:group ref="ns:Params.SeasonalType"/>
82                                                 <xsd:group ref="ns:Params.FailuresType"/>
83                                                 <xsd:group ref="ns:Params.DevPredictType"/>
84                                                 <xsd:group ref="ns:Params.AvgMinMaxType"/>
85                                         </xsd:choice>
86                                 </xsd:complexType>
87                         </xsd:element>
88                         <!-- Data prep area for cdp values -->
89                         <xsd:element name="cdp_prep" type="ns:CdpPrepType"/>
90                         <xsd:element name="database" type="ns:DatabaseType"/>
91                 </xsd:sequence>
92         </xsd:complexType>
94         <xsd:complexType name="DatabaseType">
95                 <xsd:sequence>
96                         <xsd:element name="row" type="ns:VType" minOccurs="1" maxOccurs="unbounded"/>
97                 </xsd:sequence>
98         </xsd:complexType>
100         <xsd:complexType name="VType">
101                 <xsd:sequence>
102                         <xsd:element name="v" type="ns:LexicalNumberWithNaNType" minOccurs="1" maxOccurs="unbounded"/>
103                 </xsd:sequence> 
104         </xsd:complexType>
106         <xsd:complexType name="CdpPrepType">
107                 <xsd:sequence>
108                         <xsd:element name="ds" minOccurs="1" maxOccurs="unbounded">
109                                 <xsd:complexType>
110                                         <xsd:sequence>
111                                                 <xsd:group ref="ns:Ds.Cdp"/>
112                                                 <!-- Chocie one groups of elements. -->
113                                                 <xsd:choice>
114                                                         <xsd:group ref="ns:Ds.Cdp.HwPredictType"/>
115                                                         <xsd:group ref="ns:Ds.Cdp.SeasonalType"/>
116                                                         <xsd:group ref="ns:Ds.Cdp.FailuresType"/>
117                                                         <xsd:group ref="ns:Ds.Cdp.AvgMinMaxType"/>
118                                                 </xsd:choice>
119                                         </xsd:sequence>
120                                 </xsd:complexType>
121                         </xsd:element>
122                  </xsd:sequence>
123         </xsd:complexType>
124         <!-- End of complexTypes -->
126         <!-- Start of groups -->
127         <!-- Start of groups for the element rrd/ds. -->
128         <xsd:group name="Ds.NormalType">
129                 <xsd:sequence>
130                         <!-- Minimum required heartbeat. A
131                                      * data source must provide input at
132                                      * least every ds_mrhb seconds,
133                                      * otherwise it is regarded dead and
134                                      * will be set to UNKNOWN -->
135                         <xsd:element name="minimal_heartbeat" type="xsd:integer"/>
136                         <!-- Min and max define the expected range values for data supplied by a data source. -->
137                         <xsd:element name="min" type="ns:LexicalNumberWithNaNType"/>
138                         <xsd:element name="max" type="ns:LexicalNumberWithNaNType"/>
139                 </xsd:sequence>
140         </xsd:group>
142         <xsd:group name="Ds.CdefType">
143                 <xsd:sequence>
144                         <xsd:element name="cdef" type="xsd:string"/>
145                 </xsd:sequence>
146         </xsd:group>
147         <!-- End of groups for the element rrd/ds. -->
148         <!-- Start of groups for the element rrd/rra/cd_prep/ds. -->
149         <xsd:group name="Ds.Cdp.HwPredictType">
150                 <xsd:sequence>
151                         <xsd:element name="intercept" type="ns:LexicalNumberWithNaNType"/>
152                         <xsd:element name="last_intercept" type="ns:LexicalNumberWithNaNType"/>
153                         <xsd:element name="slope" type="ns:LexicalNumberWithNaNType"/>
154                         <xsd:element name="last_slope" type="ns:LexicalNumberWithNaNType"/>
155                         <xsd:element name="nan_count" type="xsd:integer"/>
156                         <xsd:element name="last_nan_count" type="xsd:integer"/>
157                 </xsd:sequence>
158         </xsd:group>
160         <xsd:group name="Ds.Cdp.SeasonalType">
161                 <xsd:sequence>
162                         <xsd:element name="seasonal" type="ns:LexicalNumberWithNaNType"/>
163                         <xsd:element name="last_seasonal" type="ns:LexicalNumberWithNaNType"/>
164                         <xsd:element name="init_flag" type="xsd:integer"/>
165                 </xsd:sequence>
166         </xsd:group>
168         <xsd:group name="Ds.Cdp.FailuresType">
169                 <xsd:sequence>
170                         <!-- History failures message.-->
171                         <xsd:element name="history" type="xsd:string"/>
172                 </xsd:sequence>
173         </xsd:group>
175         <xsd:group name="Ds.Cdp.AvgMinMaxType">
176                 <xsd:sequence>
177                         <xsd:element name="value" type="ns:LexicalNumberWithNaNType"/>
178                         <xsd:element name="unknown_datapoints" type="xsd:integer"/>
179                 </xsd:sequence>
180         </xsd:group>
182         <xsd:group name="Ds.Cdp">
183                 <xsd:sequence>
184                         <xsd:element name="primary_value" type="ns:LexicalNumberWithNaNType"/>
185                         <xsd:element name="secondary_value" type="ns:LexicalNumberWithNaNType"/>
186                 </xsd:sequence>
187         </xsd:group>
188         <!-- End of groups for the element cd_prep/ds. -->
189         <!-- Start of groups for the element params. -->
190         <xsd:group name="Params.HwPredictType">
191                 <xsd:sequence>
192                         <xsd:element name="hw_alpha" type="ns:LexicalNumberType"/>
193                         <xsd:element name="hw_beta" type="ns:LexicalNumberType"/>
194                         <xsd:element name="dependent_rra_idx" type="xsd:integer"/>
195                 </xsd:sequence>
196         </xsd:group>
197         
198         <xsd:group name="Params.SeasonalType">
199                 <xsd:sequence>
200                         <xsd:element name="seasonal_gamma" type="ns:LexicalNumberType"/>
201                         <xsd:element name="seasonal_smooth_idx" type="xsd:integer"/>
202                         <xsd:element name="smoothing_window" type="ns:LexicalNumberType"/>
203                         <xsd:element name="dependent_rra_idx" type="xsd:integer"/>
204                 </xsd:sequence>
205         </xsd:group>
207         <xsd:group name="Params.FailuresType">
208                 <xsd:sequence>
209                         <xsd:element name="delta_pos" type="ns:LexicalNumberType"/>
210                         <xsd:element name="delta_neg" type="ns:LexicalNumberType"/>
211                         <xsd:element name="window_len" type="xsd:integer"/>
212                         <xsd:element name="failure_threshold" type="xsd:integer"/>
213                 </xsd:sequence>
214         </xsd:group>
216         <xsd:group name="Params.DevPredictType">
217                 <xsd:sequence>
218                         <xsd:element name="dependent_rra_idx" type="xsd:integer"/>
219                 </xsd:sequence>
220         </xsd:group>
222         <xsd:group name="Params.AvgMinMaxType">
223                 <xsd:sequence>
224                         <!-- The xfiles factor defines what part of a consolidation interval 
225                              may be made up from *UNKNOWN* data while the consolidated value
226                              is still regarded as known. It is given as the ratio of allowed
227                              *UNKNOWN* PDPs to the number of PDPs in the interval. Thus, it 
228                              ranges from 0 to 1 (exclusive). -->
229                         <xsd:element name="xff" type="ns:LexicalNumberType"/>
230                 </xsd:sequence>
231         </xsd:group>
232         <!-- End of Groups for the element params. -->
233         <!-- End of groups -->
234         
235         <!-- Start of simpleTypes -->
236         <!-- Allowed data source types. -->
237         <!-- @see http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html-->
238         <xsd:simpleType name="DataSourceType">
239                 <xsd:restriction base="xsd:string">
240                         <xsd:enumeration value="GAUGE"/>
241                         <xsd:enumeration value="COUNTER"/>
242                         <xsd:enumeration value="DERIVE"/>
243                         <xsd:enumeration value="ABSOLUTE"/>
244                         <xsd:enumeration value="COMPUTE"/>
245                 </xsd:restriction>
246         </xsd:simpleType>
247         
248         <!-- A ds-name must be 1 to 19 characters long in the characters [a-zA-Z0-9_]. -->
249         <!-- @see http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html-->
250         <xsd:simpleType name="DataSourceNameType">
251                 <xsd:restriction base="xsd:string">
252                         <xsd:pattern value="[a-zA-Z0-9_]{1,19}"/>
253                 </xsd:restriction>
254         </xsd:simpleType>
256         <!-- Allowed consolidation function (cf). -->
257         <!-- @see http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html-->
258         <xsd:simpleType name="ConsolidationFunctionType">
259                 <xsd:restriction base="xsd:string">
260                         <xsd:enumeration value="AVERAGE"/>
261                         <xsd:enumeration value="MIN"/>
262                         <xsd:enumeration value="MAX"/>
263                         <xsd:enumeration value="LAST"/>
264                 </xsd:restriction>
265         </xsd:simpleType>
266         
267         <!-- Allowed a lexical number or the string "NaN".-->
268         <xsd:simpleType name="LexicalNumberWithNaNType">
269                 <xsd:restriction base="xsd:string">
270                         <xsd:pattern value="([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?|NaN)"/>
271                 </xsd:restriction>
272         </xsd:simpleType>
274         <!-- Allowed only a lexical number. -->
275         <xsd:simpleType name="LexicalNumberType">
276                 <xsd:restriction base="xsd:string">
277                         <xsd:pattern value="[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?"/>
278                 </xsd:restriction>
279         </xsd:simpleType>
280         
281         <!-- Allowed a number or the string "UNKN"  or "U". -->
282         <xsd:simpleType name="NumberWithUNKNType">
283                 <xsd:restriction base="xsd:string">
284                         <xsd:pattern value="([\d]+|UNKN|U)"/>
285                 </xsd:restriction>
286         </xsd:simpleType>
287         <!-- End of simpleTypes -->
288 </xsd:schema>