How Can I use REST API in Perl to connect to JAZZ and get the user information back in perl
2 answers
currently I don't think anyone has built any perl modules to wrapper oslc.
one could certainly do it. the Eclipse Lyo project http://www.eclipse.org/lyo/ intends to support other languages.
this article does a good job of describing the data flows, authorization and services catalog discovery
here is a little windows batch file that will pull back the project list from a server.. it does not use the proper discovery methodology defined
<code>
set COOKIES=.\cookies.txt
set USER=xxxxx
set PASSWORD=yyyyy
set HOST=https://server:port
curl -k -c %cookies% "%host%/jts/authenticated/identity" >nul
curl -k -L -b %COOKIES% -c %COOKIES% -d j_username=%USER% -d j_password=%PASSWORD% "%host%/jts/authenticated/j_security_check" >nul
curl -k -L -b %COOKIES% "%host%/ccm/oslc/workitems/catalog
</code>
one could certainly do it. the Eclipse Lyo project http://www.eclipse.org/lyo/ intends to support other languages.
this article does a good job of describing the data flows, authorization and services catalog discovery
here is a little windows batch file that will pull back the project list from a server.. it does not use the proper discovery methodology defined
<code>
set COOKIES=.\cookies.txt
set USER=xxxxx
set PASSWORD=yyyyy
set HOST=https://server:port
curl -k -c %cookies% "%host%/jts/authenticated/identity" >nul
curl -k -L -b %COOKIES% -c %COOKIES% -d j_username=%USER% -d j_password=%PASSWORD% "%host%/jts/authenticated/j_security_check" >nul
curl -k -L -b %COOKIES% "%host%/ccm/oslc/workitems/catalog
</code>
I posted another example to read/write SystemMessages with perl over REST. This shows you how to connect and login.
All is posted on Forum entry:
https://jazz.net/forum/questions/95903/where-can-i-find-more-documentation-about-the-new-server-alert-messages-rest-service
https://jazz.net/forum/questions/95903/where-can-i-find-more-documentation-about-the-new-server-alert-messages-rest-service
And the perl code you may find as attachment of WI:
https://jazz.net/jazz/web/projects/Jazz%20Foundation#action=com.ibm.team.workitem.viewWorkItem&id=235343
https://jazz.net/jazz/web/projects/Jazz%20Foundation#action=com.ibm.team.workitem.viewWorkItem&id=235343