In REST Call, Post method of get Models, If body contains attribute ID: AttributeID.MODEL_NAME, an Invalid attribute ID error is thrown

Document ID : KB000004870
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

In REST Call, Post method of get Models, If body contains attribute ID:

AttributeID.MODEL_NAME, an Invalid attribute ID error is thrown

Environment:
Any
Resolution:

Pass the Hex value of AttributeID.MODEL_NAME, instead of String.

In the PayLoad of RestAPI for the post call, to fetch the alarms along with Spectrum attributes we must use hex values instead of Strings. For Ex:

Below is the payload

<rs:alarm-request xmlns:rs="http://www.ca.com/spectrum/restful/schema/request" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throttlesize="1000" xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd ">

<rs:attribute-filter>

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

<filtered-models>

<or>

<equals>

<attribute id="0x11f56">

<value>3</value>

</attribute>

</equals>

<equals>

<attribute id="0x11f56">

<value>2</value>

</attribute>

</equals>

<equals>

<attribute id="0x11f56">

<value>1</value>

</attribute>

</equals>

</or>

</filtered-models>

</search-criteria>

</rs:attribute-filter>

<!--

 following are requested SPectrum attributes with each alarm 

-->

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

<!--  Alarm Title  -->

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

<!--  Alarm Severity  -->

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

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

</rs:alarm-request>

In this case, for the requested attributes tag, always the hex value is expected instead of AttributeID.MODEL_NAME