<commit_before><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
           xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
           jaxb:version="2.1" jaxb:extensionBindingPrefixes="xjc">

  <xs:annotation>
    <xs:appinfo>
      <jaxb:globalBindings generateIsSetMethod="true"/>
    </xs:appinfo>
  </xs:annotation>

  <!-- Links -->

  <xs:element name="link" type="Link"/>

  <xs:complexType name="Link">
    <xs:sequence/>
    <xs:attribute name="href" type="xs:string"/>
    <xs:attribute name="rel" type="xs:string"/>
  </xs:complexType>

  <!-- API -->

  <xs:element name="api" type="API"/>

  <xs:complexType name="API">
    <xs:sequence>
      <xs:element ref="link" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="Links"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <!-- Faults -->

  <xs:element name="fault" type="Fault"/>

  <xs:complexType name="Fault">
    <xs:sequence>
      <xs:element name="reason" type="xs:string"/>
      <xs:element name="detail" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Actions -->

  <xs:complexType name="GracePeriod">
    <xs:sequence>
      <xs:element name="expiry" type="xs:long"/>
      <xs:element name="absolute" type="xs:boolean" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="IscsiParameters">
    <xs:sequence>
      <xs:group ref="IscsiTarget"/>
    </xs:sequence>
  </xs:complexType>

  <xs:group name="ActionParameterGroup">
    <xs:sequence>
      <xs:element name="grace_period" type="GracePeriod" minOccurs="0"/>
      <!-- for StorageDomain teardown and VM migrate actions -->
      <xs:element name="host" type="Host" minOccurs="0"/>
      <!-- for host NIC attach action -->
      <xs:element name="network" type="Network" minOccurs="0"/>
      <!-- when installing a host, a root password is required -->
      <xs:element name="root_password" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <!-- for VM ticket actions -->
      <xs:element name="ticket" type="Ticket" minOccurs="0"/>
      <!-- for Host ISCSI actions -->
      <xs:element name="iscsi" type="IscsiParameters" minOccurs="0"/>
      <!-- ... etc., explicitly enumerate all the parameter types -->
    </xs:sequence>
  </xs:group>

  <xs:group name="ActionResponseGroup">
    <xs:sequence>
      <!-- for Host ISCSI discovery action -->
      <xs:element name="iscsi_target" type="xs:string" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="IscsiTargets"/>
          </xs:appinfo>
        </xs:annotation>
      <!-- ... etc., explicitly enumerate all the response types -->
      </xs:element>
    </xs:sequence>
  </xs:group>

  <!-- Represents a potentially asynchronous operation -->
  <!-- Use an anonymous complex type as opposed to an instance of a defined
       type, to force JAXB to decorate generated class with @XmlRootElement -->
  <xs:element name="action">
    <xs:complexType>
      <xs:sequence>
       <!-- The following are used by the client
            when initiating an operation -->
          <xs:element name="async" type="xs:boolean" minOccurs="0"/>
          <!-- action-specific parameter(s) for the operation (if required) -->
          <xs:group ref="ActionParameterGroup"/>

        <!-- The following, and the href/id attributes are used by the
             server when responding to an operation or status query -->
          <xs:element name="status" type="Status" minOccurs="0"/>
          <!-- Link to original action (rel="replay") or parent resource (rel="parent") -->
          <xs:element ref="link" minOccurs="1" maxOccurs="unbounded"/>
          <!-- Fault describing failure case -->
          <xs:element ref="fault" minOccurs="0" maxOccurs="1"/>
          <!-- action-specific response(s) for the operation (if required) -->
          <xs:group ref="ActionResponseGroup"/>
      </xs:sequence>
      <xs:attribute name="href" type="xs:string"/>
      <xs:attribute name="id" type="xs:string"/>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="Status">
    <xs:restriction base="xs:string">
      <xs:enumeration value="PENDING"/>
      <xs:enumeration value="IN_PROGRESS"/>
      <xs:enumeration value="COMPLETE"/>
      <xs:enumeration value="FAILED"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="Actions">
    <xs:sequence>
      <xs:annotation>
        <xs:appinfo>
            <jaxb:property name="Links"/>
        </xs:appinfo>
      </xs:annotation>
      <xs:element ref="link" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Enums -->

  <xs:simpleType name="BootDevice">
    <xs:restriction base="xs:string">
      <xs:enumeration value="cdrom"/>
      <xs:enumeration value="hd"/>
      <xs:enumeration value="network"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DiskType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="DATA"/>
      <xs:enumeration value="SHARED"/>
      <xs:enumeration value="SWAP"/>
      <xs:enumeration value="SYSTEM"/>
      <xs:enumeration value="TEMP"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DiskFormat">
    <xs:restriction base="xs:string">
      <xs:enumeration value="COW"/>
      <xs:enumeration value="RAW"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DiskInterface">
    <xs:restriction base="xs:string">
      <xs:enumeration value="IDE"/>
      <xs:enumeration value="SCSI"/>
      <xs:enumeration value="VIRTIO"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DiskStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ILLEGAL"/>
      <xs:enumeration value="INVALID"/>
      <xs:enumeration value="LOCKED"/>
      <xs:enumeration value="OK"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="HostStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="DOWN"/>
      <xs:enumeration value="ERROR"/>
      <xs:enumeration value="INITIALIZING"/>
      <xs:enumeration value="INSTALLING"/>
      <xs:enumeration value="INSTALL_FAILED"/>
      <xs:enumeration value="MAINTENANCE"/>
      <xs:enumeration value="NON_OPERATIONAL"/>
      <xs:enumeration value="NON_RESPONSIVE"/>
      <xs:enumeration value="PENDING_APPROVAL"/>
      <xs:enumeration value="PREPARING_FOR_MAINTENANCE"/>
      <xs:enumeration value="PROBLEMATIC"/>
      <xs:enumeration value="REBOOT"/>
      <xs:enumeration value="UNASSIGNED"/>
      <xs:enumeration value="UP"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="NicType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="E1000"/>
      <xs:enumeration value="PV"/>
      <xs:enumeration value="RTL8139"/>
      <xs:enumeration value="RTL8139_PV"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="NetworkStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="OPERATIONAL"/>
      <xs:enumeration value="NON_OPERATIONAL"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StorageDomainType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="DATA"/>
      <xs:enumeration value="ISO"/>
      <xs:enumeration value="EXPORT"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StorageDomainStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ACTIVE"/>
      <xs:enumeration value="INACTIVE"/>
      <xs:enumeration value="LOCKED"/>
      <xs:enumeration value="MIXED"/>
      <xs:enumeration value="UNATTACHED"/>
      <xs:enumeration value="TORNDOWN"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StorageType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ISCSI"/>
      <xs:enumeration value="FCP"/>
      <xs:enumeration value="NFS"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TemplateStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ILLEGAL"/>
      <xs:enumeration value="LOCKED"/>
      <xs:enumeration value="OK"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="VmType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="DESKTOP"/>
      <xs:enumeration value="SERVER"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="VmStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="UNASSIGNED"/>
      <xs:enumeration value="DOWN"/>
      <xs:enumeration value="UP"/>
      <xs:enumeration value="POWERING_UP"/>
      <xs:enumeration value="POWERED_DOWN"/>
      <xs:enumeration value="PAUSED"/>
      <xs:enumeration value="MIGRATING_FROM"/>
      <xs:enumeration value="MIGRATING_TO"/>
      <xs:enumeration value="UNKNOWN"/>
      <xs:enumeration value="NOT_RESPONDING"/>
      <xs:enumeration value="WAIT_FOR_LAUNCH"/>
      <xs:enumeration value="REBOOT_IN_PROGRESS"/>
      <xs:enumeration value="SAVING_STATE"/>
      <xs:enumeration value="RESTORING_STATE"/>
      <xs:enumeration value="SUSPENDED"/>
      <xs:enumeration value="IMAGE_ILLEGAL"/>
      <xs:enumeration value="IMAGE_LOCKED"/>
      <xs:enumeration value="POWERING_DOWN"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DataCenterStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="UNINITIALIZED"/>
      <xs:enumeration value="UP"/>
      <xs:enumeration value="MAINTENANCE"/>
      <xs:enumeration value="NOT_OPERATIONAL"/>
      <xs:enumeration value="PROBLEMATIC"/>
      <xs:enumeration value="CONTEND"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- CPUs -->

  <xs:element name="cpu" type="CPU"/>

  <xs:complexType name="CpuTopology">
    <xs:attribute name="sockets" type="xs:int"/>
    <xs:attribute name="cores" type="xs:int"/>
  </xs:complexType>

  <xs:complexType name="CPU">
    <xs:sequence>
      <xs:element name="topology" type="CpuTopology" minOccurs="0"/>
      <xs:element name="level" type="xs:int" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <xs:complexType name="CPUs">
    <xs:sequence>
      <xs:annotation>
        <xs:appinfo>
            <jaxb:property name="CPUs"/>
        </xs:appinfo>
      </xs:annotation>
      <xs:element ref="cpu" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Version numbers -->

  <xs:complexType name="Version">
    <xs:sequence/>
    <xs:attribute name="major" type="xs:unsignedShort"/>
    <xs:attribute name="minor" type="xs:unsignedShort"/>
  </xs:complexType>

  <xs:complexType name="SupportedVersions">
    <xs:sequence>
      <xs:element name="version" type="Version" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="Versions"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <!-- Capabilities -->

  <xs:element name="capabilities" type="Capabilities"/>

  <xs:complexType name="VersionCaps">
    <xs:complexContent>
      <xs:extension base="Version">
        <xs:sequence>
          <xs:element name="current" type="xs:boolean" minOccurs="0"/>
          <xs:element name="cpus" type="CPUs" minOccurs="0">
            <xs:annotation>
              <xs:appinfo>
                <jaxb:property name="CPUs"/>
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Capabilities">
    <xs:sequence>
      <xs:element name="version" type="VersionCaps" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="Versions"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <!-- Common to all resources -->

  <xs:complexType name="BaseResource">
    <xs:sequence>
      <xs:element name="name" type="xs:string" minOccurs="0"/>
      <xs:element name="description" type="xs:string" minOccurs="0"/>
      <xs:element name="actions" type="Actions" minOccurs="0"/>
      <!-- link relation types may be defined by specific resources -->
      <xs:element ref="link" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="Links"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="href" type="xs:string"/>
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <xs:complexType name="BaseResources">
    <xs:sequence>
      <xs:element name="total" type="xs:unsignedInt" minOccurs="0"/>
      <xs:element name="active" type="xs:unsignedInt" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Attachments, representing a Storage Domain attached to a Data Center -->

  <xs:element name="attachment" type="Attachment"/>

  <xs:element name="attachments" type="Attachments"/>

  <xs:complexType name="Attachment">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="data_center" type="DataCenter"/>
          <xs:element name="storage_domain" type="StorageDomain" minOccurs="0"/>
          <xs:element name="status" type="StorageDomainStatus" minOccurs="0"/>
          <xs:element name="master" type="xs:boolean" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Attachments">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Attachments"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="attachment" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Data Centers -->

  <xs:element name="data_center" type="DataCenter"/>

  <xs:element name="data_centers" type="DataCenters"/>

  <xs:complexType name="DataCenter">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="storage_type" type="StorageType" minOccurs="0"/>
          <xs:element name="version" type="Version" minOccurs="0"/>
          <xs:element name="supported_versions" type="SupportedVersions" minOccurs="0"/>
          <xs:element name="attachments" type="Attachments" minOccurs="0"/>
          <xs:element name="status" type="DataCenterStatus" minOccurs="0"/>
          <!-- also a rel="isos" link, see Isos above -->
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="DataCenters">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="DataCenters"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="data_center" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Clusters -->

  <xs:element name="cluster" type="Cluster"/>

  <xs:element name="clusters" type="Clusters"/>

  <xs:complexType name="Cluster">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="cpu" minOccurs="0" maxOccurs="1"/>
          <xs:element ref="data_center" minOccurs="0" maxOccurs="1"/>
          <xs:element name="version" type="Version" minOccurs="0"/>
          <xs:element name="supported_versions" type="SupportedVersions" minOccurs="0"/>
          <!-- Also a rel="networks" link -->
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Clusters">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
              <jaxb:property name="Clusters"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="cluster" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Hosts -->

  <xs:element name="host" type="Host"/>

  <xs:element name="hosts" type="Hosts"/>

  <xs:complexType name="Host">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="address" type="xs:string" minOccurs="0"/>
          <xs:element name="status" type="HostStatus" minOccurs="0"/>
          <xs:element name="cluster" type="Cluster" minOccurs="0"/>
          <!-- unsigned to avoid issues with port values greater than 32767,
               e.g. the standard VDSM port 54321 -->
          <xs:element name="port" type="xs:unsignedShort" minOccurs="0"/>
          <xs:element name="version" type="Version" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Hosts">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Hosts"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="host" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Users & Roles -->

  <xs:element name="role" type="Role"/>

  <xs:element name="roles" type="Roles"/>

  <xs:complexType name="Role">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="user" type="User" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Roles">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Roles"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="role" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="user" type="User"/>

  <xs:element name="users" type="Users"/>

  <xs:complexType name="User">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="domain" type="xs:string" minOccurs="0" maxOccurs="1"/>
          <xs:element name="department" type="xs:string" minOccurs="0" maxOccurs="1"/>
          <xs:element name="logged_in" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
          <xs:element name="last_name" type="xs:string" minOccurs="0" maxOccurs="1"/>
          <!-- generally name@domain -->
          <xs:element name="user_name" type="xs:string" minOccurs="0" maxOccurs="1"/>
          <xs:element name="email" type="xs:string" minOccurs="0" maxOccurs="1"/>
          <!-- used only to represent the initial role assignments for a
               new user, therafter modification of role assignments are
               only supported via the rel="roles" sub-collection -->
          <xs:element name="roles" type="Roles" minOccurs="0" maxOccurs="1"/>
          <xs:element name="groups" minOccurs="0">
            <xs:complexType>
              <xs:sequence>
                <xs:annotation>
                  <xs:appinfo>
                    <jaxb:property name="Groups"/>
                  </xs:appinfo>
                </xs:annotation>
                <xs:element name="group" type="xs:string" maxOccurs="unbounded"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Users">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Users"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="user" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- ISOs -->

  <xs:element name="iso" type="Iso"/>

  <xs:element name="isos" type="Isos"/>

  <xs:complexType name="Iso">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="data_center" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Isos">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Isos"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="iso" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Networks -->

  <xs:element name="ip" type="IP"/>

  <xs:complexType name="IP">
    <xs:attribute name="address" type="xs:string"/>
    <xs:attribute name="netmask" type="xs:string"/>
    <xs:attribute name="gateway" type="xs:string"/>
  </xs:complexType>

  <xs:element name="mac" type="MAC"/>

  <xs:complexType name="MAC">
    <xs:attribute name="address" type="xs:string"/>
  </xs:complexType>

  <xs:element name="vlan" type="VLAN"/>

  <xs:complexType name="VLAN">
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <xs:element name="network" type="Network"/>

  <xs:element name="networks" type="Networks"/>

  <xs:complexType name="Network">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="data_center" minOccurs="0"/>
          <xs:element ref="cluster" minOccurs="0"/>
          <xs:element ref="ip" minOccurs="0"/>
          <xs:element ref="vlan" minOccurs="0"/>
          <xs:element name="stp" type="xs:boolean" minOccurs="0"/>
          <xs:element name="status" type="NetworkStatus" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Networks">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Networks"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="network" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Storage Domains -->

  <xs:element name="storage_domain" type="StorageDomain"/>

  <xs:element name="storage_domains" type="StorageDomains"/>

  <xs:group name="NfsStorage">
    <xs:sequence>
      <xs:element name="address" type="xs:string"/>
      <xs:element name="path" type="xs:string"/>
    </xs:sequence>
  </xs:group>

  <xs:group name="IscsiTarget">
    <xs:sequence>
      <xs:element name="address" type="xs:string"/>
      <xs:element name="port" type="xs:unsignedShort"/>
      <xs:element name="target" type="xs:string"/>
      <xs:element name="username" type="xs:string"/>
      <xs:element name="password" type="xs:string"/>
    </xs:sequence>
  </xs:group>

  <xs:element name="logical_unit" type="LogicalUnit"/>

  <xs:complexType name="LogicalUnit">
    <xs:sequence>
      <xs:group ref="IscsiTarget"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <xs:element name="volume_group" type="VolumeGroup"/>

  <xs:complexType name="VolumeGroup">
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element ref="logical_unit" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="LogicalUnits"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <xs:group name="IscsiStorage">
    <xs:sequence>
      <xs:element ref="logical_unit" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="LogicalUnits"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
      <xs:element ref="volume_group" minOccurs="0"/>
    </xs:sequence>
  </xs:group>

  <xs:element name="storage" type="Storage"/>

  <xs:complexType name="Storage">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="type" type="StorageType" minOccurs="1" maxOccurs="1"/>
          <xs:choice>
            <xs:group ref="NfsStorage"/>
            <xs:group ref="IscsiStorage"/>
          </xs:choice>
          <xs:element ref="host" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="StorageDomain">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="type" type="StorageDomainType" minOccurs="0"/>
          <xs:element name="status" type="StorageDomainStatus" minOccurs="0"/>
          <xs:element name="master" type="xs:boolean" minOccurs="0"/>
          <xs:element ref="storage" minOccurs="0"/>
          <!-- also a rel="attachments" link, see Attachments above -->
          <!-- host is only relevant at creation time -->
          <xs:element ref="host" minOccurs="0"/>
          <xs:element name="available" type="xs:unsignedInt" minOccurs="0"/>
          <xs:element name="used" type="xs:unsignedInt" minOccurs="0"/>
          <xs:element name="committed" type="xs:unsignedInt" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="StorageDomains">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="StorageDomains"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="storage_domain" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Virtual Machine Templates -->

  <xs:element name="templates" type="Templates"/>

  <xs:element name="template">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="BaseResource">
          <xs:sequence>
            <xs:element ref="vm" minOccurs="0" maxOccurs="1"/>
            <xs:element name="type" type="VmType" minOccurs="0"/>
            <xs:element name="status" type="TemplateStatus" minOccurs="0"/>
            <xs:element name="memory" type="xs:long" minOccurs="0"/>
            <xs:element name="cpu" type="CPU" minOccurs="0"/>
            <xs:element name="os" type="OperatingSystem" minOccurs="0"/>
            <xs:element ref="cluster" minOccurs="0" maxOccurs="1"/>
            <!-- also rel="cdroms/disks/nics" links, see Devices below -->
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="Templates">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Templates"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="template" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Virtual Machines -->

  <xs:complexType name="OperatingSystem">
    <xs:sequence>
      <xs:element name="boot" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:attribute name="dev" type="BootDevice"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="kernel" type="xs:string" minOccurs="0"/>
      <xs:element name="initrd" type="xs:string" minOccurs="0"/>
      <xs:element name="cmdline" type="xs:string" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="DisplayType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="VNC"/>
      <xs:enumeration value="SPICE"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="Display">
    <xs:sequence>
      <xs:element name="type" type="DisplayType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="port" type="xs:unsignedShort" minOccurs="0" maxOccurs="1"/>
      <xs:element name="monitors" type="xs:int" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="Ticket">
    <xs:sequence>
      <xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="expiry" type="xs:unsignedInt" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="MemoryStatistics">
    <xs:sequence>
      <xs:element name="size" type="xs:unsignedInt" minOccurs="0" maxOccurs="1"/>
      <xs:element name="utilization" type="xs:unsignedInt" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="CpuStatistics">
    <xs:sequence>
      <xs:element name="user" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
      <xs:element name="system" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
      <xs:element name="idle" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
      <xs:element name="load" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="vms" type="VMs"/>

  <xs:element name="vm">
    <xs:annotation>
      <xs:appinfo>
         <jaxb:class name="VM"/>
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="BaseResource">
          <xs:sequence>
            <xs:element name="type" type="VmType" minOccurs="0"/>
            <xs:element name="status" type="VmStatus" minOccurs="0"/>
            <xs:element name="memory" type="xs:long" minOccurs="0"/>
            <xs:element name="cpu" type="CPU" minOccurs="0"/>
            <xs:element name="os" type="OperatingSystem" minOccurs="0"/>
            <xs:element name="display" type="Display" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="host" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="cluster" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="template" minOccurs="0" maxOccurs="1"/>

            <xs:element name="memory_statistics" type="MemoryStatistics" minOccurs="0" maxOccurs="1">
              <xs:annotation>
                <xs:appinfo>
                  <jaxb:property name="MemoryStatistics"/>
                </xs:appinfo>
              </xs:annotation>
            </xs:element>

            <xs:element name="cpu_statistics" type="CpuStatistics" minOccurs="0" maxOccurs="1">
              <xs:annotation>
                <xs:appinfo>
                  <jaxb:property name="CpuStatistics"/>
                </xs:appinfo>
              </xs:annotation>
            </xs:element>

            <xs:element ref="vmpool" minOccurs="0" maxOccurs="1">
              <xs:annotation>
                <xs:appinfo>
                  <jaxb:property name="VmPool"/>
                </xs:appinfo>
              </xs:annotation>
            </xs:element>
            <!-- also rel="cdroms/disks/nics" links, see Devices below -->
            <!-- also rel="snapshots" links, see Snapshots below -->
            <!-- also rel="users" links, see Users above -->
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="VMs">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="VMs"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="vm" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Virtual Machine Pools -->

  <xs:element name="vmpool" type="VmPool"/>

  <xs:element name="vmpools" type="VmPools"/>

  <xs:complexType name="VmPool">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="size" type="xs:int" minOccurs="0"/>
          <xs:element ref="cluster" minOccurs="0" maxOccurs="1"/>
          <xs:element ref="template" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="VmPools">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="VmPools"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="vmpool" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Devices -->

  <xs:complexType name="BaseDevice">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="vm" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="BaseDevices">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="cdrom" type="CdRom"/>

  <xs:element name="cdroms" type="CdRoms"/>

  <xs:element name="disk" type="Disk"/>

  <xs:element name="disks" type="Disks"/>

  <xs:element name="nic" type="NIC"/>

  <xs:element name="nics" type="Nics"/>

  <xs:complexType name="CdRom">
    <xs:complexContent>
      <xs:extension base="BaseDevice">
        <xs:sequence>
          <xs:element ref="iso"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="CdRoms">
    <xs:complexContent>
      <xs:extension base="BaseDevices">
        <xs:sequence>
          <xs:element ref="cdrom" maxOccurs="unbounded">
            <xs:annotation>
              <xs:appinfo>
                <jaxb:property name="CdRoms"/>
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Disk">
    <xs:complexContent>
      <xs:extension base="BaseDevice">
        <xs:sequence>
          <xs:element ref="storage_domain" minOccurs="0" maxOccurs="1"/>
          <xs:element name="size" type="xs:long" minOccurs="0"/>
          <xs:element name="type" type="DiskType" minOccurs="0"/>
          <xs:element name="status" type="DiskStatus" minOccurs="0"/>
          <xs:element name="interface" type="DiskInterface" minOccurs="0"/>
          <xs:element name="format" type="DiskFormat" minOccurs="0"/>
          <xs:element name="sparse" type="xs:boolean" minOccurs="0"/>
          <xs:element name="bootable" type="xs:boolean" minOccurs="0"/>
          <xs:element name="wipe_after_delete" type="xs:boolean" minOccurs="0"/>
          <xs:element name="propagate_errors" type="xs:boolean" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Disks">
    <xs:complexContent>
      <xs:extension base="BaseDevices">
        <xs:sequence>
          <xs:element ref="disk" maxOccurs="unbounded">
            <xs:annotation>
              <xs:appinfo>
                <jaxb:property name="Disks"/>
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NIC">
    <xs:complexContent>
      <xs:extension base="BaseDevice">
        <xs:sequence>
          <xs:element ref="network" minOccurs="0" maxOccurs="1"/>
          <xs:element name="type" type="NicType" minOccurs="0"/>
          <xs:element ref="mac" minOccurs="0"/>
          <xs:element ref="ip" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Nics">
    <xs:complexContent>
      <xs:extension base="BaseDevices">
        <xs:sequence>
          <xs:element ref="nic" maxOccurs="unbounded">
            <xs:annotation>
              <xs:appinfo>
                <jaxb:property name="Nics"/>
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Snapshots -->

  <xs:element name="snapshot" type="Snapshot"/>

  <xs:element name="snapshots" type="Snapshots"/>

  <xs:complexType name="Snapshot">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="vm" minOccurs="0"/>
          <!-- REVISIT: should be xs:dateTime (https://fedorahosted.org/rhevm-api/ticket/65) -->
          <xs:element name="date" type="xs:string" minOccurs="0"/>
          <!-- Also a rel="prev" link -->
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Snapshots">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Snapshots"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="snapshot" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Host NICs -->

  <xs:element name="host_nic" type="HostNIC"/>

  <xs:element name="host_nics" type="HostNics"/>

  <xs:complexType name="HostNIC">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="host" minOccurs="0" maxOccurs="1"/>
          <xs:element ref="network" minOccurs="0" maxOccurs="1"/>
          <xs:element ref="mac" minOccurs="0"/>
          <xs:element ref="ip" minOccurs="0"/>
          <xs:element ref="vlan" minOccurs="0"/>
          <xs:element ref="slaves" minOccurs="0"/>
          <!-- Also a rel="master" link for bonded nics -->
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="HostNics">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:element ref="host_nic" maxOccurs="unbounded">
            <xs:annotation>
              <xs:appinfo>
                <jaxb:property name="HostNics"/>
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="slaves" type="Slaves"/>

  <xs:complexType name="Slaves">
    <xs:sequence>
      <xs:element ref="host_nic" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="Slaves"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <!-- Host Storage -->

  <xs:element name="host_storage" type="HostStorage"/>

  <xs:complexType name="HostStorage">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:element ref="storage" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Tags -->

  <xs:element name="tag" type="Tag"/>

  <xs:element name="tags" type="Tags"/>

  <xs:complexType name="Tag">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="host" minOccurs="0"/>
          <xs:element ref="vm" minOccurs="0"/>
          <xs:element ref="user" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Tags">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Tags"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="tag" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

</xs:schema>
<commit_msg>api: add <summary/> element under <api/><commit_after><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
           xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
           jaxb:version="2.1" jaxb:extensionBindingPrefixes="xjc">

  <xs:annotation>
    <xs:appinfo>
      <jaxb:globalBindings generateIsSetMethod="true"/>
    </xs:appinfo>
  </xs:annotation>

  <!-- Links -->

  <xs:element name="link" type="Link"/>

  <xs:complexType name="Link">
    <xs:sequence/>
    <xs:attribute name="href" type="xs:string"/>
    <xs:attribute name="rel" type="xs:string"/>
  </xs:complexType>

  <!-- API -->

  <xs:element name="api" type="API"/>

  <xs:complexType name="API">
    <xs:sequence>
      <xs:element ref="link" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="Links"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
      <xs:element ref="summary"/>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="summary" type="ApiSummary"/>

  <xs:complexType name="ApiSummary">
    <xs:sequence>
      <xs:element ref="vms" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="VMs"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
      <xs:element ref="hosts" minOccurs="0" maxOccurs="1"/>
      <xs:element ref="users" minOccurs="0" maxOccurs="1"/>
      <xs:element ref="storage_domains" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Faults -->

  <xs:element name="fault" type="Fault"/>

  <xs:complexType name="Fault">
    <xs:sequence>
      <xs:element name="reason" type="xs:string"/>
      <xs:element name="detail" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Actions -->

  <xs:complexType name="GracePeriod">
    <xs:sequence>
      <xs:element name="expiry" type="xs:long"/>
      <xs:element name="absolute" type="xs:boolean" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="IscsiParameters">
    <xs:sequence>
      <xs:group ref="IscsiTarget"/>
    </xs:sequence>
  </xs:complexType>

  <xs:group name="ActionParameterGroup">
    <xs:sequence>
      <xs:element name="grace_period" type="GracePeriod" minOccurs="0"/>
      <!-- for StorageDomain teardown and VM migrate actions -->
      <xs:element name="host" type="Host" minOccurs="0"/>
      <!-- for host NIC attach action -->
      <xs:element name="network" type="Network" minOccurs="0"/>
      <!-- when installing a host, a root password is required -->
      <xs:element name="root_password" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <!-- for VM ticket actions -->
      <xs:element name="ticket" type="Ticket" minOccurs="0"/>
      <!-- for Host ISCSI actions -->
      <xs:element name="iscsi" type="IscsiParameters" minOccurs="0"/>
      <!-- ... etc., explicitly enumerate all the parameter types -->
    </xs:sequence>
  </xs:group>

  <xs:group name="ActionResponseGroup">
    <xs:sequence>
      <!-- for Host ISCSI discovery action -->
      <xs:element name="iscsi_target" type="xs:string" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="IscsiTargets"/>
          </xs:appinfo>
        </xs:annotation>
      <!-- ... etc., explicitly enumerate all the response types -->
      </xs:element>
    </xs:sequence>
  </xs:group>

  <!-- Represents a potentially asynchronous operation -->
  <!-- Use an anonymous complex type as opposed to an instance of a defined
       type, to force JAXB to decorate generated class with @XmlRootElement -->
  <xs:element name="action">
    <xs:complexType>
      <xs:sequence>
       <!-- The following are used by the client
            when initiating an operation -->
          <xs:element name="async" type="xs:boolean" minOccurs="0"/>
          <!-- action-specific parameter(s) for the operation (if required) -->
          <xs:group ref="ActionParameterGroup"/>

        <!-- The following, and the href/id attributes are used by the
             server when responding to an operation or status query -->
          <xs:element name="status" type="Status" minOccurs="0"/>
          <!-- Link to original action (rel="replay") or parent resource (rel="parent") -->
          <xs:element ref="link" minOccurs="1" maxOccurs="unbounded"/>
          <!-- Fault describing failure case -->
          <xs:element ref="fault" minOccurs="0" maxOccurs="1"/>
          <!-- action-specific response(s) for the operation (if required) -->
          <xs:group ref="ActionResponseGroup"/>
      </xs:sequence>
      <xs:attribute name="href" type="xs:string"/>
      <xs:attribute name="id" type="xs:string"/>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="Status">
    <xs:restriction base="xs:string">
      <xs:enumeration value="PENDING"/>
      <xs:enumeration value="IN_PROGRESS"/>
      <xs:enumeration value="COMPLETE"/>
      <xs:enumeration value="FAILED"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="Actions">
    <xs:sequence>
      <xs:annotation>
        <xs:appinfo>
            <jaxb:property name="Links"/>
        </xs:appinfo>
      </xs:annotation>
      <xs:element ref="link" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Enums -->

  <xs:simpleType name="BootDevice">
    <xs:restriction base="xs:string">
      <xs:enumeration value="cdrom"/>
      <xs:enumeration value="hd"/>
      <xs:enumeration value="network"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DiskType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="DATA"/>
      <xs:enumeration value="SHARED"/>
      <xs:enumeration value="SWAP"/>
      <xs:enumeration value="SYSTEM"/>
      <xs:enumeration value="TEMP"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DiskFormat">
    <xs:restriction base="xs:string">
      <xs:enumeration value="COW"/>
      <xs:enumeration value="RAW"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DiskInterface">
    <xs:restriction base="xs:string">
      <xs:enumeration value="IDE"/>
      <xs:enumeration value="SCSI"/>
      <xs:enumeration value="VIRTIO"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DiskStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ILLEGAL"/>
      <xs:enumeration value="INVALID"/>
      <xs:enumeration value="LOCKED"/>
      <xs:enumeration value="OK"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="HostStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="DOWN"/>
      <xs:enumeration value="ERROR"/>
      <xs:enumeration value="INITIALIZING"/>
      <xs:enumeration value="INSTALLING"/>
      <xs:enumeration value="INSTALL_FAILED"/>
      <xs:enumeration value="MAINTENANCE"/>
      <xs:enumeration value="NON_OPERATIONAL"/>
      <xs:enumeration value="NON_RESPONSIVE"/>
      <xs:enumeration value="PENDING_APPROVAL"/>
      <xs:enumeration value="PREPARING_FOR_MAINTENANCE"/>
      <xs:enumeration value="PROBLEMATIC"/>
      <xs:enumeration value="REBOOT"/>
      <xs:enumeration value="UNASSIGNED"/>
      <xs:enumeration value="UP"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="NicType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="E1000"/>
      <xs:enumeration value="PV"/>
      <xs:enumeration value="RTL8139"/>
      <xs:enumeration value="RTL8139_PV"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="NetworkStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="OPERATIONAL"/>
      <xs:enumeration value="NON_OPERATIONAL"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StorageDomainType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="DATA"/>
      <xs:enumeration value="ISO"/>
      <xs:enumeration value="EXPORT"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StorageDomainStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ACTIVE"/>
      <xs:enumeration value="INACTIVE"/>
      <xs:enumeration value="LOCKED"/>
      <xs:enumeration value="MIXED"/>
      <xs:enumeration value="UNATTACHED"/>
      <xs:enumeration value="TORNDOWN"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="StorageType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ISCSI"/>
      <xs:enumeration value="FCP"/>
      <xs:enumeration value="NFS"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="TemplateStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="ILLEGAL"/>
      <xs:enumeration value="LOCKED"/>
      <xs:enumeration value="OK"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="VmType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="DESKTOP"/>
      <xs:enumeration value="SERVER"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="VmStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="UNASSIGNED"/>
      <xs:enumeration value="DOWN"/>
      <xs:enumeration value="UP"/>
      <xs:enumeration value="POWERING_UP"/>
      <xs:enumeration value="POWERED_DOWN"/>
      <xs:enumeration value="PAUSED"/>
      <xs:enumeration value="MIGRATING_FROM"/>
      <xs:enumeration value="MIGRATING_TO"/>
      <xs:enumeration value="UNKNOWN"/>
      <xs:enumeration value="NOT_RESPONDING"/>
      <xs:enumeration value="WAIT_FOR_LAUNCH"/>
      <xs:enumeration value="REBOOT_IN_PROGRESS"/>
      <xs:enumeration value="SAVING_STATE"/>
      <xs:enumeration value="RESTORING_STATE"/>
      <xs:enumeration value="SUSPENDED"/>
      <xs:enumeration value="IMAGE_ILLEGAL"/>
      <xs:enumeration value="IMAGE_LOCKED"/>
      <xs:enumeration value="POWERING_DOWN"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="DataCenterStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="UNINITIALIZED"/>
      <xs:enumeration value="UP"/>
      <xs:enumeration value="MAINTENANCE"/>
      <xs:enumeration value="NOT_OPERATIONAL"/>
      <xs:enumeration value="PROBLEMATIC"/>
      <xs:enumeration value="CONTEND"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- CPUs -->

  <xs:element name="cpu" type="CPU"/>

  <xs:complexType name="CpuTopology">
    <xs:attribute name="sockets" type="xs:int"/>
    <xs:attribute name="cores" type="xs:int"/>
  </xs:complexType>

  <xs:complexType name="CPU">
    <xs:sequence>
      <xs:element name="topology" type="CpuTopology" minOccurs="0"/>
      <xs:element name="level" type="xs:int" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <xs:complexType name="CPUs">
    <xs:sequence>
      <xs:annotation>
        <xs:appinfo>
            <jaxb:property name="CPUs"/>
        </xs:appinfo>
      </xs:annotation>
      <xs:element ref="cpu" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Version numbers -->

  <xs:complexType name="Version">
    <xs:sequence/>
    <xs:attribute name="major" type="xs:unsignedShort"/>
    <xs:attribute name="minor" type="xs:unsignedShort"/>
  </xs:complexType>

  <xs:complexType name="SupportedVersions">
    <xs:sequence>
      <xs:element name="version" type="Version" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="Versions"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <!-- Capabilities -->

  <xs:element name="capabilities" type="Capabilities"/>

  <xs:complexType name="VersionCaps">
    <xs:complexContent>
      <xs:extension base="Version">
        <xs:sequence>
          <xs:element name="current" type="xs:boolean" minOccurs="0"/>
          <xs:element name="cpus" type="CPUs" minOccurs="0">
            <xs:annotation>
              <xs:appinfo>
                <jaxb:property name="CPUs"/>
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Capabilities">
    <xs:sequence>
      <xs:element name="version" type="VersionCaps" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="Versions"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <!-- Common to all resources -->

  <xs:complexType name="BaseResource">
    <xs:sequence>
      <xs:element name="name" type="xs:string" minOccurs="0"/>
      <xs:element name="description" type="xs:string" minOccurs="0"/>
      <xs:element name="actions" type="Actions" minOccurs="0"/>
      <!-- link relation types may be defined by specific resources -->
      <xs:element ref="link" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="Links"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="href" type="xs:string"/>
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <xs:complexType name="BaseResources">
    <xs:sequence>
      <xs:element name="total" type="xs:unsignedInt" minOccurs="0"/>
      <xs:element name="active" type="xs:unsignedInt" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Attachments, representing a Storage Domain attached to a Data Center -->

  <xs:element name="attachment" type="Attachment"/>

  <xs:element name="attachments" type="Attachments"/>

  <xs:complexType name="Attachment">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="data_center" type="DataCenter"/>
          <xs:element name="storage_domain" type="StorageDomain" minOccurs="0"/>
          <xs:element name="status" type="StorageDomainStatus" minOccurs="0"/>
          <xs:element name="master" type="xs:boolean" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Attachments">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Attachments"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="attachment" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Data Centers -->

  <xs:element name="data_center" type="DataCenter"/>

  <xs:element name="data_centers" type="DataCenters"/>

  <xs:complexType name="DataCenter">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="storage_type" type="StorageType" minOccurs="0"/>
          <xs:element name="version" type="Version" minOccurs="0"/>
          <xs:element name="supported_versions" type="SupportedVersions" minOccurs="0"/>
          <xs:element name="attachments" type="Attachments" minOccurs="0"/>
          <xs:element name="status" type="DataCenterStatus" minOccurs="0"/>
          <!-- also a rel="isos" link, see Isos above -->
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="DataCenters">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="DataCenters"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="data_center" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Clusters -->

  <xs:element name="cluster" type="Cluster"/>

  <xs:element name="clusters" type="Clusters"/>

  <xs:complexType name="Cluster">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="cpu" minOccurs="0" maxOccurs="1"/>
          <xs:element ref="data_center" minOccurs="0" maxOccurs="1"/>
          <xs:element name="version" type="Version" minOccurs="0"/>
          <xs:element name="supported_versions" type="SupportedVersions" minOccurs="0"/>
          <!-- Also a rel="networks" link -->
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Clusters">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
              <jaxb:property name="Clusters"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="cluster" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Hosts -->

  <xs:element name="host" type="Host"/>

  <xs:element name="hosts" type="Hosts"/>

  <xs:complexType name="Host">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="address" type="xs:string" minOccurs="0"/>
          <xs:element name="status" type="HostStatus" minOccurs="0"/>
          <xs:element name="cluster" type="Cluster" minOccurs="0"/>
          <!-- unsigned to avoid issues with port values greater than 32767,
               e.g. the standard VDSM port 54321 -->
          <xs:element name="port" type="xs:unsignedShort" minOccurs="0"/>
          <xs:element name="version" type="Version" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Hosts">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Hosts"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="host" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Users & Roles -->

  <xs:element name="role" type="Role"/>

  <xs:element name="roles" type="Roles"/>

  <xs:complexType name="Role">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="user" type="User" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Roles">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Roles"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="role" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="user" type="User"/>

  <xs:element name="users" type="Users"/>

  <xs:complexType name="User">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="domain" type="xs:string" minOccurs="0" maxOccurs="1"/>
          <xs:element name="department" type="xs:string" minOccurs="0" maxOccurs="1"/>
          <xs:element name="logged_in" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
          <xs:element name="last_name" type="xs:string" minOccurs="0" maxOccurs="1"/>
          <!-- generally name@domain -->
          <xs:element name="user_name" type="xs:string" minOccurs="0" maxOccurs="1"/>
          <xs:element name="email" type="xs:string" minOccurs="0" maxOccurs="1"/>
          <!-- used only to represent the initial role assignments for a
               new user, therafter modification of role assignments are
               only supported via the rel="roles" sub-collection -->
          <xs:element name="roles" type="Roles" minOccurs="0" maxOccurs="1"/>
          <xs:element name="groups" minOccurs="0">
            <xs:complexType>
              <xs:sequence>
                <xs:annotation>
                  <xs:appinfo>
                    <jaxb:property name="Groups"/>
                  </xs:appinfo>
                </xs:annotation>
                <xs:element name="group" type="xs:string" maxOccurs="unbounded"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Users">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Users"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="user" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- ISOs -->

  <xs:element name="iso" type="Iso"/>

  <xs:element name="isos" type="Isos"/>

  <xs:complexType name="Iso">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="data_center" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Isos">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Isos"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="iso" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Networks -->

  <xs:element name="ip" type="IP"/>

  <xs:complexType name="IP">
    <xs:attribute name="address" type="xs:string"/>
    <xs:attribute name="netmask" type="xs:string"/>
    <xs:attribute name="gateway" type="xs:string"/>
  </xs:complexType>

  <xs:element name="mac" type="MAC"/>

  <xs:complexType name="MAC">
    <xs:attribute name="address" type="xs:string"/>
  </xs:complexType>

  <xs:element name="vlan" type="VLAN"/>

  <xs:complexType name="VLAN">
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <xs:element name="network" type="Network"/>

  <xs:element name="networks" type="Networks"/>

  <xs:complexType name="Network">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="data_center" minOccurs="0"/>
          <xs:element ref="cluster" minOccurs="0"/>
          <xs:element ref="ip" minOccurs="0"/>
          <xs:element ref="vlan" minOccurs="0"/>
          <xs:element name="stp" type="xs:boolean" minOccurs="0"/>
          <xs:element name="status" type="NetworkStatus" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Networks">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Networks"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="network" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Storage Domains -->

  <xs:element name="storage_domain" type="StorageDomain"/>

  <xs:element name="storage_domains" type="StorageDomains"/>

  <xs:group name="NfsStorage">
    <xs:sequence>
      <xs:element name="address" type="xs:string"/>
      <xs:element name="path" type="xs:string"/>
    </xs:sequence>
  </xs:group>

  <xs:group name="IscsiTarget">
    <xs:sequence>
      <xs:element name="address" type="xs:string"/>
      <xs:element name="port" type="xs:unsignedShort"/>
      <xs:element name="target" type="xs:string"/>
      <xs:element name="username" type="xs:string"/>
      <xs:element name="password" type="xs:string"/>
    </xs:sequence>
  </xs:group>

  <xs:element name="logical_unit" type="LogicalUnit"/>

  <xs:complexType name="LogicalUnit">
    <xs:sequence>
      <xs:group ref="IscsiTarget"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <xs:element name="volume_group" type="VolumeGroup"/>

  <xs:complexType name="VolumeGroup">
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element ref="logical_unit" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="LogicalUnits"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>

  <xs:group name="IscsiStorage">
    <xs:sequence>
      <xs:element ref="logical_unit" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="LogicalUnits"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
      <xs:element ref="volume_group" minOccurs="0"/>
    </xs:sequence>
  </xs:group>

  <xs:element name="storage" type="Storage"/>

  <xs:complexType name="Storage">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="type" type="StorageType" minOccurs="1" maxOccurs="1"/>
          <xs:choice>
            <xs:group ref="NfsStorage"/>
            <xs:group ref="IscsiStorage"/>
          </xs:choice>
          <xs:element ref="host" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="StorageDomain">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="type" type="StorageDomainType" minOccurs="0"/>
          <xs:element name="status" type="StorageDomainStatus" minOccurs="0"/>
          <xs:element name="master" type="xs:boolean" minOccurs="0"/>
          <xs:element ref="storage" minOccurs="0"/>
          <!-- also a rel="attachments" link, see Attachments above -->
          <!-- host is only relevant at creation time -->
          <xs:element ref="host" minOccurs="0"/>
          <xs:element name="available" type="xs:unsignedInt" minOccurs="0"/>
          <xs:element name="used" type="xs:unsignedInt" minOccurs="0"/>
          <xs:element name="committed" type="xs:unsignedInt" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="StorageDomains">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="StorageDomains"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="storage_domain" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Virtual Machine Templates -->

  <xs:element name="templates" type="Templates"/>

  <xs:element name="template">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="BaseResource">
          <xs:sequence>
            <xs:element ref="vm" minOccurs="0" maxOccurs="1"/>
            <xs:element name="type" type="VmType" minOccurs="0"/>
            <xs:element name="status" type="TemplateStatus" minOccurs="0"/>
            <xs:element name="memory" type="xs:long" minOccurs="0"/>
            <xs:element name="cpu" type="CPU" minOccurs="0"/>
            <xs:element name="os" type="OperatingSystem" minOccurs="0"/>
            <xs:element ref="cluster" minOccurs="0" maxOccurs="1"/>
            <!-- also rel="cdroms/disks/nics" links, see Devices below -->
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="Templates">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Templates"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="template" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Virtual Machines -->

  <xs:complexType name="OperatingSystem">
    <xs:sequence>
      <xs:element name="boot" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:attribute name="dev" type="BootDevice"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="kernel" type="xs:string" minOccurs="0"/>
      <xs:element name="initrd" type="xs:string" minOccurs="0"/>
      <xs:element name="cmdline" type="xs:string" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:simpleType name="DisplayType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="VNC"/>
      <xs:enumeration value="SPICE"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="Display">
    <xs:sequence>
      <xs:element name="type" type="DisplayType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="port" type="xs:unsignedShort" minOccurs="0" maxOccurs="1"/>
      <xs:element name="monitors" type="xs:int" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="Ticket">
    <xs:sequence>
      <xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="expiry" type="xs:unsignedInt" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="MemoryStatistics">
    <xs:sequence>
      <xs:element name="size" type="xs:unsignedInt" minOccurs="0" maxOccurs="1"/>
      <xs:element name="utilization" type="xs:unsignedInt" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="CpuStatistics">
    <xs:sequence>
      <xs:element name="user" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
      <xs:element name="system" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
      <xs:element name="idle" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
      <xs:element name="load" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="vms" type="VMs"/>

  <xs:element name="vm">
    <xs:annotation>
      <xs:appinfo>
         <jaxb:class name="VM"/>
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="BaseResource">
          <xs:sequence>
            <xs:element name="type" type="VmType" minOccurs="0"/>
            <xs:element name="status" type="VmStatus" minOccurs="0"/>
            <xs:element name="memory" type="xs:long" minOccurs="0"/>
            <xs:element name="cpu" type="CPU" minOccurs="0"/>
            <xs:element name="os" type="OperatingSystem" minOccurs="0"/>
            <xs:element name="display" type="Display" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="host" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="cluster" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="template" minOccurs="0" maxOccurs="1"/>

            <xs:element name="memory_statistics" type="MemoryStatistics" minOccurs="0" maxOccurs="1">
              <xs:annotation>
                <xs:appinfo>
                  <jaxb:property name="MemoryStatistics"/>
                </xs:appinfo>
              </xs:annotation>
            </xs:element>

            <xs:element name="cpu_statistics" type="CpuStatistics" minOccurs="0" maxOccurs="1">
              <xs:annotation>
                <xs:appinfo>
                  <jaxb:property name="CpuStatistics"/>
                </xs:appinfo>
              </xs:annotation>
            </xs:element>

            <xs:element ref="vmpool" minOccurs="0" maxOccurs="1">
              <xs:annotation>
                <xs:appinfo>
                  <jaxb:property name="VmPool"/>
                </xs:appinfo>
              </xs:annotation>
            </xs:element>
            <!-- also rel="cdroms/disks/nics" links, see Devices below -->
            <!-- also rel="snapshots" links, see Snapshots below -->
            <!-- also rel="users" links, see Users above -->
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="VMs">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="VMs"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="vm" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Virtual Machine Pools -->

  <xs:element name="vmpool" type="VmPool"/>

  <xs:element name="vmpools" type="VmPools"/>

  <xs:complexType name="VmPool">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element name="size" type="xs:int" minOccurs="0"/>
          <xs:element ref="cluster" minOccurs="0" maxOccurs="1"/>
          <xs:element ref="template" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="VmPools">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="VmPools"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="vmpool" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Devices -->

  <xs:complexType name="BaseDevice">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="vm" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="BaseDevices">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="cdrom" type="CdRom"/>

  <xs:element name="cdroms" type="CdRoms"/>

  <xs:element name="disk" type="Disk"/>

  <xs:element name="disks" type="Disks"/>

  <xs:element name="nic" type="NIC"/>

  <xs:element name="nics" type="Nics"/>

  <xs:complexType name="CdRom">
    <xs:complexContent>
      <xs:extension base="BaseDevice">
        <xs:sequence>
          <xs:element ref="iso"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="CdRoms">
    <xs:complexContent>
      <xs:extension base="BaseDevices">
        <xs:sequence>
          <xs:element ref="cdrom" maxOccurs="unbounded">
            <xs:annotation>
              <xs:appinfo>
                <jaxb:property name="CdRoms"/>
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Disk">
    <xs:complexContent>
      <xs:extension base="BaseDevice">
        <xs:sequence>
          <xs:element ref="storage_domain" minOccurs="0" maxOccurs="1"/>
          <xs:element name="size" type="xs:long" minOccurs="0"/>
          <xs:element name="type" type="DiskType" minOccurs="0"/>
          <xs:element name="status" type="DiskStatus" minOccurs="0"/>
          <xs:element name="interface" type="DiskInterface" minOccurs="0"/>
          <xs:element name="format" type="DiskFormat" minOccurs="0"/>
          <xs:element name="sparse" type="xs:boolean" minOccurs="0"/>
          <xs:element name="bootable" type="xs:boolean" minOccurs="0"/>
          <xs:element name="wipe_after_delete" type="xs:boolean" minOccurs="0"/>
          <xs:element name="propagate_errors" type="xs:boolean" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Disks">
    <xs:complexContent>
      <xs:extension base="BaseDevices">
        <xs:sequence>
          <xs:element ref="disk" maxOccurs="unbounded">
            <xs:annotation>
              <xs:appinfo>
                <jaxb:property name="Disks"/>
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NIC">
    <xs:complexContent>
      <xs:extension base="BaseDevice">
        <xs:sequence>
          <xs:element ref="network" minOccurs="0" maxOccurs="1"/>
          <xs:element name="type" type="NicType" minOccurs="0"/>
          <xs:element ref="mac" minOccurs="0"/>
          <xs:element ref="ip" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Nics">
    <xs:complexContent>
      <xs:extension base="BaseDevices">
        <xs:sequence>
          <xs:element ref="nic" maxOccurs="unbounded">
            <xs:annotation>
              <xs:appinfo>
                <jaxb:property name="Nics"/>
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Snapshots -->

  <xs:element name="snapshot" type="Snapshot"/>

  <xs:element name="snapshots" type="Snapshots"/>

  <xs:complexType name="Snapshot">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="vm" minOccurs="0"/>
          <!-- REVISIT: should be xs:dateTime (https://fedorahosted.org/rhevm-api/ticket/65) -->
          <xs:element name="date" type="xs:string" minOccurs="0"/>
          <!-- Also a rel="prev" link -->
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Snapshots">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Snapshots"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="snapshot" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Host NICs -->

  <xs:element name="host_nic" type="HostNIC"/>

  <xs:element name="host_nics" type="HostNics"/>

  <xs:complexType name="HostNIC">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="host" minOccurs="0" maxOccurs="1"/>
          <xs:element ref="network" minOccurs="0" maxOccurs="1"/>
          <xs:element ref="mac" minOccurs="0"/>
          <xs:element ref="ip" minOccurs="0"/>
          <xs:element ref="vlan" minOccurs="0"/>
          <xs:element ref="slaves" minOccurs="0"/>
          <!-- Also a rel="master" link for bonded nics -->
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="HostNics">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:element ref="host_nic" maxOccurs="unbounded">
            <xs:annotation>
              <xs:appinfo>
                <jaxb:property name="HostNics"/>
              </xs:appinfo>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:element name="slaves" type="Slaves"/>

  <xs:complexType name="Slaves">
    <xs:sequence>
      <xs:element ref="host_nic" maxOccurs="unbounded">
        <xs:annotation>
          <xs:appinfo>
            <jaxb:property name="Slaves"/>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <!-- Host Storage -->

  <xs:element name="host_storage" type="HostStorage"/>

  <xs:complexType name="HostStorage">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:element ref="storage" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <!-- Tags -->

  <xs:element name="tag" type="Tag"/>

  <xs:element name="tags" type="Tags"/>

  <xs:complexType name="Tag">
    <xs:complexContent>
      <xs:extension base="BaseResource">
        <xs:sequence>
          <xs:element ref="host" minOccurs="0"/>
          <xs:element ref="vm" minOccurs="0"/>
          <xs:element ref="user" minOccurs="0"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="Tags">
    <xs:complexContent>
      <xs:extension base="BaseResources">
        <xs:sequence>
          <xs:annotation>
            <xs:appinfo>
                <jaxb:property name="Tags"/>
            </xs:appinfo>
          </xs:annotation>
          <xs:element ref="tag" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

</xs:schema>

{'fraction_non_alphanumeric': 0.17452055794043608, 'fraction_numerical': 0.0051075628412642435, 'mean_word_length': 2.832230403579085, 'pattern_counts': {'":': 0, '<': 2223, '<?xml version=': 2, '>': 2223, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4014729', 'n_tokens_mistral': 26802, 'n_tokens_neox': 25967, 'n_words': 4502}