To change the value of model attributes, we document
PUT model
PUT model updates attributes on the specified model.
URL
http://<hostname><:portnumber>/spectrum/restful/model/<model_handle>?attr=<attr_ID>&val=<num>
HTTP Method
PUT
Body
None
Body Content
Not Used
Header
application/xml, application/json
Output
XML or JSON listing of the requested attributes
URL Parameters
Specifies the model to update.
&attr=<attr_ID>&val=<num>
Specifies the attributes and values to update. Multiple attribute-value pairs can be specified.
e.g Using a dynamic GC called “dynamic test”, which was created manually has the following value for the 0x12a6a attribute.
<search-criteria>
<filtered-models>
<equals>
<attribute id="0x1000a">
<value>3</value>
</attribute>
</equals>
</filtered-models>
</search-criteria>
Which could be used to make this query that fails with the aforementioned error.
http://localhost/spectrum/restful/model/0x4056b96?attr=0x12a6a&val=<search-criteria> <filtered-models> <equals> <attribute id="0x1000a"> <value>3</value> </attribute> </equals> </filtered-models> </search-criteria>
However, this needs to be encoded to escape certain characters.
I did this from my client automatically (ARC) as follows:
http://localhost/spectrum/restful/model/0x4056b96?attr=0x12a6a&val=%3Csearch-criteria%3E+%3Cfiltered-models%3E+%3Cequals%3E+%3Cattribute+id%3D%220x1000a%22%3E+%3Cvalue%3E3%3C%2Fvalue%3E+%3C%2Fattribute%3E+%3C%2Fequals%3E+%3C%2Ffiltered-models%3E+%3C%2Fsearch-criteria%3E
This gives the correct result