Skip to Content.
Sympa Menu

perfsonar-user - Re: [perfsonar-user] Perfsonar lookup service question

Subject: perfSONAR User Q&A and Other Discussion

List archive

Re: [perfsonar-user] Perfsonar lookup service question


Chronological Thread 
  • From: Andrew Lake <>
  • To: Weiping Mandrawa <>
  • Cc: ,
  • Subject: Re: [perfsonar-user] Perfsonar lookup service question
  • Date: Fri, 30 Apr 2010 15:34:24 -0400

Hi Weiping,

Send an XQuery like the following to one of the global Lookup Services (gLS):

my $xquery = "declare namespace nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\";\n";;
$xquery .=
"/nmwg:store[\@type=\"LSStore\"]/nmwg:data/nmwg:metadata/summary:parameters/nmwg:parameter[\@name=\"keyword\"]";

The "value" attribute in the returned elements will contain the keywords.
You'll have to sort out the unique ones. A list of global lookup services
where you can send the above query are listed here:
http://www.perfsonar.net/gls.root.hints. You only need to send the request to
one since they should all be synced. A few on the list occasionally have
problems so you may just want to stick to the es.net and internet2.edu
services.

Also the checks are case sensitive. This is a feature of xquery. There are
some ways to make XQuery do a case insensitive search but none of them are
that straight-forward.

Let me know if you need any clarification on the info above.

Thanks!
Andy

On Apr 30, 2010, at 2:01 PM, Weiping Mandrawa wrote:

> Andy,
>
> Thank you for clarification and quick response.
>
> I tested the code and it is working well.
>
>
> I have another question,
>
> let say I want to filter my lookup search based on Project name (e.g ESnet)
> and
> in the example code (ls-ex3-bwctl.pl)
>
> \$keyword=\"project:ESnet\" . Is this case sensitive ?
> and how do I get list of keyword "project"
> e.g LBNL, Internet2 etc to be used with lookup service
>
>
> Thank you
>
> Kind Regards
>
> Weiping
>
>
>
>
>
>
>
>>>> Andrew Lake
>>>> <>
>>>> 04/30/10 1:28 PM >>>
> Hi Weiping,
>
> The html on the page was causing those lines to be displayed incorrectly.
> The </ in the regular expression was the source of the problem. I have now
> corrected the page. The correct code block looks like the following:
>
> if( $hLSResult->{response} && $hLSResult->{response} =~ /^<./ ){
> # Print list of matching bwctl server addresses
> my $resParser = XML::LibXML->new();
> my $hLSDoc = $resParser->parse_string($hLSResult->{response});
>
> Also, if it helps you may download the code examples on this page here:
> http://psps.perfsonar.net/ps-client-examples-v1.1.tar.gz. There is also a
> link to this file on the bottom of the page.
>
> Thanks!
> Andy
>
>
> On Apr 30, 2010, at 1:09 PM, Jason Zurawski wrote:
>
>> Hello, I am trying to understand lookup service based on the address
>>
>> http://psps.perfsonar.net/client-doc.html
>>
>> In the paragraph
>>
>> The instance in the above example is the URL of an LS service to contact.
>> Examples
>> 1. Find all SNMP Measurement Archives
>>
>>
>> There are examples how to crate XQuery to be sent to home lookup services
>>
>> In the example code (XQuery to be sent up to home lookup based on Find all
>> SNMP Measurement Archieves)
>>
>>
>> (Line1) if($hLSResult->{response} && $hLSResult->{response} =~ /^new();
>> (Line2) my $hLSDoc =
>> $resParser->parse_string($hLSResult->{response});
>>
>>
>>
>> For some reason, perl can't understand (Line1) to (Line2)
>>
>> for example
>>
>> in Line2 , it is using $resParser but $resParser is not declared anywhere
>> in the code
>> and when I run the code, it complains about it
>>
>>
>>
>> if I change $resParser to $parser, it complains that
>>
>> Thread 65 terminated abnormally: Can't call method "parse_string" on
>> unblessed reference
>>
>>
>> Thank you
>>
>
>




Archive powered by MHonArc 2.6.16.

Top of Page