Skip to Content.
Sympa Menu

perfsonar-dev - Re: [pS-dev] time types in requests to SQL MA and E2Emon MP

Subject: perfsonar development work

List archive

Re: [pS-dev] time types in requests to SQL MA and E2Emon MP


Chronological Thread 
  • From: Roman Lapacz <>
  • To: "Jeff W. Boote" <>
  • Cc: Roman Lapacz <>, Mark Yampolskiy <>, "Matthias K. Hamm" <>, Loukik Kudarimoti <>, "" <>, Jason Zurawski <>
  • Subject: Re: [pS-dev] time types in requests to SQL MA and E2Emon MP
  • Date: Mon, 07 May 2007 16:24:30 +0200

Jeff W. Boote wrote:
Roman Lapacz wrote:
It would be good to find time to discuss the schema of transformation stuff and container structures in parameter (see my one of previous emails). I asked Szymon to include these topics in the aganda.

I'm attaching two requests to this message. The first one is a simple transformation from the snmp namespace to the characteristic namespace.

The second one is more complex - it allows you to specify exactly which elements in the response message should be converted using XPath. (Alternatively, it could be made much more simple if we just used a specific targeted eventType that would do this conversion for one type of response data only. I was just playing with the idea of a general time conversion transformation description. What do you think?)

I'd be happy to show the demo next week (and I'll send out a link too).

Not sure how long this will be working - but here are the two demos:


http://packrat.internet2.edu/circUIts/both.html
http://packrat.internet2.edu/gmaps/index.cgi?mode=map&domain=perfsonar.net&action=Go


They are probably very dependent on browser version - the first one only supports FireFox 1.5 right now. (I wrote the first one - Yee wrote the second one. Jason made modifications to both and added support into services for us.)

jeff
------------------------------------------------------------------------

<?xml version='1.0' encoding='UTF-8'?>

<!-- Purpose: Transform tool snmp namespace of 'utilization' into
the characteristic namespace -->
<!-- Version: $Id$ -->

<nmwg:message id="msg4"

type="http://schema.perfsonar.net/MessageTypes/SetupDataRequest/2.0";

This type is something new for me. We could consider changing existing names of message types.


<!-- The third metadata is used to convert the results of the first
operation. It converts it into the 'characteristic' namespace. -->
<nmwg:metadata id="meta3">
<trans:subject id="iusub3" metadataIdRef="meta2"/>

<trans:parameters id="param3">
<nmwg:parameter name="ConvertTo">unix</nmwg:parameter>
<nmwg:parameter name="ConvertFrom">iso</nmwg:parameter>
<nmwg:parameter name="ConvertElements">
<trans:parameters id="cp1">
<nmwg:parameter
name="startTime">//nmwg:message//select:parameters/nmwg:parameter[@name="startTime"]</nmwg:parameter>
<nmwg:parameter
name="endTime">//nmwg:message//select:parameters/nmwg:parameter[@name="endTime"]</nmwg:parameter>
<nmwg:parameter
name="datumTimeValue">//nmwg:message//nmwg:data/nmwg:datum[@timeType!="iso"]</nmwg:parameter>
</trans:parameters>
</nmwg:parameter>
</trans:parameters>


Two comments:

- I'm not sure putting xpath here. Xpath is the implementation part and can be used either inside the service or client app. No need to use it in the message. NMWG can handle in this case.

- I don't like parameters inside parameter. Some time ago I proposed container structures in parameter (I asked Szymon to include it in the agenda for the meeting in Brazil)

something like this:


xmlns:list="http://ggf.org/ns/nmwg/base/2.0/parameter/collection/list/";
xmlns:map="http://ggf.org/ns/nmwg/base/2.0/parameter/collection/map/";
xmlns:collection="http://ggf.org/ns/nmwg/base/2.0/parameter/collection/";


<list:parameter name="listXYZ">
<collection:item name="X">xxx</collection:item>
<collection:item name="Y">yyy</collection:item>
</list:parameter>

<map:parameter name="mapXYZ">
<collection:item name="X">xxx</collection:item>
<collection:item name="Y">yyy</collection:item>
</map:parameter>


So I could change your parameter this way

<trans:parameters id="param3">

