<?xml version="1.0"?>
<definitions name="MeasurementRequest"
             targetNamespace="http://www.hep.ucl.ac.uk/~pdm/e2epipes/admin/schema/20030708/MeasurementRequest.wsdl"
             xmlns:tns="http://www.hep.ucl.ac.uk/~pdm/e2epipes/admin/schema/20030708/MeasurementRequest.wsdl"
             xmlns:mrq="http://www.hep.ucl.ac.uk/~pdm/e2epipes/admin/schema/20030708/MeasurementRequest.xsd"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns="http://schemas.xmlsoap.org/wsdl/">

 <types>
  <schema targetNamespace="http://www.hep.ucl.ac.uk/~pdm/e2epipes/admin/schema/20030708/MeasurementRequest.xsd"
          xmlns="http://www.w3.org/2001/XMLSchema">

   <annotation>
    <documentation>
     Elements in the MeasurementRequest namespace are all related to the MeasurementRequest type.
    </documentation>
   </annotation>

   <complexType name="MeasurementRequest">
    <annotation>
     <documentation>
      A request for a measurement to be made.
      Either a particular characteristic may be requested, or a series of alternative tools, or both.
      If only a characteristic is specified, the tool to use will be chosen automatically.
      If both the tool and characteristic are specified, that tool will be used to measure that characteristic.
     </documentation>
    </annotation>

    <sequence>
     <element name="characteristic" type="mrq:CharacteristicSpec" minOccurs="0" maxOccurs="1">
      <annotation>
       <documentation>
        The name of the characteristic to measure, using the GGF NM-WG specification.
       </documentation>
      </annotation>
     </element>

     <element name="tool" type="mrq:ToolSpec" minOccurs="0" maxOccurs="unbounded">
      <annotation>
       <documentation>
        Zero or more tools, ranked in order of preference (with ranks closer to minus-infinity preferred).
        The measurement is made using the tool with the best (closest to minus-infinity)
        rank that also passes all other constraints.
       </documentation>
      </annotation>
     </element>

     <element name="source" type="mrq:HostSpec" minOccurs="1" maxOccurs="1">
      <annotation>
       <documentation>
        The name of the source to make measurements from.
        The actual name of the host from which measurements are made may not be exactly the same,
        for example in the case where the source is a router, the closest monitoring point will be used.
       </documentation>
      </annotation>
     </element>
     <element name="sink" type="mrq:HostSpec" minOccurs="1" maxOccurs="1">
      <annotation>
       <documentation>
        The name of the sink to make measurements to.
        The actual name of the host from which measurements are made may not be exactly the same,
        for example in the case where the sink is a router, the closest monitoring point will be used.
       </documentation>
      </annotation>
     </element>

     <element name="when" type="mrq:TimeSpec" minOccurs="1" maxOccurs="1">
      <annotation>
       <documentation>
        The time or times when this measurement should be made.
       </documentation>
      </annotation>
     </element>

     <element name="credential" type="anyType" minOccurs="0" maxOccurs="unbounded">
      <annotation>
       <documentation>
        Any relevent (or not) credentials may be included in credential elements.
        The credentials will be used to determine if a measurement should be authorised.
       </documentation>
      </annotation>
     </element>

    </sequence>

   </complexType>

   <complexType name="CharacteristicSpec">
    <annotation>
     <documentation>
      The characteristic specification contains the name of a GGF NMWG characteristic.
     </documentation>
    </annotation>
    <attribute name="name" type="string" use="required"/>
   </complexType>

   <complexType name="ToolSpec">
    <annotation>
     <documentation>
      The tool specification contains the name of a tool, plus a rank.
      The rank indicates which tool out of many is preferred,
      with numbers closer to minus-infinity more preferred.
     </documentation>
    </annotation>
    <attribute name="name" type="string" use="required"/>
    <attribute name="rank" type="integer" use="required"/>
   </complexType>

   <complexType name="HostSpec">
    <annotation>
     <documentation>
      The name of a host. This can be any identifying string, as long as anyone involved understands it :)
      The type indicates the type of host; this can be largely ignored by a client, as the service will
      use a sensible default. However, within the service the host type will be required.
     </documentation>
    </annotation>
    <attribute name="host" type="string" use="required"/>
    <attribute name="type" type="string" used="optional"/>
   </complexType>

   <complexType name="TimeSpec">
    <annotation>
     <documentation>
     </documentation>
    </annotation>
    <option>
     <attribute name="now" type="boolean" minoccurs="1" maxoccurs="1"/>
     <element name="time" type="dateTime" minoccurs="1" maxoccurs="unbounded"/>
     <element name="crontab" type="mrq:CrontabTime" minoccurs="1" maxoccurs="unbounded"/>
    </option>
   </complexType>

   <complexType name="CrontabTime">
    <annotation>
     <documentation>
      This is a crontab style time specification.
     </documentation>
    </annotation>
    <attribute name="minute" type="string" use="optional"/>
    <attribute name="hour" type="string" use="optional"/>
    <attribute name="dayOfMonth" type="string" use="optional"/>
    <attribute name="month" type="string" use="optional"/>
    <attribute name="dayOfWeek" type="string" use="optional"/>
   </complexType>

  </schema>
 </types>

</definitions>

