<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:py="http://genshi.edgewall.org/" xml:lang="en">
  <xsd:annotation>
    <xsd:documentation>
      services schema for bcfg2
      Narayan Desai, Argonne National Laboratory
    </xsd:documentation>
  </xsd:annotation>

  <xsd:include schemaLocation="types.xsd"/>
  <xsd:import namespace="http://genshi.edgewall.org/"
              schemaLocation="genshi.xsd"/>

  <xsd:simpleType name='RestartEnum'>
    <xsd:restriction base='xsd:string'>
      <xsd:enumeration value='true'/>
      <xsd:enumeration value='false'/>
      <xsd:enumeration value='interactive'/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="ServiceType">
    <xsd:annotation>
      <xsd:documentation>
        Concrete description of a service entry.  Note that, due to
        the great proliferation of init systems, many of the
        attributes listed only apply to one or a few client tools.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="name" type="xsd:string" use="required">
      <xsd:annotation>
        <xsd:documentation>
          The name of the service.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="bootstatus" type="BootStatusEnum" default="off">
      <xsd:annotation>
        <xsd:documentation>
          Whether the service should start at boot. The default value
          corresponds to the value of the status attribute.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="status" type="StatusEnum" default="off">
      <xsd:annotation>
        <xsd:documentation>
          Whether the service should be on or off when the bcfg2 client
          is run. This attribute may have different behavior depending
          on the characteristics of the client tool. If set to "ignore",
          then the status of the service will not be checked.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="restart" type="RestartEnum" default="true">
      <xsd:annotation>
        <xsd:documentation>
          Whether or not to restart the service when the bundle is
          modified.  (New in 1.3; replaces "mode" attribute.)
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="install" type="xsd:boolean" default="true">
      <xsd:annotation>
        <xsd:documentation>
          Whether or not to install the service initially.  (New in
          1.3; replaces "mode" attribute.)
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="type" type="ServiceTypeEnum">
      <xsd:annotation>
        <xsd:documentation>
          Driver to use on the client to manage this service.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="FMRI" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>
          The resource identifier for SMF services.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="sequence" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>
          Order for service startup.  Only meaningful for DebInit
          services.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="target" type="xsd:string" default="restart">
      <xsd:annotation>
        <xsd:documentation>
          Command to pass to the service management system when
          restarting a service.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attribute name="parameters" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>
          Parameters to pass to the service.  Only meaningful for
          Upstart services.
        </xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <xsd:attributeGroup ref="py:genshiAttrs"/>
  </xsd:complexType>
</xsd:schema>
