<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">

  <xs:annotation>
    <xs:documentation>
      statistical report configuration schema for bcfg2
      Joey Hagedorn, Argonne National Laboratory
    </xs:documentation>
  </xs:annotation>

  <xs:element name="Reports">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Report">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="1" maxOccurs="unbounded" name="Delivery">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="1" maxOccurs="unbounded" name="Destination">
                      <xs:complexType>
                        <xs:attribute name="address" type="xs:string" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="mechanism" use="required">
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:enumeration value="mail"/>
                        <xs:enumeration value="rss"/>
                        <xs:enumeration value="www"/>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:attribute>
                  <xs:attribute name="type" use="optional">
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:enumeration value="nodes-individual"/>
                        <xs:enumeration value="nodes-digest"/>
                        <xs:enumeration value="overview-stats"/>
                        <xs:enumeration value="timing-summary"/>
                      </xs:restriction>
                    </xs:simpleType>
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="1" maxOccurs="unbounded" name="Machine">
                <xs:complexType>
                  <xs:attribute name="name" type="xs:string" use="required" />
                  <!-- this can be a regular expression defined at http://docs.python.org/lib/re-syntax.html-->
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required" />
            <xs:attribute name="good" type="xs:string" use="optional" />
            <xs:attribute name="modified" type="xs:string" use="optional" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
