{ "info": { "author": "NCBI", "author_email": "python-core@ncbi.nlm.nih.gov", "bugtrack_url": null, "classifiers": [], "description": "consul-announcer\n================\n\nService announcer for `Consul`_.\n\nFunctionality:\n\n- Register/deregister services with checks\n- Spawn a subprocess\n- Periodically mark all TTL checks as passed (if any)\n\nInstall\n-------\n\nFor regular usage:\n\n.. code:: sh\n\n pip install consul-announcer # or add it as a requirement\n\nUsage\n-----\n\n.. code:: sh\n\n consul-announcer --config=\"JSON or @path\" [-h] [--agent=hostname[:port]] [--token=acl-token] [--interval=seconds] [--verbose] -- command [arguments]\n\n Arguments:\n\n -h, --help Show this help message and exit.\n --agent hostname[:port] Consul agent address: hostname[:port].\n Default: localhost (default port is 8500).\n You can also use CONSUL_ANNOUNCER_AGENT env variable.\n --config \"JSON or @path\" Consul configuration JSON (required).\n If starts with @ - considered as file path.\n You can also use CONSUL_ANNOUNCER_CONFIG env variable.\n --token acl-token Consul ACL token.\n You can also use CONSUL_ANNOUNCER_TOKEN env variable.\n --interval seconds Interval for periodic marking all TTL checks as passed, in seconds.\n Should be less than min TTL.\n You can also use CONSUL_ANNOUNCER_INTERVAL env variable.\n --verbose, -v Verbose output. You can specify -v or -vv.\n\nMinimal usage:\n\n.. code:: sh\n\n consul-announcer --config=@path/to/config.json -- some-process --with --arguments\n\n``--config``\n~~~~~~~~~~~~\n\nIt should be valid JSON that contains ``{\"service\": {...}}`` or ``{\"services\": [...]}``:\n\n.. code:: sh\n\n consul-announcer --config='{\"service\": {\"name\": \"test service\", \"check\": {\"ttl\": \"10s\"}}}' -- ...\n\nIf starts with ``@`` - considered as file path:\n\n.. code:: sh\n\n consul-announcer --config=@path/to/config.json -- ...\n\nRead `Consul docs about services definition`_.\n\nAll the services & checks will be registered on process start and deregistered on process termination.\n\nYou can also use ``CONSUL_ANNOUNCER_CONFIG`` env variable.\n\n``--interval``\n~~~~~~~~~~~~~~\n\nIn the example above, the interval is not specified so it'll be calculated as min TTL / 10 (if there are TTL checks specified in the config). But you can provide your own value *(in seconds)*:\n\n.. code:: sh\n\n consul-announcer --interval=3 ...\n\nIf there are no TTL checks and no ``--interval`` - an error will raise.\n\nYou can also use ``CONSUL_ANNOUNCER_INTERVAL`` env variable.\n\n``--address``\n~~~~~~~~~~~~~\n\nDefault agent address is ``localhost`` (with default port ``8500``). You can provide your own:\n\n.. code:: sh\n\n consul-announcer --agent=1.2.3.4:5678 ...\n\nYou can also use ``CONSUL_ANNOUNCER_AGENT`` env variable.\n\n``--token``\n~~~~~~~~~~~\n\nConsul ACL token. Required only in you've enabled ACL in your Consul agent.\n\n.. code:: sh\n\n consul-announcer --token=01234567-89ab-cdef-0123-456789abcdef ...\n\nYou can also use ``CONSUL_ANNOUNCER_TOKEN`` env variable.\n\n``--verbose``\n~~~~~~~~~~~~~\n\nOutput levels:\n\n- by default only errors and warnings are printed\n- ``-v`` will show info messages\n- ``-vv`` will show info and debug messages\n\nUsage in Python code\n~~~~~~~~~~~~~~~~~~~~\n\n.. code:: py\n\n from announcer.service import Service\n\n service = Service('localhost:1234', '@/path/to/config.json', ['sleep', '5'], '01234567-89ab-cdef-0123-456789abcdef', 0.5)\n service.run()\n\nDevelopment\n-----------\n\nInstall\n~~~~~~~\n\n.. code:: sh\n\n git clone \n cd consul-announcer\n pip install -r requirements/test.txt -e .\n\nTest\n~~~~\n\nTest configuration is defined in the ``tox.ini`` file and includes ``py.test`` tests and ``flake8`` source code checker. You can run all of the tests:\n\n.. code:: sh\n\n python setup.py test\n\nTo run just the ``py.test`` tests, not ``flake8``, and to re-use the current ``virtualenv``:\n\n.. code:: sh\n\n py.test\n\nRelease\n~~~~~~~\n\n- Tests must be passing\n- Don't forget to test all added functionality\n- Update ``CHANGELOG`` with the release info\n- Update ``README`` *(if necessary)*\n- Commit all the changes\n- Create new version tag *(e.g.)*: ``v1.2.3``\n- Push commits and tags\n- Release new version on PyPI\n\n.. _Consul: https://www.consul.io/\n.. _Consul docs about services definition: https://www.consul.io/docs/agent/services.html", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ncbi/consul-announcer", "keywords": null, "license": "NCBI license", "maintainer": null, "maintainer_email": null, "name": "consul-announcer", "package_url": "https://pypi.org/project/consul-announcer/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/consul-announcer/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ncbi/consul-announcer" }, "release_url": "https://pypi.org/project/consul-announcer/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "1.0.1" }, "last_serial": 2515231, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "d7150784d1226f73ff91802597df5d01", "sha256": "2439ccbc02aa916616a40bd8c0be33009a903a6fc9e272713b5293c990a76275" }, "downloads": -1, "filename": "consul-announcer-0.5.0.tar.gz", "has_sig": false, "md5_digest": "d7150784d1226f73ff91802597df5d01", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7478, "upload_time": "2016-09-24T20:12:01", "url": "https://files.pythonhosted.org/packages/4a/6b/94c012bdc16da6c8e27e4ac8d5fe1d8c4f2b35806ec85686b9651d73d271/consul-announcer-0.5.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "5cdc9e39c215b8eec7c9650f4bcdd50d", "sha256": "4e8cac388214228ceb2f148fa6e18c438d9c316185a055a3594f461591c33d51" }, "downloads": -1, "filename": "consul-announcer-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5cdc9e39c215b8eec7c9650f4bcdd50d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8070, "upload_time": "2016-10-03T19:08:16", "url": "https://files.pythonhosted.org/packages/6f/d8/ca7d623327c13df254c259c0e5b96f6bca8fd34c34efd8fe14854c15172f/consul-announcer-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "2fa7d91bcd717cc1a150d0690f403d17", "sha256": "826158f56f633f3a6fd71bc095c2ed461522ffe021721acbc9d0637339ccb5c6" }, "downloads": -1, "filename": "consul-announcer-1.0.1.tar.gz", "has_sig": false, "md5_digest": "2fa7d91bcd717cc1a150d0690f403d17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8171, "upload_time": "2016-12-12T22:52:31", "url": "https://files.pythonhosted.org/packages/ba/f5/2381aae41d42ace6802166676e5840248c62893004c57851f410761cef2d/consul-announcer-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2fa7d91bcd717cc1a150d0690f403d17", "sha256": "826158f56f633f3a6fd71bc095c2ed461522ffe021721acbc9d0637339ccb5c6" }, "downloads": -1, "filename": "consul-announcer-1.0.1.tar.gz", "has_sig": false, "md5_digest": "2fa7d91bcd717cc1a150d0690f403d17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8171, "upload_time": "2016-12-12T22:52:31", "url": "https://files.pythonhosted.org/packages/ba/f5/2381aae41d42ace6802166676e5840248c62893004c57851f410761cef2d/consul-announcer-1.0.1.tar.gz" } ] }