I need some help with the REST interface to zenoss if anyone has experience.

I am trying to add locations with a script.  In the developers guide it says.

Zenoss's web interface will let you run any method of any object using a simple 
URL. Calls will be in the following format:

http://USERNAME:passw...@my_zenoss_host:8080/PATH_TO_OBJECT/METHOD_NAME?ARG=VAL

So, here are two questions.

1.  I'd like to use the manage_addLocation method that is in the 
ZenModel::Location module.  Being this is a module, I'm not sure what its 
included in and how I can access it.  I've tried going through a location, but 
that doesn't seem to work.  Is this a method that is available?  I'd like to 
use it so I can set the description and an address on a location when I create 
it.

2.  But, if that's not available, I can use the depricated method of 
addLocation on the DeviceLoader.  

/DeviceLoader/addLocation?newLocationPath=somepath

But, now i need to add an address to this location.  So, in the Location Class, 
there is a method named setAddress.  I was assuming I should use that method.  

(BTW that method does work with xmlrpc, but I get strange errors on it:
RuntimeError: wrong/unknown XML-RPC type 'nil' - but the fact that it does 
work, makes me thing I can use this method with REST as well)

ex: 

http://user:p...@localhost:8080/zport/dmd/Locations/My%20Location/setAddress?address=some%20address

But, that doesn't appear to work.

Is there an easy way to set the address (and description as a bonus) using REST?

Thanks for any help.




-------------------- m2f --------------------

Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=30218#30218

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to