Inspired from python-zenoss-client
Contributions are welcomed via PR.
git clone https://github.com/suryasr007/zenoss-client
# Then run
npm install
- Import the client
const ZenossClient = require('./zenoss_client');
- Intialize the class
b = new ZenossClient("host", "user", "pass");
- Assign router_endpoints, action, method.
b.router_endpoint = 'device_router'; //Default
b.action = "DeviceRouter"; //Default
b.method = "getDevices"; //Default
- run the 'run' function with required parameters
res = b.run({params: {name:'xxxx'}});
- The above method returns a promise
res.then((successMessage)=>{
obj = successMessage.body;
console.log(obj);
}).catch((err)=>{
console.log(err);
})
For full documentation of zenoss API, kindly refer to the link below:
json_api.sh SHELL script published on zenoss official wiki
- Conventional naming of routers
Products.Zuul.routers.device -> device_router
Products.Zuul.routers.users -> users_router
Products.Zuul.routers.triggers -> triggers_router