{ "info": { "author": "wuwentao", "author_email": "wwtg99@126.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "Consul Utils\n============\n\n\n# Introduction\n\n[Consul](https://www.consul.io/) is a highly available and distributed service discovery and KV store designed with support for the modern data center. Consul provides a useful UI but it is not convenient for automation and batch processing. Consul-utils is a useful command line tool for these jobs based on Consul's API.\n\n# Installation\n\nInstallation is easy by pip\n```\npip install consul_utils\n```\n\n# Usage\n\nShow help by\n```\nconsul_utils --help\n```\n\nConsul-utils provides several useful tools to handle Consul.\n\n## Configuration\n\nFirst you should create a configuration file to save common settings like below:\n\n```\n# consul configuration\nconsul:\n # consul host\n host: \"test.consul.com\"\n # consul port\n port: 8500\n # consul scheme\n scheme: \"http\"\n # consul ACL token\n token: \"\"\n # default root\n root: \"\"\n# cache configuration\ncache:\n # cache enabled or not\n cache_enabled: true\n # cache file\n cache_dir: \".consul_cache\"\n # cache expire seconds\n cache_ttl: 600\n# log configuration\nlog:\n # log level\n log_level: \"INFO\"\n# output configuration\nreporter:\n # result output type, text, json or csv\n output_type: \"text\"\n # result output file, leave empty to print to console\n output_file: \"\"\n # output all scan data\n show_all_scan: false\n # output filtered data\n show_filtered: true\n # output not filtered data\n show_no_filtered: false\n # output flags data\n show_flags: false\n# search command configuration\nsearch:\n # search results limit\n limit: 10\n # search fields, keys or values\n fields: \"keys\"\n # use regex for search or not\n regex: false\n```\n\nSave this file to `config.yml`, remember it is not required and all settings can be specified by command line option. If same settings exists both in config file and options, the options value will override config file.\n\n## Dump Consul key values\n\nDump key and values\n\n```\nconsul_utils dump -c config.yml\n```\n\nSpecify directory\n\n```\nconsul_utils dump -c config.yml -r test/test_root\n```\n\nChange output type, text (default), json or csv\n\n```\nconsul_utils dump -c config.yml -r test/test_root -x json\n```\n\nOutput to file instead of console\n\n```\nconsul_utils dump -c config.yml -r test/test_root -o out.txt\n```\n\n## Search in the Consul key values\n\nSearch keys that contains `test`\n```\nconsul_utils search -c config.yml -q test\n```\n\nSearch values that contains `test`\n\n```\nconsul_utils search -c config.yml -q test -f values\n```\n\nLimit output result number, default 10\n\n```\nconsul_utils search -c config.yml -q test --limit 5\n```\n\nUse regex to search\n\n```\nconsul_utils search -c config.yml -q ^test$ -e\n```\n\n## Copy key values from one place to another\n\nCopy key values under source root to target root\n\n```\nconsul_utils copy -c config.yml --root test/source --target-root test/target\n```\n\n## Compare two key values\n\nCompare two key values and all sub key values under two specified root\nThis command will compare all values for keys with the same relative path.\n\n```\nconsul_utils diff -c config.yml --root1 test1/aa --root2 test2/bb\n```\n\nCompare key values from two different host. If not specified, will use the default (host, port, scheme, token) settings.\n\n```\nconsul_utils diff -c config.yml --host1 test1.consul.com --root1 test1/aa --host2 test2.consul.com --root2 test2/bb\n```\n\n# Tests\n\nPrepare a consul node at http://test.consul.com:8500 (you can change hosts file).\n\ninstall pytest and run by pytest\n\n```\npytest\n```\n\n# Authors\n\nWu Wentao\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/wwtg99/consul_utils", "keywords": "consul,key_value,search,diff", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "consul-utils", "package_url": "https://pypi.org/project/consul-utils/", "platform": "", "project_url": "https://pypi.org/project/consul-utils/", "project_urls": { "Homepage": "https://github.com/wwtg99/consul_utils" }, "release_url": "https://pypi.org/project/consul-utils/0.1.3/", "requires_dist": [ "hsettings (>=0.1)", "python-consul", "click", "colorama", "diskcache" ], "requires_python": ">=3.5", "summary": "Useful tools to handle Consul.", "version": "0.1.3" }, "last_serial": 5332388, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f471326548f5353d684a5cd34ad6d41f", "sha256": "e5dc6088f2bb8cfc689cd8b0ecc7374332c0d57abdd4ad68675d19723046b1cc" }, "downloads": -1, "filename": "Consul_Utils-0.1.0-py3.6.egg", "has_sig": false, "md5_digest": "f471326548f5353d684a5cd34ad6d41f", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": ">=3.5", "size": 22543, "upload_time": "2019-04-24T06:37:30", "url": "https://files.pythonhosted.org/packages/fe/cf/bd9783b4f3c2c76fa8aa42863d69cbeb51c588714933852fcc5853571efd/Consul_Utils-0.1.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "4c8ad85385b577fc091c564584fd41bc", "sha256": "d1491a4e34323c2a7c153a25f6b93051f3a1955fd69dd5485573d76eccb12794" }, "downloads": -1, "filename": "consul_utils-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4c8ad85385b577fc091c564584fd41bc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 9208, "upload_time": "2019-04-24T06:41:23", "url": "https://files.pythonhosted.org/packages/ee/27/2f9476eb899aba75e6dba5bacd48618ba54c99af275d786dfa1e9d08b490/consul_utils-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "93f0b38508aaade136a22659f229335f", "sha256": "a6db029712fa995dc627dffdd9f4e7f172cff4134bc94a1781cbc40f9c2b72de" }, "downloads": -1, "filename": "Consul_Utils-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "93f0b38508aaade136a22659f229335f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 9213, "upload_time": "2019-04-24T06:37:27", "url": "https://files.pythonhosted.org/packages/e1/09/1bf782d301c68ce7edcf83f0f83bc44aa41149cb3f9aad22584eb65e0320/Consul_Utils-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "358eec704aab340982679c1386721abd", "sha256": "a5f9f6c5a9905944d2a96f96bbb5e7faa12fc5554598bb6ff3549c27a2b759eb" }, "downloads": -1, "filename": "Consul Utils-0.1.0.tar.gz", "has_sig": false, "md5_digest": "358eec704aab340982679c1386721abd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7113, "upload_time": "2019-04-24T06:37:29", "url": "https://files.pythonhosted.org/packages/a4/e6/9daa058fa849721022e7343804d71ea14bea2ddd69c09def8bb84f88e611/Consul%20Utils-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a061c2c08f3c3f89f8deeb85fb1dfe83", "sha256": "43afd5e4a1c528af97fc3c19e0912a9e5213d12a27ce19a2715a47fff140a11d" }, "downloads": -1, "filename": "consul_utils-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a061c2c08f3c3f89f8deeb85fb1dfe83", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 10047, "upload_time": "2019-04-25T05:16:37", "url": "https://files.pythonhosted.org/packages/49/26/7477f9a08e31350add52e05ee1414e41444aebdba3403dd6fbce1b04a7de/consul_utils-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "528c33d76c3e9f83f7842c3836da3c0b", "sha256": "b392ca8840377461b8bf3b7e81c0b37e59a70cb8d0c78d837fcb2be286cfd8e7" }, "downloads": -1, "filename": "consul_utils-0.1.1.tar.gz", "has_sig": false, "md5_digest": "528c33d76c3e9f83f7842c3836da3c0b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7883, "upload_time": "2019-04-25T05:16:38", "url": "https://files.pythonhosted.org/packages/75/00/9b439a3a0138f10e379e54c6b6d5caf9efd155d72ddb2a8e43d97944a43b/consul_utils-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "84705bc9b8ded1d6141ba418c0bff2b5", "sha256": "71aad7e378a3972115a8f11b57063625378df00bf9310c54aab43cb9d2f6bd8c" }, "downloads": -1, "filename": "consul_utils-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "84705bc9b8ded1d6141ba418c0bff2b5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 12046, "upload_time": "2019-05-06T08:03:12", "url": "https://files.pythonhosted.org/packages/05/14/99ef51aef69996e1aaea77f277b331a7fd2d25a27f5ccd78a0ca5e517a65/consul_utils-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "15af48462228dc75a1938ee2a0125406", "sha256": "0fb8fc1550d02536636702e35b1b914ceeeb827dca023bc4f3941ee405bd8dcf" }, "downloads": -1, "filename": "consul_utils-0.1.2.tar.gz", "has_sig": false, "md5_digest": "15af48462228dc75a1938ee2a0125406", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 9732, "upload_time": "2019-05-06T08:03:14", "url": "https://files.pythonhosted.org/packages/52/43/d88b60ad34694b5d7a0353ac4c2c7de72d10d90346cd56a561cc85a45518/consul_utils-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "7cec350d0473eba3e40f1ba6f10e358a", "sha256": "d937e3c4bac28d3003ada706d2510c5817b2d3f6f32d3eafe601ca73a7a65e43" }, "downloads": -1, "filename": "consul_utils-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "7cec350d0473eba3e40f1ba6f10e358a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 12154, "upload_time": "2019-05-29T13:39:11", "url": "https://files.pythonhosted.org/packages/fe/d3/9c99a79752c772b3b3cb5ebd27b61abfec4b7d95bf8c1fef1ebe77d36106/consul_utils-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "36805bbd65043dce4b9ebf333348bc5b", "sha256": "21130cbc915e9fa4fb087824943f7b29a4e300657f1aa8b544fbf08c47ca35ed" }, "downloads": -1, "filename": "consul_utils-0.1.3.tar.gz", "has_sig": false, "md5_digest": "36805bbd65043dce4b9ebf333348bc5b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 9881, "upload_time": "2019-05-29T13:39:13", "url": "https://files.pythonhosted.org/packages/83/e3/8c5736fcfbeb0333653a0aa5dae4485880fcf797fccd05653f39b32602a4/consul_utils-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7cec350d0473eba3e40f1ba6f10e358a", "sha256": "d937e3c4bac28d3003ada706d2510c5817b2d3f6f32d3eafe601ca73a7a65e43" }, "downloads": -1, "filename": "consul_utils-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "7cec350d0473eba3e40f1ba6f10e358a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 12154, "upload_time": "2019-05-29T13:39:11", "url": "https://files.pythonhosted.org/packages/fe/d3/9c99a79752c772b3b3cb5ebd27b61abfec4b7d95bf8c1fef1ebe77d36106/consul_utils-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "36805bbd65043dce4b9ebf333348bc5b", "sha256": "21130cbc915e9fa4fb087824943f7b29a4e300657f1aa8b544fbf08c47ca35ed" }, "downloads": -1, "filename": "consul_utils-0.1.3.tar.gz", "has_sig": false, "md5_digest": "36805bbd65043dce4b9ebf333348bc5b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 9881, "upload_time": "2019-05-29T13:39:13", "url": "https://files.pythonhosted.org/packages/83/e3/8c5736fcfbeb0333653a0aa5dae4485880fcf797fccd05653f39b32602a4/consul_utils-0.1.3.tar.gz" } ] }