# Zenoss API Client
![Tests badge](https://github.com/dan-smalley/zenAPIClient/actions/workflows/test_and_lint.yml/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/zenapiclient/badge/?version=latest)](https://zenapiclient.readthedocs.io/en/latest/?badge=latest)
[![Coverage Status](https://dan-smalley.github.io/zenAPIClient/coveragecoverage-badge.svg?dummy=8484744)](https://dan-smalley.github.io/zenAPIClient/index.html)
![PyPI - Version](https://img.shields.io/pypi/v/zenAPIClient?logo=pypi&label=PyPI)
![GitHub Release](https://img.shields.io/github/v/release/dan-smalley/zenAPIClient?include_prereleases&logo=github&label=Release)
![TestPyPI - Version](https://img.shields.io/pypi/v/zenAPIClient?pypiBaseUrl=https%3A%2F%2Ftest.pypi.org&logo=pypi&label=TestPyPI)
Python module for interacting with the Zenoss API in an object-oriented way.
Tested with Zenoss Cloud, no guarantees for earlier versions...
The philosophy here is to use objects to work with everything in the Zenoss API, and to try to normalize the various calls to the different routers.
Thus `get` methods will always return an object, `list` methods will return data.
All methods to add or create start with `add`, all remove or delete start with `delete`.
As much as possible the methods try to hide the idiosyncrasies of the JSON API, and to do the work for you, for example by letting you use a device name instead of having to provide the full device UID for every call.
## Installing
```
pip install zenAPIClient
## Using
In [1]: from zenossapi import apiclient as zapi
In [2]: zenoss_client = zapi.Client(host=zenurl, collection_zone='cz0', api_key=zenApiKey)
In [3]: device_router = zenoss_client.get_router('device')
In [4]: device_class = device_router.get_device_class('Server/SSH/Linux')
In [5]: my_server = device_class.get_device('my.server.example.com')
In [6]: remodel_job = my_server.remodel()
In [7]: print(remodel_job)
9ba5c8d7-58de-4f18-96fe-d362841910d3
```
Supports the Zenoss JobsRouter, DeviceRouter, TemplateRouter, EventsRouter, PropertiesRouter, MonitorRouter, CMDBRouter, and DeviceManagementRouter.
Raw data
{
"_id": null,
"home_page": null,
"name": "zenAPIClient",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "zenoss, monitoring, api",
"author": null,
"author_email": "Dan Smalley <zenapiclient@smalley.link>",
"download_url": "https://files.pythonhosted.org/packages/a9/2d/3e8c51475d0c0e54aace0e220f14b03a173f14627cebca0a7164f7b9db60/zenapiclient-1.0.3.tar.gz",
"platform": null,
"description": "# Zenoss API Client\n\n![Tests badge](https://github.com/dan-smalley/zenAPIClient/actions/workflows/test_and_lint.yml/badge.svg) \n[![Documentation Status](https://readthedocs.org/projects/zenapiclient/badge/?version=latest)](https://zenapiclient.readthedocs.io/en/latest/?badge=latest) \n[![Coverage Status](https://dan-smalley.github.io/zenAPIClient/coveragecoverage-badge.svg?dummy=8484744)](https://dan-smalley.github.io/zenAPIClient/index.html)\n![PyPI - Version](https://img.shields.io/pypi/v/zenAPIClient?logo=pypi&label=PyPI)\n![GitHub Release](https://img.shields.io/github/v/release/dan-smalley/zenAPIClient?include_prereleases&logo=github&label=Release)\n![TestPyPI - Version](https://img.shields.io/pypi/v/zenAPIClient?pypiBaseUrl=https%3A%2F%2Ftest.pypi.org&logo=pypi&label=TestPyPI) \n\n\n\nPython module for interacting with the Zenoss API in an object-oriented way.\nTested with Zenoss Cloud, no guarantees for earlier versions...\n\nThe philosophy here is to use objects to work with everything in the Zenoss API, and to try to normalize the various calls to the different routers.\nThus `get` methods will always return an object, `list` methods will return data.\nAll methods to add or create start with `add`, all remove or delete start with `delete`.\nAs much as possible the methods try to hide the idiosyncrasies of the JSON API, and to do the work for you, for example by letting you use a device name instead of having to provide the full device UID for every call.\n\n## Installing\n\n```\npip install zenAPIClient\n\n\n## Using\n\nIn [1]: from zenossapi import apiclient as zapi\n\nIn [2]: zenoss_client = zapi.Client(host=zenurl, collection_zone='cz0', api_key=zenApiKey)\nIn [3]: device_router = zenoss_client.get_router('device')\nIn [4]: device_class = device_router.get_device_class('Server/SSH/Linux')\nIn [5]: my_server = device_class.get_device('my.server.example.com')\nIn [6]: remodel_job = my_server.remodel()\nIn [7]: print(remodel_job)\n9ba5c8d7-58de-4f18-96fe-d362841910d3\n```\n\nSupports the Zenoss JobsRouter, DeviceRouter, TemplateRouter, EventsRouter, PropertiesRouter, MonitorRouter, CMDBRouter, and DeviceManagementRouter.\n",
"bugtrack_url": null,
"license": "ZenossAPIClient Copyright 2024 [Dan Smalley](https://github.com/dan-smalley). Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. This file incorporates work covered by the following copyright: Copyright 2017 Zuora, Inc. Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
"summary": "Zenoss API client module",
"version": "1.0.3",
"project_urls": {
"Documentation": "https://zenapiclient.readthedocs.io",
"Homepage": "https://github.com/dan-smalley/zenAPIClient",
"Repository": "https://github.com/dan-smalley/zenAPIClient.git"
},
"split_keywords": [
"zenoss",
" monitoring",
" api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a4fc36cfeed1b2551057d041ba761d62453c54f9a227715345752f9eff732db0",
"md5": "4ec2ee5aef7778241c03d0560cdc5d37",
"sha256": "0913e2065e3cdd2fdc8606b33acd47812a7ffed2099427249b8b30ba67013f5a"
},
"downloads": -1,
"filename": "zenAPIClient-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4ec2ee5aef7778241c03d0560cdc5d37",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 38891,
"upload_time": "2024-05-28T19:51:00",
"upload_time_iso_8601": "2024-05-28T19:51:00.089344Z",
"url": "https://files.pythonhosted.org/packages/a4/fc/36cfeed1b2551057d041ba761d62453c54f9a227715345752f9eff732db0/zenAPIClient-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a92d3e8c51475d0c0e54aace0e220f14b03a173f14627cebca0a7164f7b9db60",
"md5": "af36ced59b0e4844c9f9f185d99f57ae",
"sha256": "d8762de13114923703613e6412742fe90bc229dc2ce44d41af4cef1775d89265"
},
"downloads": -1,
"filename": "zenapiclient-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "af36ced59b0e4844c9f9f185d99f57ae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 33172,
"upload_time": "2024-05-28T19:51:01",
"upload_time_iso_8601": "2024-05-28T19:51:01.327004Z",
"url": "https://files.pythonhosted.org/packages/a9/2d/3e8c51475d0c0e54aace0e220f14b03a173f14627cebca0a7164f7b9db60/zenapiclient-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-28 19:51:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dan-smalley",
"github_project": "zenAPIClient",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "zenapiclient"
}