cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
554
Views
0
Helpful
3
Replies
Highlighted

UCCE REST API PUT method always gives changestamp exception

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
Highlighted

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
Highlighted
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 ?

Highlighted

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>

Highlighted

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