zenApiLib
Overview
zenApiLib is available at https://github.com/zenoss/zenoss-RM-api/ as an unofficial tool for leveraging the Zenoss Resource Manager and Zenoss Cloud Collection Zone APIs.
zenApiLib
- leverages Python logging library
- provides paging API support; leverage router methods' "limit" parameter to break large results from queries into manageable chunks
- API result error checking
- Content-Type JSON, return decoded JSON object
- Content-Type HTML, return error with HTML page title
- API call error checking
- Validate specified router exists
- Validate called method exists
- provides backward compatibility with
zenoss_api.ZenAPIConnector.ZenAPIConnector
- supports multiple Zenoss instance definitions in a single credential file
- credential file name defaults to
creds.cfg
and the same directory as thezenApiLib.py
file - ability to specify credential file
- credential file name defaults to
- includes the
zenApiCli.py
script for simple command line API interaction. Can be easily incorporated into existing shell scripts.
API Router Helper Libraries
Files: zenApiDeviceRouterHelper.py
, zenApiImpactRouterHelper.py
Router-specific helper libraries contain common, repeatedly-used functionality.
Leveraging zenApiLib