cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1132
Views
0
Helpful
3
Replies

UCCE REST API PUT method always gives changestamp exception

Peter Straatman
Level 1
Level 1

Hello

I have UCCE 11 and am using Firefox httprequester to test UCCE REST API to update an agent attribute (with the idea to write a Finesse gadget  later on).

The GET works ok (basic auth, application/xml, 10.100.206.5 being my AW/HDS/DDS

http://10.100.206.5/unifiedconfig/config/agent/5001

giving all agent details (verified all values against actual the awdb)

When trying a PUT (to change the attribute value from 3 to 4) with

<agent>
    <changeStamp>40</changeStamp>
    <agentAttributes>
        <agentAttribute>
            <attribute>
                <refURL>/unifiedconfig/config/attribute/5000</refURL>
                <name>English</name>
                <dataType>4</dataType>
            </attribute>
            <attributeValue>4</attributeValue>
        </agentAttribute>
    </agentAttributes>
</agent>

the following is returned

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<apiErrors>
    <apiError>
        <errorData>changeStamp</errorData>
        <errorMessage>Another user has changed this object.  Refresh, then try to save again.</errorMessage>
        <errorType>invalidInput.changeStamp</errorType>
    </apiError>
</apiErrors>

What am I doing wrong ?

Regards

1 Accepted Solution

Accepted Solutions

I think you need to keep the change number the same as the put.

If the Put does not change anything then the number does not increment.

View solution in original post

3 Replies 3

Sasikumar Divvela
Cisco Employee
Cisco Employee

Did you check what is the current changestamp in the database for the record which you are trying to update. 

You should pass +1 for that.

And at the same time do we need to put changestamp under attribute tab ?

thx for the quick reply

the GET gave 39 so I used 40 for changeStamp

putting changeStamp under attribute tab (or any other location) gives 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<apiErrors>
    <apiError>
        <errorData>changeStamp</errorData>
        <errorMessage>This field is required and cannot be empty.</errorMessage>
        <errorType>invalidInput.fieldRequired</errorType>
    </apiError>
</apiErrors>

I think you need to keep the change number the same as the put.

If the Put does not change anything then the number does not increment.