DX Unified Infrastructure Management

 View Only
  • 1.  CA Spectrum REST API Next Not Working

    Posted Feb 22, 2016 10:49 AM

    I am running a REST request with a throttle size of 1 (for testing purposes).  I am retrieving interfaces using the URL and XML shown below.  My problem - the URL for next changes with each request but the body of the data returned shows the data from the first entry and never changes.  With throttle size 1 I expected to see the first, then the second, the third, etc.

     

    ****************** INITIAL URL *******************************

    http://localhost:8080//spectrum/restful/models

    ****************** XML passed to initial request *******************************

    <?xml version="1.0" encoding="UTF-8"?>

    <rs:model-request throttlesize="1"

      xmlns:rs="http://www.ca.com/spectrum/restful/schema/request"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd ">

        <rs:target-models>

          <rs:models-search>

            <rs:search-criteria xmlns="http://www.ca.com/spectrum/restful/schema/filter">

              <filtered-models>

                <equals>

                  <attribute id="0x11ee8">

                    <value>15</value> <!-- RTR_Cisco -->

                  </attribute>

                </equals>

              </filtered-models>

            </rs:search-criteria>

          </rs:models-search>

        </rs:target-models>

        <rs:requested-attribute id="0x12e58" />

        <rs:requested-attribute id="0x10000" />

    </rs:model-request>

    ****************** Body returned from initial request *******************************

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

        <model-response-list xmlns="http://www.ca.com/spectrum/restful/schema/response" throttle="1" total-models="121106">

          <model-responses>

            <model mh="0x410000">

              <attribute id="0x12e58">563a0425-01f7-1000-1470-0a4519010000:56434fec-0b28-1000-0509-0af408290000</attribute>

              <attribute id="0x10000">CAT_IF_Port</attribute>

              <attribute id="0x10001">18612242</attribute>

              <attribute id="0x10032">Cisco Systems, Inc.</attribute>

              <attribute id="0x1006a">81</attribute>

              <attribute id="0x1006e">asc11.anma1.navisite.net_4/26</attribute>

              <attribute id="0x10071">300</attribute>

              <attribute id="0x1102a">1359743891</attribute>

              <attribute id="0x1102c">0</attribute>

              <attribute id="0x117a7">

              </attribute>

              <attribute id="0x117a8">

              </attribute>

              <attribute id="0x11f6f" error="NoSuchAttribute"/>

              <attribute id="0x12abe">0</attribute>

              <attribute id="0x12abf">0</attribute>

              <attribute id="0x12ac0">0</attribute>

              <attribute id="0x12ac1">0</attribute>

              <attribute id="0x12ac2">0</attribute>

              <attribute id="0x12ac3">0</attribute>

              <attribute id="0x12ac4">0</attribute>

              <attribute id="0x12ac5">0</attribute>

              <attribute id="0x12be2">300</attribute>

              <attribute id="0x12be5">0</attribute>

              <attribute id="0x12da2">300</attribute>

              <attribute id="0x12da6">300</attribute>

            </model>

          </model-responses>

          <link rel="next" href="http://localhost:8080//spectrum/restful/models?id=46eccef6-ccfe-451d-8acf-fc3d3422eec4&start=1&throttlesize=1" type="application/xml"/>

        </model-response-list>

     

    *********************************************************************

    So far so good.  However, if I then take the URL from the "next' link I end up with the exact same results with the only difference being the "next" link is changed.  The attribute values returned are unchanged.  I know about changing the &amp to & but that made no difference.  It feels as if the "start=1" parameter is part of the problem.  But even if I change that, manually, to "start=2" I am still returned the first entry.



  • 2.  Re: CA Spectrum REST API Next Not Working

    Posted Feb 22, 2016 03:24 PM

    Ok - so I have been playing around with this further.  It appears next DOES work if I am doing a GET request.  I was able to run the URL below (which is the link href from an earlier call) and it properly returned me the next entry (in this case start=2).  So my problem appears to be isolated to doing a POST.  With this in mind could someone from SUPPORT confirm the issue on their end and make a recommendation?

    http://anddevspect01.min.navisite-int.net:8080/spectrum/restful/devices?id=e1bfabf1-4d33-40e7-8094-14db6f3d1a96&start=2&throttlesize=1



  • 3.  Re: CA Spectrum REST API Next Not Working

    Posted Feb 22, 2016 05:06 PM

    Pretty sure this is just working as designed. All my code starts with POST and then GET for all the Next links.



  • 4.  Re: CA Spectrum REST API Next Not Working

    Posted Feb 23, 2016 08:43 AM

    I did not see anywhere an explanation that, after performing the initial POST, I needed to change to using GET.  However, my initial tests show what you say appears to be the case.  I will proceed on this basis and update if I find otherwise.  Thank you for your suggestion.



  • 5.  RE: CA Spectrum REST API Next Not Working

    Posted Jul 06, 2020 10:23 AM
    Hi Anon and everyone

    Sorry for picking up an old topic, but I have the exact same issue. Did you managed to resolve it?

    I have a code in R which is built as follows:
    - make a POST request to collect the attributes I need from the alarms
    - make a GET request using the "next" link
    - repeat the last step until all the alarms have been collected

    It never completes the loop succesfully. It awalys stops at some point with a "NullPointerException". I say "some point" because i can't find a pattern: sometimes it fails at the 7th loop, sometimes at 8th, 11th, 2nd... Is there any adjustment needed to get them all?

    I would appreciate any help.