RESTful POST Subscription 400 Bad Request

book

Article ID: 221729

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction


Some subscriptions are failing to post, using the same XML structure but different model types. Is there a max amount of subscriptions Spectrum can handle? At most, I can get two running concurrently.






Example of Subscription Payloads used

Payload 1

<rs:subscription-request xmlns:rs="http://www.ca.com/spectrum/restful/schema/request" xmlns:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<rs:pull-delivery-mode>
<rs:max-notifications>50</rs:max-notifications>
<rs:pull-interval>5000</rs:pull-interval>
</rs:pull-delivery-mode>
<rs:model-request>
<rs:target-models>
<rs:models-search>
<rs:search-criteria xmlns="http://www.ca.com/spectrum/restful/schema/filter">
<filtered-models>
<or>
<equals>
<model-type>Aironet</model-type>
</equals>
<equals>
<model-type>HPProCurve</model-type>
</equals>
<equals>
<model-type>Rtr_Cisco</model-type>
</equals>
<equals>
<model-type>CiscoNXOS</model-type>
</equals>
</or>
</filtered-models>
</rs:search-criteria>
</rs:models-search>
</rs:target-models>
<rs:requested-attribute id="0x1006e"/>
<rs:requested-attribute id="0x1000a"/>
<rs:requested-attribute id="0x10000"/>
<rs:requested-attribute id="0x100c5"/>
<rs:requested-attribute id="0x100cb"/>
<rs:requested-attribute id="0x1000a"/>
<rs:requested-attribute id="0x118b9"/>
<rs:requested-attribute id="0x110ed"/>
<rs:requested-attribute id="0x10013"/>
<rs:requested-attribute id="0x12d7f"/>
</rs:model-request>
</rs:subscription-request>





Payload2

<rs:subscription-request xmlns:rs="http://www.ca.com/spectrum/restful/schema/request" xmlns:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<rs:pull-delivery-mode>
<rs:max-notifications>50</rs:max-notifications>
<rs:pull-interval>5000</rs:pull-interval>
</rs:pull-delivery-mode>
<rs:model-request>
<rs:target-models>
<rs:models-search>
<rs:search-criteria xmlns="http://www.ca.com/spectrum/restful/schema/filter">
<filtered-models>
<or>
<equals>
<model-type>Gen_IF_Port</model-type>
</equals>
<equals>
<model-type>Rtr_Cisco</model-type>
</equals>
<equals>
<model-type>Pingable</model-type>
</equals>
</or>
</filtered-models>
</rs:search-criteria>
</rs:models-search>
</rs:target-models>
<rs:requested-attribute id="0x1006e"/>
<rs:requested-attribute id="0x1000a"/>
<rs:requested-attribute id="0x10000"/>
<rs:requested-attribute id="0x100c5"/>
<rs:requested-attribute id="0x100cb"/>
<rs:requested-attribute id="0x1000a"/>
<rs:requested-attribute id="0x118b9"/>
<rs:requested-attribute id="0x110ed"/>
<rs:requested-attribute id="0x10013"/>
<rs:requested-attribute id="0x12d7f"/>
</rs:model-request>
</rs:subscription-request>






Cause


The search criteria for the 3rd payload (not provided) contained model-types that did not exist in
   the older environment the rest query was run against.

Environment

Release : 10.x.x / 20.x / 21.x

Component : Spectrum OneClick

Resolution


As the older environment did not contain the model types requested in the query the call needed
  to be adjusted for ones that did or eliminate the call alltogether

 

Additional Information


Note: A Spectrum RESTful Subscription expires if

- not polled within 5x the specified pull-interval
- OneClick is restarted


Attachments