IT Process Automation

 View Only
  • 1.  How to apply xpath query to REST results from Spectrum with PAM?

    Posted May 10, 2016 04:08 PM

    I'm trying to create a process within PAM in order to create users in Spectrum using REST, and to do so, I need to get the landscapes (the quantity and their model handles) to make a loop operator to create the users for each landscape. The problem I'm facing now is that I receive the http response from OneClick and if I try to apply an xpath query to get the lanscapes only (I'm testing with an xpath tester), it seems the response is not well formed. I suspect I'm doing something wrong.

     

    This is the response:

     

    <landscape-response xmlns="http://www.ca.com/spectrum/restful/schema/response" total-landscapes="2">

     

     

          <landscape>

     

     

         <id>0x100000</id>

     

         <name>ss1pr</name>

         <isPrimary>true</isPrimary>

         <spectrumVersion>9.4.3.000</spectrumVersion>

    </landscape>

     

     

     

       <landscape>

     

     

        <id>0x200000</id>

     

        <name>ss2pr</name>

        <isPrimary>true</isPrimary>

        <spectrumVersion>9.4.3.000</spectrumVersion>

        </landscape>

     

    </landscape-response>


     

    From this response, I'd need to save in a value map array the landscape IDs and their names.

     

    Any idea?



  • 2.  Re: How to apply xpath query to REST results from Spectrum with PAM?

    Broadcom Employee
    Posted May 24, 2016 10:47 AM

    I have found this site to be helpful when building xpath queries:

     

    Free Online XPath Tester / Evaluator - FreeFormatter.com



  • 3.  Re: How to apply xpath query to REST results from Spectrum with PAM?
    Best Answer

    Posted May 25, 2016 04:01 PM

    Take a look at the convertXML function.



  • 4.  Re: How to apply xpath query to REST results from Spectrum with PAM?

    Posted May 26, 2016 08:24 AM

    Thanks Lindsay,

    I finally used the convertXml to create a ValueMap and then I take the values I need from there.