TECHZEN Zenoss User Community ARCHIVE  

getZenProperty

Subject: getZenProperty
Author: [Not Specified]
Posted: 2015-06-20 09:39

What am I doing wrong here

curl http://zenoss:8080/zport/device_router -u user:pw -H 'Content-Type: application/json'--data-binary '{"action":"DeviceRouter","method":"getZenProperty","data":[{"zProperty":"cLatitude","uid":"\/zport\/dmd\/Devices\/Network\/MikroTik\/devices\/10.15.22.60"}],"tid":1,"type":"rpc"}'

My URL is based on: http://www.zenoss.org/forum/1611 but I'm getting this:
Traceback (most recent call last):
File "/opt/zenoss/lib/python/ZPublisher/Publish.py", line 126, in publish
request, bind=1)
File "/opt/zenoss/lib/python/ZPublisher/mapply.py", line 77, in mapply
if debug is not None: return debug(object,args,context)
File "/opt/zenoss/lib/python/ZPublisher/Publish.py", line 46, in call_object
result=apply(object,args) # Type s<cr> to step into published object.
File "/opt/zenoss/Products/ZenUtils/extdirect/zope/router.py", line 23, in __call__
return super(ZopeDirectRouter, self).__call__(body)
File "/opt/zenoss/Products/ZenUtils/jsonutils.py", line 156, in inner
return json(value(*args, **kwargs))
File "/opt/zenoss/Products/ZenUtils/extdirect/router.py", line 117, in __call__
raise DirectException("Request body is not unjson()-able: %s" % body)
DirectException: Request body is not unjson()-able: None



Subject: Now, testing on Zenoss 5 I
Author: [Not Specified]
Posted: 2015-06-20 10:14

Now, testing on Zenoss 5 I get this which apparently means that the API was changed despite what I read here :(

Traceback (most recent call last):
File "/opt/zenoss/lib/python2.7/site-packages/ZPublisher/Publish.py", line 126, in publish
request, bind=1)
File "/opt/zenoss/lib/python2.7/site-packages/ZPublisher/mapply.py", line 77, in mapply
if debug is not None: return debug(object,args,context)
File "/opt/zenoss/lib/python2.7/site-packages/ZPublisher/Publish.py", line 46, in call_object
result=apply(object,args) # Type s<cr> to step into published object.
File "/opt/zenoss/Products/ZenUtils/extdirect/zope/router.py", line 22, in __call__
return super(ZopeDirectRouter, self).__call__(body)
File "/opt/zenoss/Products/ZenUtils/jsonutils.py", line 156, in inner
return json(value(*args, **kwargs))
File "/opt/zenoss/Products/ZenUtils/extdirect/router.py", line 131, in __call__
directResponses.append(self._processDirectRequest(directRequest))
File "/opt/zenoss/Products/ZenUtils/extdirect/router.py", line 161, in _processDirectRequest
method, clsname
DirectException: 'getZenProperty' is not the name of a method on DeviceRouter



< Previous
IIS Service xxxxxxxxxxxx is in Running state
  Next
Cleanup after 5.0.2 to 5.0.3 upgrade (and a few bonus questions)
>