Zenoss API client for python
pip install python-zenoss-client
- Connect
from zenoss_client import ZenossClient
api = ZenossClient(host="localhost", user="zenuser", passwd="*****")
- API call: The long way
endpoint = api.endpoint('device_router')
action = endpoint.action('DeviceRouter')
method = action.method('getDevices')
method(params={'name': 'testdevice'})
- API call: The sorter way
api.endpoint('device_router').action('DeviceRouter').method('getDevices')(params={'name': 'testdevice'})
- API call: The sortest way
api.device_router.DeviceRouter.getDevices(params={'name': 'testdevice'})
- With timeout
api.device_router.DeviceRouter.getDevices(params={'name': 'testdevice'}, timeout=10)
This module is inspired by json_api.sh SHELL script published on zenoss official wiki
For full documentation of zenoss API, kindly refer to the link below:
- Conventional naming of routers
Products.Zuul.routers.device -> device_router
Products.Zuul.routers.users -> users_router
Products.Zuul.routers.triggers -> triggers_router