<!-- other parameters -->
<!-- ... -->

<list:parameter name="ConvertElements">
<collection:item name name="startTime">//nmwg:message//select:parameters/nmwg:parameter[@name="startTime"]</collection:item>
<collection:item name="endTime">//nmwg:message//select:parameters/nmwg:parameter[@name="endTime"]</collection:item>
<collection:item name="datumTimeValue">//nmwg:message//nmwg:data/nmwg:datum[@timeType!="iso"]</collection:item>
</list:parameter>

</trans:parameters>


I think this solution could be very useful also in other messages.


I attached my updated proposal of the request for the MA.


Roman





<nmwg:eventType>http://schema.perfsonar.net/tools/transform/Time/2.0</nmwg:eventType>

</nmwg:metadata>

<!-- This is the specific data we wish to see -->
<nmwg:data id="data1" metadataIdRef="meta3"/>

</nmwg:message>

<?xml version='1.0' encoding='UTF-8'?>


<!-- Version:	$Id$ -->

<nmwg:message id="msg4"
              type="http://schema.perfsonar.net/MessageTypes/SetupDataRequest/2.0";
              xmlns:timetrans="http://schema.perfsonar.net/tools/transform/time/2.0/";
              xmlns:netutil="http://ggf.org/ns/nmwg/characteristic/utilization/2.0/";
              xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";
              xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/";
              xmlns:select="http://ggf.org/ns/nmwg/ops/select/2.0/";
              xmlns:nmtm="http://ggf.org/ns/nmwg/time/2.0/";>

  <nmwg:metadata id="meta1">
    <netutil:subject id="iusub1">
      <nmwgt:interface>
        <nmwgt:ifAddress type="ipv4">10.1.2.3</nmwgt:ifAddress>
        <nmwgt:direction>in</nmwgt:direction>
        <nmwgt:hostName>test-hostName</nmwgt:hostName>
        <nmwgt:ifName>test-0</nmwgt:ifName>
        <nmwgt:authRealm>TestRealm</nmwgt:authRealm>
        <nmwgt:capacity>1000BaseT</nmwgt:capacity>
      </nmwgt:interface>
    </netutil:subject>
    <nmwg:eventType>http://ggf.org/ns/nmwg/characteristic/utilization/2.0</nmwg:eventType>
  </nmwg:metadata>


  <!-- The second metadata is used to convert the results of the second
  operation. It selects a specific time-range. -->
  <nmwg:metadata id="meta2">

    <select:subject id="iusub2" metadataIdRef="meta1"/>

    <select:parameters id="param2">

      <nmwg:parameter name="startTime">1121472000</nmwg:parameter>
      <nmwg:parameter name="endTime">1121904000</nmwg:parameter>
      <!--
      <nmwg:parameter name="startTime">
          <nmtm:time type="ISO" value="2005-07-16T00:00:00Z"/>
      </nmwg:parameter>
      <nmwg:parameter name="endTime">
          <nmtm:time type="ISO" value="2005-07-21T00:00:00Z"/>
      </nmwg:parameter>
      -->
      <nmwg:parameter name="consolidationFunction">AVERAGE</nmwg:parameter>
      <nmwg:parameter name="resolution">60</nmwg:parameter>
    </select:parameters>

    <nmwg:eventType>http://ggf.org/ns/nmwg/ops/select/2.0</nmwg:eventType>

  </nmwg:metadata>

  <!-- The third metadata is used to convert the results of the first
  operation. -->
  <nmwg:metadata id="meta3">

    <timetrans:subject id="iusub3" metadataIdRef="meta2"/>

    <timetrans:parameters id="param3">
      <nmwg:parameter name="ConvertTo">unix</nmwg:parameter>
      <nmwg:parameter name="ConvertFrom">iso</nmwg:parameter>
    </timetrans:parameters>

    <nmwg:eventType>http://schema.perfsonar.net/tools/transform/time/2.0</nmwg:eventType>

  </nmwg:metadata>

  <!-- This is the specific data we wish to see -->
  <nmwg:data id="data1" metadataIdRef="meta3"/>

</nmwg:message>



Archive powered by MHonArc 2.6.16.

Top of Page