Background
This page outlines steps taken to be able to query a deployed perfSONAR lookup service. The service in question is one deployed by Internet2 under the PS-PS framework. It provides a registry of perfSONAR compatible services such as registered Topology Services, RRD MAs etc etc. It is located at:
http://patdev0.internet2.edu:6666/perfSONAR_PS/services/LS
Querying it with a web browser will return
<SOAP-ENV:Envelope> <SOAP-ENV:Header/> <SOAP-ENV:Body> <nmwg:message id="message.9999465" type="response"> <nmwg:metadata id="metadata.14215133"> <nmwg:eventType>error.perfSONAR_PS.transport</nmwg:eventType> </nmwg:metadata> <nmwg:data id="data.15234559" metadataIdRef="metadata.14215133"> <nmwgr:datum> Received message with 'INVALID REQUEST', are you using a web browser? </nmwgr:datum> </nmwg:data> </nmwg:message> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Querying
In order to query the LS, one needs to construct a SOAP envelop with the relevant query to perform as an XML document. One can send the relevant XML via the perfSONAR-PS client via SVN (or use a relevant SOAP wrapper).
Simple Echo (Service up?) Query
<nmwg:message type="EchoRequest" id="id1" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"> <nmwg:metadata id="meta" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"> <nmwg:eventType>echo.ls</nmwg:eventType> </nmwg:metadata> <nmwg:data id="data" metadataIdRef="meta" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"/> </nmwg:message>
[ytl@Yees-Ubuntu:~/Work/perfSONAR/perfSONAR-PS/trunk/perfSONAR-PS/client]$ ./client.pl http://patdev0.internet2.edu:6666/perfSONAR_PS/services/LS /tmp/test.xml 2007/10/09 13:52:27 DEBUG> Transport.pm:469 perfSONAR_PS::Transport::makeEnvelope - Envelope created. 2007/10/09 13:52:27 DEBUG> Transport.pm:488 perfSONAR_PS::Transport::sendReceive - Sending information to "http://patdev0.internet2.edu:6666//perfSONAR_PS/services/LS". 2007/10/09 13:52:27 DEBUG> Transport.pm:505 perfSONAR_PS::Transport::sendReceive - Response returned. <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <nmwg:message xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="message.6185033" messageIdRef="id1" type="EchoResponse"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="metadata.5527649" metadataIdRef="meta"> <nmwg:eventType>success.echo</nmwg:eventType> </nmwg:metadata> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="data.8204718" metadataIdRef="metadata.5527649"> <nmwgr:datum xmlns:nmwgr="http://ggf.org/ns/nmwg/result/2.0/">The echo request has passed.</nmwgr:datum> </nmwg:data> </nmwg:message> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Shows a successfully configured service.
Query the LS for information
The LS supports queries via XQuery. This is passed in the subject tag from which the service does a direct query. eg:
<?xml version='1.0' encoding='UTF-8'?> <nmwg:message type="LSQueryRequest" id="msg1" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" xmlns:xquery="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xquery/1.0/"> <nmwg:metadata id="meta1"> <xquery:subject id="sub1"> <!-- XQUERY STATEMENT HERE --> </xquery:subject> <nmwg:eventType>http://ggf.org/ns/nmwg/tools/org/perfsonar/service/lookup/xquery/1.0</nmwg:eventType> </nmwg:metadata> <nmwg:data metadataIdRef="meta1" id="d1"/> </nmwg:message>
Notes
So depending on the type of query you wish to conduct, you must modify your XQuery statement. What follows is some common queries. Please not that the output, even though is XML, will be escaped and should be reconstructed so that it can be reparsed as XML DOM (etc).
A simple way of doing this is to pipe the output to:
sed s:'>':'>':g | sed s:'<':'<':g | sed s:'"':'"':g | tidy
Dump Everything
declare namespace nmwg="http://ggf.org/ns/nmwg/base/2.0/"; /nmwg:store
[ytl@Yees-Ubuntu:~/Work/perfSONAR/perfSONAR-PS/trunk/perfSONAR-PS/client]$ ./client.pl http://patdev0.internet2.edu:6666/perfSONAR_PS/services/LS /tmp/test.xml | sed s:'>':'>':g | sed s:'<':'<':g | sed s:'"':'"':g | tidy 2007/10/09 14:08:52 DEBUG> Transport.pm:469 perfSONAR_PS::Transport::makeEnvelope - Envelope created. 2007/10/09 14:08:52 DEBUG> Transport.pm:488 perfSONAR_PS::Transport::sendReceive - Sending information to "http://patdev0.internet2.edu:6666//perfSONAR_PS/services/LS". 2007/10/09 14:08:52 DEBUG> Transport.pm:505 perfSONAR_PS::Transport::sendReceive - Response returned. No warnings or errors were found. <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header /> <SOAP-ENV:Body> <nmwg:message xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="message.1124710" messageIdRef="msg1" type="LSQueryResponse"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="metadata.7145326" metadataIdRef="meta1"></nmwg:metadata> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="data.1129756" metadataIdRef="metadata.7145326"> <psservice:datum xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://patdev0.internet2.edu:8080/perfSONAR_PS/services/snmpMA"> <perfsonar:subject xmlns:perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"> <psservice:service xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <psservice:serviceName>Internet2 SNMP MA #2</psservice:serviceName> <psservice:accessPoint>http://patdev0.internet2.edu:8080/perfSONAR_PS/services/snmpMA</psservice:accessPoint> <psservice:serviceType>MA</psservice:serviceType> <psservice:serviceDescription>perfSONAR_PS SNMP MA Located in Ann Arbor, MI</psservice:serviceDescription> </psservice:service> </perfsonar:subject> </nmwg:metadata> </nmwg:store> <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore-control"> <nmwg:metadata id="http://patdev0.internet2.edu:8080/perfSONAR_PS/services/snmpMA-control" metadataIdRef="http://patdev0.internet2.edu:8080/perfSONAR_PS/services/snmpMA" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"> <nmwg:parameters id="control-parameters"> <nmwg:parameter name="timestamp"> <nmtm:time type="unix" xmlns:nmtm="http://ggf.org/ns/nmwg/time/2.0/">1191966278</nmtm:time> </nmwg:parameter> </nmwg:parameters> </nmwg:metadata> </nmwg:store> <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore"> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://patdev0.internet2.edu:8080/perfSONAR_PS/services/snmpMA/1191879862/0" metadataIdRef="http://patdev0.internet2.edu:8080/perfSONAR_PS/services/snmpMA"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="m-in-netutil-1"> <netutil:subject xmlns:netutil="http://ggf.org/ns/nmwg/characteristic/utilization/2.0/" id="s-in-netutil-1"> <nmwgt:interface xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/"> <nmwgt:ifAddress type="ipv4">164.113.238.205</nmwgt:ifAddress> <nmwgt:hostName>ks-42-tenge4-2-130.r.greatplains.net</nmwgt:hostName> <nmwgt:ifName>TenGigabitEthernet2/1</nmwgt:ifName> <nmwgt:ifIndex>3</nmwgt:ifIndex> <nmwgt:direction>in</nmwgt:direction> <nmwgt:capacity>10000000000</nmwgt:capacity> <nmwgt:description>Internet2 via Great Plains Network</nmwgt:description> <nmwgt:ifDescription>Internet2 via Great Plains Network</nmwgt:ifDescription> </nmwgt:interface> </netutil:subject> <nmwg:eventType>http://ggf.org/ns/nmwg/tools/snmp/2.0</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/characteristic/utilization/2.0</nmwg:eventType> <nmwg:parameters id="p-in-netutil-1"> <nmwg:parameter name="supportedEventType">http://ggf.org/ns/nmwg/tools/snmp/2.0</nmwg:parameter> <nmwg:parameter name="supportedEventType">http://ggf.org/ns/nmwg/characteristic/utilization/2.0</nmwg:parameter> </nmwg:parameters> </nmwg:metadata> </nmwg:data> </nmwg:store> <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore"> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://patdev0.internet2.edu:8080/perfSONAR_PS/services/snmpMA/1191879862/1" metadataIdRef="http://patdev0.internet2.edu:8080/perfSONAR_PS/services/snmpMA"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="m-out-netutil-1"> <netutil:subject xmlns:netutil="http://ggf.org/ns/nmwg/characteristic/utilization/2.0/" id="s-out-netutil-1"> <nmwgt:interface xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/"> <nmwgt:ifAddress type="ipv4">164.113.238.205</nmwgt:ifAddress> <nmwgt:hostName>ks-42-tenge4-2-130.r.greatplains.net</nmwgt:hostName> <nmwgt:ifName>TenGigabitEthernet2/1</nmwgt:ifName> <nmwgt:ifIndex>3</nmwgt:ifIndex> <nmwgt:direction>out</nmwgt:direction> <nmwgt:capacity>10000000000</nmwgt:capacity> <nmwgt:description>Internet2 via Great Plains Network</nmwgt:description> <nmwgt:ifDescription>Internet2 via Great Plains Network</nmwgt:ifDescription> </nmwgt:interface> </netutil:subject> <nmwg:eventType>http://ggf.org/ns/nmwg/tools/snmp/2.0</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/characteristic/utilization/2.0</nmwg:eventType> <nmwg:parameters id="p-out-netutil-1"> <nmwg:parameter name="supportedEventType">http://ggf.org/ns/nmwg/tools/snmp/2.0</nmwg:parameter> <nmwg:parameter name="supportedEventType">http://ggf.org/ns/nmwg/characteristic/utilization/2.0</nmwg:parameter> </nmwg:parameters> </nmwg:metadata> </nmwg:data> </nmwg:store> ...
We see here all the <nmwg:store/>
's that have been registered with the LS. Here we see a list of SNMP-MA metadata elements which have been registered with the LS.
Later on in the output, we have
... <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:8089/perfSONAR_PS/services/topology"> <perfsonar:subject xmlns:perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"> <psservice:service xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <psservice:serviceName>Topology MA</psservice:serviceName> <psservice:accessPoint>http://packrat.internet2.edu:8089/perfSONAR_PS/services/topology</psservice:accessPoint> <psservice:serviceType>MA</psservice:serviceType> <psservice:serviceDescription>Topology Measurement Archive</psservice:serviceDescription> </psservice:service> </perfsonar:subject> </nmwg:metadata> </nmwg:store> <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore-control"> <nmwg:metadata id="http://packrat.internet2.edu:8089/perfSONAR_PS/services/topology-control" metadataIdRef="http://packrat.internet2.edu:8089/perfSONAR_PS/services/topology" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"> <nmwg:parameters id="control-parameters"> <nmwg:parameter name="timestamp"> <nmtm:time type="unix" xmlns:nmtm="http://ggf.org/ns/nmwg/time/2.0/">1191967581</nmtm:time> </nmwg:parameter> </nmwg:parameters> </nmwg:metadata> </nmwg:store> <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore"> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:8089/perfSONAR_PS/services/topology/1191881181/0" metadataIdRef="http://packrat.internet2.edu:8089/perfSONAR_PS/services/topology"> <nmwg:metadata id="meta17737387"> <nmwg:subject id="sub0"> <ctrlplane_jun:domain xmlns:CtrlPlane="http://ogf.org/schema/network/topology/ctrlPlane/20070626/" xmlns:ctrlplane_jun="http://ogf.org/schema/network/topology/ctrlPlane/20070626/" id="urn:ogf:network:domain=293" /> </nmwg:subject> <nmwg:eventType>topology</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/query/all/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/query/xquery/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/change/add/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/change/update/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/change/replace/20070809</nmwg:eventType> </nmwg:metadata> </nmwg:data> </nmwg:store> <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:5800/perfSONAR_PS/services/topology"> <perfsonar:subject xmlns:perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"> <psservice:service xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <psservice:accessPoint>http://packrat.internet2.edu:5800/perfSONAR_PS/services/topology</psservice:accessPoint> <psservice:serviceType>MA</psservice:serviceType> <psservice:serviceDescription>Topology Measurement Archive</psservice:serviceDescription> </psservice:service> </perfsonar:subject> </nmwg:metadata> </nmwg:store> ...
Whis is the metadata from a Topology Service.
And we even have that of from the Status MA:
... <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status"> <perfsonar:subject xmlns:perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"> <psservice:service xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <psservice:accessPoint>http://packrat.internet2.edu:5801/perfSONAR_PS/services/status</psservice:accessPoint> <psservice:serviceType>MA</psservice:serviceType> <psservice:serviceDescription>Link Status Measurement Archive</psservice:serviceDescription> </psservice:service> </perfsonar:subject> </nmwg:metadata> </nmwg:store> <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore-control"> <nmwg:metadata id="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status-control" metadataIdRef="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"> <nmwg:parameters id="control-parameters"> <nmwg:parameter name="timestamp"> <nmtm:time type="unix" xmlns:nmtm="http://ggf.org/ns/nmwg/time/2.0/">1191967524</nmtm:time> </nmwg:parameter> </nmwg:parameters> </nmwg:metadata> </nmwg:store> <nmwg:store xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" type="LSStore"> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status/1191881560/0" metadataIdRef="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status"> <nmwg:metadata id="meta0"> <nmwg:subject id="sub0"> <nmtopo_aug:link xmlns:nmtopo="http://ogf.org/schema/network/topology/base/20070828/" xmlns:nmtopo_aug="http://ogf.org/schema/network/topology/base/20070828/" id="urn:ogf:network:domain=I2:node=rtr.wash:port=so-1%2F1%2F0.0:link=ATLA to WASH OC192" /> </nmwg:subject> <nmwg:eventType>Link.Status</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/characteristic/link/status/20070809</nmwg:eventType> </nmwg:metadata> </nmwg:data> </nmwg:store> ...
Get All Topology Info
So say we wanted to get all the (meta)data from the LS which corresponds to Topology information, we should send the following XQuery:
declare namespace nmwg="http://ggf.org/ns/nmwg/base/2.0/"; /nmwg:store/nmwg:data[child::nmwg:metadata/nmwg:eventType='http://ggf.org/ns/nmwg/topology/query/all/20070809']
[ytl@Yees-Ubuntu:~/Work/perfSONAR/perfSONAR-PS/trunk/perfSONAR-PS/client]$ ./client.pl http://patdev0.internet2.edu:6666/perfSONAR_PS/services/LS /tmp/test.xml | sed s:'>':'>':g | sed s:'<':'<':g | sed s:'"':'"':g | tidy 2007/10/09 14:29:16 DEBUG> Transport.pm:469 perfSONAR_PS::Transport::makeEnvelope - Envelope created. 2007/10/09 14:29:16 DEBUG> Transport.pm:488 perfSONAR_PS::Transport::sendReceive - Sending information to "http://patdev0.internet2.edu:6666//perfSONAR_PS/services/LS". 2007/10/09 14:29:16 DEBUG> Transport.pm:505 perfSONAR_PS::Transport::sendReceive - Response returned. No warnings or errors were found. <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header /> <SOAP-ENV:Body> <nmwg:message xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="message.11295574" messageIdRef="msg1" type="LSQueryResponse"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="metadata.2482130" metadataIdRef="meta1"></nmwg:metadata> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="data.16850367" metadataIdRef="metadata.2482130"> <psservice:datum xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:8089/perfSONAR_PS/services/topology/1191881181/0" metadataIdRef="http://packrat.internet2.edu:8089/perfSONAR_PS/services/topology"> <nmwg:metadata id="meta17737387"> <nmwg:subject id="sub0"> <ctrlplane_jun:domain xmlns:CtrlPlane="http://ogf.org/schema/network/topology/ctrlPlane/20070626/" xmlns:ctrlplane_jun="http://ogf.org/schema/network/topology/ctrlPlane/20070626/" id="urn:ogf:network:domain=293" /> </nmwg:subject> <nmwg:eventType>topology</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/query/all/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/query/xquery/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/change/add/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/change/update/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/change/replace/20070809</nmwg:eventType> </nmwg:metadata> </nmwg:data> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:5800/perfSONAR_PS/services/topology/1191881224/0" metadataIdRef="http://packrat.internet2.edu:5800/perfSONAR_PS/services/topology"> <nmwg:metadata id="meta9650481"> <nmwg:subject id="sub0"> <nmtopo_aug:domain xmlns:nmtb="http://ogf.org/schema/network/topology/base/20070828/" xmlns:nmtopo_aug="http://ogf.org/schema/network/topology/base/20070828/" id="urn:ogf:network:domain=I2" /> </nmwg:subject> <nmwg:eventType>topology</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/query/all/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/query/xquery/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/change/add/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/change/update/20070809</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/topology/change/replace/20070809</nmwg:eventType> </nmwg:metadata> </nmwg:data> </psservice:datum> </nmwg:data> </nmwg:message> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Link Status
This is how we query for all the link status:
declare namespace nmwg="http://ggf.org/ns/nmwg/base/2.0/"; /nmwg:store/nmwg:data[child::nmwg:metadata/nmwg:eventType='http://ggf.org/ns/nmwg/characteristic/link/status/20070809']
Which basically tells the LS to return all nmwg::data
elements that have (nested) child eventType of the link status as defined. This returns:
[ytl@Yees-Ubuntu:~/Work/perfSONAR/perfSONAR-PS/trunk/perfSONAR-PS/client]$ ./client.pl http://patdev0.internet2.edu:6666/perfSONAR_PS/services/LS /tmp/test.xml | sed s:'>':'>':g | sed s:'<':'<':g | sed s:'"':'"':g | tidy 2007/10/09 14:24:59 DEBUG> Transport.pm:469 perfSONAR_PS::Transport::makeEnvelope - Envelope created. 2007/10/09 14:24:59 DEBUG> Transport.pm:488 perfSONAR_PS::Transport::sendReceive - Sending information to "http://patdev0.internet2.edu:6666//perfSONAR_PS/services/LS". 2007/10/09 14:25:00 DEBUG> Transport.pm:505 perfSONAR_PS::Transport::sendReceive - Response returned. No warnings or errors were found. <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header /> <SOAP-ENV:Body> <nmwg:message xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="message.6379216" messageIdRef="msg1" type="LSQueryResponse"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="metadata.12038437" metadataIdRef="meta1"></nmwg:metadata> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="data.11853357" metadataIdRef="metadata.12038437"> <psservice:datum xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status/1191881560/0" metadataIdRef="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status"> <nmwg:metadata id="meta0"> <nmwg:subject id="sub0"> <nmtopo_aug:link xmlns:nmtopo="http://ogf.org/schema/network/topology/base/20070828/" xmlns:nmtopo_aug="http://ogf.org/schema/network/topology/base/20070828/" id="urn:ogf:network:domain=I2:node=rtr.wash:port=so-1%2F1%2F0.0:link=ATLA to WASH OC192" /> </nmwg:subject> <nmwg:eventType>Link.Status</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/characteristic/link/status/20070809</nmwg:eventType> </nmwg:metadata> </nmwg:data> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status/1191881560/1" metadataIdRef="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status"> <nmwg:metadata id="meta1"> <nmwg:subject id="sub0"> <nmtopo_aug:link xmlns:nmtopo="http://ogf.org/schema/network/topology/base/20070828/" xmlns:nmtopo_aug="http://ogf.org/schema/network/topology/base/20070828/" id="urn:ogf:network:domain=I2:node=rtr.atla:port=so-0%2F0%2F0.0:link=ATLA to WASH OC192" /> </nmwg:subject> <nmwg:eventType>Link.Status</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/characteristic/link/status/20070809</nmwg:eventType> </nmwg:metadata> </nmwg:data> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status/1191881560/2" metadataIdRef="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status"> <nmwg:metadata id="meta2"> <nmwg:subject id="sub0"> <nmtopo_aug:link xmlns:nmtopo="http://ogf.org/schema/network/topology/base/20070828/" xmlns:nmtopo_aug="http://ogf.org/schema/network/topology/base/20070828/" id="urn:ogf:network:domain=I2:node=rtr.losa:port=so-0%2F1%2F0.0:link=Layer3 Backbone LOSA to SEAT" /> </nmwg:subject> <nmwg:eventType>Link.Status</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/characteristic/link/status/20070809</nmwg:eventType> </nmwg:metadata> </nmwg:data> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status/1191881560/3" metadataIdRef="http://packrat.internet2.edu:5801/perfSONAR_PS/services/status"> <nmwg:metadata id="meta3"> <nmwg:subject id="sub0"> <nmtopo_aug:link xmlns:nmtopo="http://ogf.org/schema/network/topology/base/20070828/" xmlns:nmtopo_aug="http://ogf.org/schema/network/topology/base/20070828/" id="urn:ogf:network:domain=I2:node=rtr.atla:port=so-4%2F0%2F0.0:link=ATLA-HOUS OC-192" /> </nmwg:subject> <nmwg:eventType>Link.Status</nmwg:eventType> <nmwg:eventType>http://ggf.org/ns/nmwg/characteristic/link/status/20070809</nmwg:eventType> </nmwg:metadata> </nmwg:data> ...
Querying for Services
So say we just want to find out where to get MA information from, we can do a direct query for the services that are registered with the following xquery:
declare namespace nmwg="http://ggf.org/ns/nmwg/base/2.0/"; declare namespace perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"; declare namespace psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"; /nmwg:store/nmwg:metadata/perfsonar:subject[child::psservice:service]
Notice that because of the extra namespaces in the new tags, we have to declare them prior to use.
[ytl@Yees-Ubuntu:~/Work/perfSONAR/perfSONAR-PS/trunk/perfSONAR-PS/client]$ ./client.pl http://patdev0.internet2.edu:6666/perfSONAR_PS/services/LS /tmp/test.xml | sed s:'>':'>':g | sed s:'<':'<':g | sed s:'"':'"':g 2007/10/09 14:34:11 DEBUG> Transport.pm:469 perfSONAR_PS::Transport::makeEnvelope - Envelope created. 2007/10/09 14:34:11 DEBUG> Transport.pm:488 perfSONAR_PS::Transport::sendReceive - Sending information to "http://patdev0.internet2.edu:6666//perfSONAR_PS/services/LS". 2007/10/09 14:34:12 DEBUG> Transport.pm:505 perfSONAR_PS::Transport::sendReceive - Response returned. <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <nmwg:message xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="message.9290927" messageIdRef="msg1" type="LSQueryResponse"> <nmwg:metadata xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="metadata.9639414" metadataIdRef="meta1"> </nmwg:metadata> <nmwg:data xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="data.9852913" metadataIdRef="metadata.9639414"> <psservice:datum xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"><perfsonar:subject xmlns:perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"> <psservice:service xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <psservice:serviceName>Internet2 SNMP MA #2</psservice:serviceName> <psservice:accessPoint>http://patdev0.internet2.edu:8080/perfSONAR_PS/services/snmpMA</psservice:accessPoint> <psservice:serviceType>MA</psservice:serviceType> <psservice:serviceDescription>perfSONAR_PS SNMP MA Located in Ann Arbor, MI</psservice:serviceDescription> </psservice:service> </perfsonar:subject> <perfsonar:subject xmlns:perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"> <psservice:service xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <psservice:serviceName>Topology MA</psservice:serviceName> <psservice:accessPoint>http://packrat.internet2.edu:8089/perfSONAR_PS/services/topology</psservice:accessPoint> <psservice:serviceType>MA</psservice:serviceType> <psservice:serviceDescription>Topology Measurement Archive</psservice:serviceDescription> </psservice:service> </perfsonar:subject> <perfsonar:subject xmlns:perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"> <psservice:service xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <psservice:accessPoint>http://packrat.internet2.edu:5800/perfSONAR_PS/services/topology</psservice:accessPoint> <psservice:serviceType>MA</psservice:serviceType> <psservice:serviceDescription>Topology Measurement Archive</psservice:serviceDescription> </psservice:service> </perfsonar:subject> <perfsonar:subject xmlns:perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"> <psservice:service xmlns:psservice="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/1.0/"> <psservice:accessPoint>http://packrat.internet2.edu:5801/perfSONAR_PS/services/status</psservice:accessPoint> <psservice:serviceType>MA</psservice:serviceType> <psservice:serviceDescription>Link Status Measurement Archive</psservice:serviceDescription> </psservice:service> </perfsonar:subject> </psservice:datum> </nmwg:data> </nmwg:message> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
so we have returned two Topology services on packrat on ports 8089 and 5800, one link status MA and one SNMP MA.