Rest-API call failure after upgrade to Spectrum R10.2.3

Document ID : KB000109656
Last Modified Date : 03/08/2018
Show Technical Document Details
Introduction:
When using previous working rest-api calls accessing CA Spectrum R10.1.1 these may fail when upgrading CA Spectrum to R10.2.* 

Samples:
http[s]://$HOST:<port>/spectrum/restful/alarms/count  
http[s]://$HOST:<port>/spectrum/restful/subscription
http[s]://$HOST:<port>/spectrum/restful/subscription/$SUB

Error reported/reply shows: File "/usr/lib64/python2.6/json/decoder.py", line 338, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded

Doing the rest-call via Browser may reply "http error 405"

 
Background:
CA Spectrum Rest API is changed by R10.2.* upgraded functionality.

 
Environment:
This is related to all support CA Spectrum OS-level platforms

 
Instructions:
The Restful API for CA Spectrum R10.2++ is now changed for some rest-call now requiring updated POST context.
So this could be seen as the rest-call serviced by a R10.1.* OneClick-Spectrum webserver is using default (old) POST context which allows to create a response.
This is not the case then for this same call when send to R1 0.2.* OneClick-Spectrum webserver.

Find more info here:
https://docops.ca.com/ca-spectrum/10-2-3/en/programming/web-services-api-reference/how-to-use-the-ca-spectrum-web-services-api/restful-resources-nouns

Sample coding / POST context for ./alarms/count:
https://docops.ca.com/ca-spectrum/10-2-3/en/programming/web-services-api-reference/how-to-use-the-ca-spectrum-web-services-api/restful-resources-nouns/using-alarm-resources

POST BODY CONTENT START
-------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<rs:subscription-request
    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:pull-delivery-mode>
<rs:max-notifications/>
<rs:pull-interval>5000</rs:pull-interval>

</rs:pull-delivery-mode> 
</rs:subscription-request>
-------------------------------------------
POST BODY CONTENT END

For any additional infor find more per specific examples of Subscription XML, see the following:
* In <$SPECROOT>/RestfulExamples/xml/Alarms:
* PullAlarmsSubscription.xml
* In <$SPECROOT>/RestfulExamples/xml/Models
* PullAttrWatchForAllDevices.xml
* In <$SPECROOT>/RestfulExamples/xml/MTypes:
* PullWatchForNewMTypes.xml
* PushWatchForNewMTypes.xml
* PushWatchForNewMTypesBatchMode.xml
* PushWatchForNewMTypesNoExpiration.xml


 
Additional Information:
C ASpectrum R10.2.* Rest-API:
https://docops.ca.com/ca-spectrum/10-2-3/en/programming/web-services-api-reference/how-to-use-the-ca-spectrum-web-services-api