Hello, I was using openNMS 1.10.13, so far so good, but I have to update to 
latest stable (1.12.5).

But I have a problem, my code that was using the REST Api, doesn't work anymore 
when I want to update (via PUT) the ip addr of a node of a certain requisition.

Here is the problem : my code do a put on this url : 
http://192.9.10.85:8980/opennms/rest/requisitions/test/nodes/node_102_111/interfaces/10.200.102.111
I then have an error with a 404 return code. When I tried to browse the url, it 
doesn't respond (in fact I am receiving a bogus error, telling me that foreign 
id 'node_102_111' is not found in the 'test' requisition, but in fact the error 
message should be fact the interface is not found in the node).

After a quick search I have to change the url to find it : 
http://192.9.10.85:8980/opennms/rest/requisitions/test/nodes/node_102_111/interfaces/new_ip_here


I then tried to reproduce it with curl for debug purpose :

curl -v -X PUT \
        -H "Content-Type: application/x-www-form-urlencoded" \
        -d "ip-addr=new ip" \
        -u admin:admin \
        
http://localhost:8980/opennms/rest/requisitions/test/nodes/node_102_111/interfaces/10.200.102.111

Here is the result :

* About to connect() to localhost port 8980 (#0)
*   Trying ::1... connected
* Connected to localhost (::1) port 8980 (#0)
* Server auth using Basic with user 'admin'
> PUT 
> /opennms/rest/requisitions/test/nodes/node_102_111/interfaces/10.200.102.111 
> HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.19.7 (i686-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 
> zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8980
> Accept: */*
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 22
>
< HTTP/1.1 303 See Other
< Set-Cookie: JSESSIONID=7sah2nz97sf81apzb3d2fdxz;Path=/opennms
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Location: 
http://localhost:8980/opennms/rest/requisitions/test/nodes/node_102_111/interfaces/10.200.102.111
< Content-Length: 0
< Server: Jetty(7.6.12.v20130726)
<
* Connection #0 to host localhost left intact
* Closing connection #0


The SEE OTHER response seems to reply with the wrong url, and my code try to 
fetch a response to an url that doesn't work anymore.

Is it a bug ? or do I do something wrong (it worked for the version 1.10.13).


Note : the wiki is wrong on the curl sample, using application/xml fire a 415 
Unsupported Media Type, I have to use application/x-www-form-urlencoded


Thanks for helping me.


--
Nicolas V.

------------------------------------------------------------------------------
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

Reply via email to