Thursday, April 7, 2016

How to grab collection list from IBM Watson Explorer

There is an easy way to get the list of collections from IBM Watson Explorer

OUT=$(curl -s "http://$HOST:$PORT/vivisimo/cgi-bin/velocity?v.username=$USER&v.password=$PWD&v.function=search-collection-list-xml&v.indent=true&")

echo $OUT > out2
COLLIST=$(xmllint --xpath "//vse-collection[starts-with(@name,'mycollection')]/@name" out2 | sed 's/name="//g' | sed 's/"//g')

COLLIST will return all collections which start with "mycollection"
You can further work on the list by using the following as an example:

for col in $COLLIST; do
getStatusFunction $col $PORT

No comments:

Post a Comment