TECHZEN Zenoss User Community ARCHIVE  

getDevices with production state filtering returns no devices

Subject: getDevices with production state filtering returns no devices
Author: [Not Specified]
Posted: 2015-12-14 07:29

I am calling the JSON API using Java on Zenoss 4.2.3, specifically the getDevices call which works great until I add a parameter to filter the devices by their production state. If I do this I get no devices at all. Have tried passing in both the numeric (eg 1000) and string value (eg Production) to no avail. I am using "productionState" as the key in the params object eg. params.put("productionState", "1000");

Using anything other than "productionState" as the key returns an error so it seems to be the correct parameter name, but I'm always getting back 0 devices.

Thanks.



Subject: Read API documentation. Or
Author: Jan Garaj
Posted: 2015-12-14 14:08

Read API documentation. Or check web console - used parameters, example: http://s4.postimg.org/4t10qfua4/Capture.jpg

Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.

DevOps stack: Docker / Kubernetes / Mesos / Zabbix / Zenoss / Grafana / Puppet / Ansible / Vagrant / Terraform / Elasticsearch



Subject: Thanks for that, the value
Author: [Not Specified]
Posted: 2015-12-15 05:45

Thanks for that, the value for the parameter productionState needs to be a Set, at least in Java. Got it working now cheers :)



< Previous
zenoss core 5
  Next
No JSON object decoded error - Zenoss Core upgrade 5.0.5 to 5.0.9
>