{ "info": { "author": "Ben Roberts", "author_email": "me@benroberts.net", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "# py-mco-agent\n\n## Overview\n\n`py-mco-agent` contains a collection of tools for writing mcollective agents in the Python language.\n\n## Installation\n\n pip install py-mco-agent\n\nThis library requires a version of Choria with external agent support.\n\n## Implementing Agents\n\nThe bare minimum steps to implement a python mcollective agent are:\n\n* Add a python file without a `.py` extension to `/opt/puppetlabs/mcollective/plugins/mcollective/agent/parrot`\n\n```python\n #!/usr/bin/python3\n from mco_agent import Agent, action, dispatch, register_actions\n\n # Subclass Agent and decorate it with the @register_actions\n @register_actions\n class Parrot(Agent):\n\n # Create a class method for your action and decorate it with @action\n @action\n def echo(self):\n # This example action just repeats the message input back to the caller\n prefix = self.config.get('prefix', '')\n if not prefix:\n self.logger.warning(\"Using default prefix!\")\n self.reply.data['message'] = prefix + self.request.data['message']\n\n if __name__ == '__main__':\n dispatch(Parrot)\n```\n\n* Add a choria JSON DDL file to the same location named `parrot.json` (see `examples/parrot.json`)\n\n## Reference\n\n### Agent\n\nProvides a base class for implementing mcollective agents\n\nPublic methods:\n\n- `should_activate`\n Returns a boolean value to indicate whether the agent should be activated on this host.\n By default returns True and the agent is always activated. Subclasses may choose to override\n this method and deactivate themselves under appropriate conditions such as missing pre-requisites.\n\nDecorators:\n\n- `@action`\n Instance methods should be decorated with the `@action` decorator to register them as available agent actions\n- `@register_actions`\n The plugin class should be decorated with this method to trigger registration all action methods within\n\nInstance variables:\n\n- `logger`\n Contains a python logger which can be used to send log information back to choria (debug and info are sent to stdout,\n which is only displayed in verbose mode; warnings and errors are sent to stderr which are displayed always).\n The logger is set to use the `mcorpc.agent_name` hierarchy. By default all other logging is disabled to prevent\n pollution of the mcorpc reply. This is done by setting the log level on the root logger to 100. You can re-enable\n logging by adjusting the log-level on either the root logger or a specific child if required.\n- `config`\n Contains a dict-like object which can be used to read configuration settings from the agent's choria plugin\n configuration file (`/etc/puppetlabs/mcollective/plugin.d/agentname.cfg` by default).\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/optiz0r/py-mco-agent", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "py-mco-agent", "package_url": "https://pypi.org/project/py-mco-agent/", "platform": "", "project_url": "https://pypi.org/project/py-mco-agent/", "project_urls": { "Homepage": "https://github.com/optiz0r/py-mco-agent" }, "release_url": "https://pypi.org/project/py-mco-agent/0.3.2/", "requires_dist": null, "requires_python": ">=2.6", "summary": "A library for implementing Mcollecting agents in Python", "version": "0.3.2" }, "last_serial": 5869486, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ef44ec3e3efd258523c8e52b264bcfb2", "sha256": "4fba0af2725560e5ba7fd279d9111f7308e2733c18669f4d4838215ff1383375" }, "downloads": -1, "filename": "py_mco_agent-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ef44ec3e3efd258523c8e52b264bcfb2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.6", "size": 15999, "upload_time": "2019-09-18T11:43:41", "url": "https://files.pythonhosted.org/packages/3e/54/a6bfb3cfb756d2236b9985c07032e8dc87fb5dd50594a5cadcafa68f53b0/py_mco_agent-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "040d8389004f161a03b4132ba8b05d5d", "sha256": "9a93eba56d4f42a86135b96dc24fe45bc429c39b119930ccbdbf2a0545bd3f0f" }, "downloads": -1, "filename": "py-mco-agent-0.1.tar.gz", "has_sig": false, "md5_digest": "040d8389004f161a03b4132ba8b05d5d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 13369, "upload_time": "2019-09-18T11:43:43", "url": "https://files.pythonhosted.org/packages/27/f2/b85d3bf2e333643c9ccdc71d137b5b657ce13ca3515ca025f666b11f226f/py-mco-agent-0.1.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "a927866fdaf1239249822c86ed33b684", "sha256": "72a8f89d3a640c8a7d9c000f735ee9756b7a94b8119978df5a98e9ee2dda7243" }, "downloads": -1, "filename": "py_mco_agent-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "a927866fdaf1239249822c86ed33b684", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.6", "size": 18378, "upload_time": "2019-09-19T12:42:24", "url": "https://files.pythonhosted.org/packages/5d/ef/66995723c0a52c67695537d294999040695dc110540280d0c445e3385098/py_mco_agent-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e053d668dd7dbb431282f54510a35646", "sha256": "653399b3cd1487ca92a599179e8506b00267f9acd22af95eaf16eb89f01fc432" }, "downloads": -1, "filename": "py-mco-agent-0.3.tar.gz", "has_sig": false, "md5_digest": "e053d668dd7dbb431282f54510a35646", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 14606, "upload_time": "2019-09-19T12:42:26", "url": "https://files.pythonhosted.org/packages/86/63/03c01c6f73d9cd488cec96b6e07e3b702050576e0179f88bf575bea47215/py-mco-agent-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "8e556e66a2c5f770fc3fe7b2bb3d66f7", "sha256": "9b8fcb9222c5d06281546adbfe66d2ce1e739ac827b2ebb4aacd8a7cee35c71f" }, "downloads": -1, "filename": "py_mco_agent-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8e556e66a2c5f770fc3fe7b2bb3d66f7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.6", "size": 12413, "upload_time": "2019-09-19T20:02:35", "url": "https://files.pythonhosted.org/packages/37/d4/6c6406a4e1a8f8e29bf16708fd12f1af8f179ae1012da9be4318493fa2b4/py_mco_agent-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "af60bfca167581e84193c8d13c0614a4", "sha256": "8bd6341d6937c01b927cbceb661e4a095468bb3febb26fbeb9445108afec5b53" }, "downloads": -1, "filename": "py-mco-agent-0.3.1.tar.gz", "has_sig": false, "md5_digest": "af60bfca167581e84193c8d13c0614a4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 6506, "upload_time": "2019-09-19T20:02:37", "url": "https://files.pythonhosted.org/packages/2b/60/0a1e64dcb5c341cab9c6f6483de45f043748753d26d91888860669128aa9/py-mco-agent-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "11a6cb84b423273fdaf053f8c452c230", "sha256": "3cc96a3645311ce6aa93c4952f94da00950f133b693c00be79b8a079185a2c96" }, "downloads": -1, "filename": "py_mco_agent-0.3.2-py3-none-any.whl", "has_sig": false, "md5_digest": "11a6cb84b423273fdaf053f8c452c230", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.6", "size": 14996, "upload_time": "2019-09-22T15:45:46", "url": "https://files.pythonhosted.org/packages/7d/80/15c7bb85a546648afd425cac3431d9669b128ce611f5e24104110a17e66b/py_mco_agent-0.3.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9460344f151093482591200b0464b96d", "sha256": "a55af34a84004e4e16bf13184795562cfcda6c4e9a0428be199e16b471138824" }, "downloads": -1, "filename": "py-mco-agent-0.3.2.tar.gz", "has_sig": false, "md5_digest": "9460344f151093482591200b0464b96d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 7384, "upload_time": "2019-09-22T15:45:47", "url": "https://files.pythonhosted.org/packages/32/f6/5e8fafbb9ab440137a133b7921496e059d5378828a98c06f25c6ad73d7fd/py-mco-agent-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "11a6cb84b423273fdaf053f8c452c230", "sha256": "3cc96a3645311ce6aa93c4952f94da00950f133b693c00be79b8a079185a2c96" }, "downloads": -1, "filename": "py_mco_agent-0.3.2-py3-none-any.whl", "has_sig": false, "md5_digest": "11a6cb84b423273fdaf053f8c452c230", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.6", "size": 14996, "upload_time": "2019-09-22T15:45:46", "url": "https://files.pythonhosted.org/packages/7d/80/15c7bb85a546648afd425cac3431d9669b128ce611f5e24104110a17e66b/py_mco_agent-0.3.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9460344f151093482591200b0464b96d", "sha256": "a55af34a84004e4e16bf13184795562cfcda6c4e9a0428be199e16b471138824" }, "downloads": -1, "filename": "py-mco-agent-0.3.2.tar.gz", "has_sig": false, "md5_digest": "9460344f151093482591200b0464b96d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.6", "size": 7384, "upload_time": "2019-09-22T15:45:47", "url": "https://files.pythonhosted.org/packages/32/f6/5e8fafbb9ab440137a133b7921496e059d5378828a98c06f25c6ad73d7fd/py-mco-agent-0.3.2.tar.gz" } ] }