{ "info": { "author": "Leslie Lintott", "author_email": "leslie.lintott@sky.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: Freely Distributable", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "# Chaos Toolkit tokiproxy driver\n\n\n[![pypi](https://img.shields.io/pypi/v/sky-chaostoolkit-toxiproxy.svg)](https://pypi.python.org/pypi/sky-chaostoolkit-toxiproxy) [![travis](https://img.shields.io/travis/grubert65/chaostp.svg)](https://travis-ci.org/grubert65/chaostp) [![readthedocs](https://readthedocs.org/projects/chaostp/badge/?version=latest)](https://chaostp.readthedocs.io/en/latest/?badge=latest)\n\n\nThis module provides actions to configure toxiproxy proxies and toxies.\n\nWARNING: This module exposes actions that have rather strong impacts on your\ncluster. While Chaos Engineering is all about disrupting and weaknesses,\nit is important to take the time to fully appreciate what those actions\ndo and how they do it.\n\n## Install\n\nTo be used from your experiment, this package must be installed in the Python\nenvironment where [chaostoolkit][] already lives.\n\n[chaostoolkit]: https://github.com/chaostoolkit/chaostoolkit\n\n```\n$ pip install sky-chaostoolkit-toxiproxy\n```\n\n## Usage\n\n\n### Configuration\nIn your experiment configuration section you can set the toxiproxy server\naddress if different from localhost:\n\n```json\n \"configuration\":{\n \"toxiproxy_host\": \"\",\n \"toxiproxy_port\": 1234 \n }\n```\n\nIf more than one toxiproxy server needs to be addressed, you can set the list\nusing the \"toxiproxy\" configuration key:\n\n```json\n \"configuration\":{\n \"toxiproxy\": [\n {\n \"host\": \"\",\n \"port\": \"\"\n },\n ]\n```\n\n### Exported actions\n\n#### Adding a toxic\n\n```\n add_toxic(\n server: Dict = {'host': 'localhost', 'port': 8474}, \n random_server: bool = False, \n proxy_name: str = None, \n toxic_name: str = None, \n type: str = None, \n stream: str = 'downstream', \n toxicity: float = 1.0, \n attributes: str = None \n )\n```\nAdd a toxic to a proxy\n\nThe server can be specifically passed as parameter. Alternatively,\nif the \"toxiproxy\" configuration section is present, a random\nserver is picked setting the \"random_server\" parameter to True.\n\nThe name of the proxy to add the toxic to can be specified,\notherwise a random proxy for the server is picked up\n\n#### Creating a new proxy\n\n```\n create_proxy(\n proxy_name, \n upstream, \n listen, \n enabled: bool = True, \n server: Dict = {'host': 'localhost', 'port': 8474}\n```\n\n#### Deleting all proxies attached to a server\n```\n delete_all_proxies(\n server: Dict = {'host': 'localhost', 'port': 8474}\n )\n```\n\n#### Deleting all toxic attached to a proxy\n```\n delete_all_toxics(\n server: Dict = {'host': 'localhost', 'port': 8474}, \n proxy_name: str = None\n )\n```\n\n#### Deleting a proxy\n```\n delete_proxy(\n proxy_name: str, \n server: Dict = {'host': 'localhost', 'port': 8474}\n )\n```\n\n#### Deleting a toxic\n```\n delete_toxic(\n server: Dict = {'host': 'localhost', 'port': 8474}, \n proxy_name: str = None, \n stream: str = 'downstream', \n type: str = None\n )\n```\n\n#### Disabling a proxy\n```\n disable_proxy(\n server: Dict = {'host': 'localhost', 'port': 8474}, \n proxy_name: str = None\n )\n```\n\n#### Enabling a proxy\n```\n enable_proxy(\n server: Dict = {'host': 'localhost', 'port': 8474}, \n proxy_name: str = None\n )\n```\n\n#### Populating a server\n\n```\n populate(\n proxies, \n server: Dict = {'host': 'localhost', 'port': 8474}\n )\n```\n\n#### Resetting all servers\n```\n reset_all()\n```\nEnable all proxies and remove all active toxics for all servers\n\n#### Resetting a server\n```\n reset_server(\n server: Dict = {'host': 'localhost', 'port': 8474}\n )\n```\nEnable all proxies and remove all active toxics\n\n\n\n### Sample experiment\n\n```json\n{\n \"version\": \"1.0.0\",\n \"title\": \"What happens if a latency is introduced on a proxy for cassandra\",\n \"description\": \"We introduce a 400 ms latency on a single cassandra node\",\n \"tags\": [\"proxy\"],\n \"steady-state-hypothesis\": {\n \"title\": \"Proxy is found\",\n \"probes\": [\n {\n \"type\": \"probe\",\n \"name\": \"proxy-is-found\",\n \"tolerance\": \"c1\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaostp.proxy.probes\",\n \"func\": \"get_proxy\",\n \"arguments\": {\n \"name\": \"c1\"\n }\n }\n }\n ]\n },\n \"method\": [\n {\n \"type\": \"action\",\n \"name\": \"delete_all_toxics\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaostp.proxy.actions\",\n \"func\": \"delete_all_toxics\",\n \"arguments\": {\n \"proxy_name\": \"localhost\",\n \"name\": \"c1\"\n }\n }\n },\n {\n \"type\": \"action\",\n \"name\": \"add-a-latency-toxic\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaostp.proxy.actions\",\n \"func\": \"add_toxic\",\n \"arguments\": {\n \"proxy_name\": \"c1\",\n \"toxic_name\": \"t1\",\n \"type\": \"latency\",\n \"stream\": \"upstream\",\n \"toxicity\": 0.5,\n \"attributes\": {\"latency\": 100}\n }\n },\n \"pauses\": {\n \"before\": 10,\n \"after\": 40\n }\n },\n {\n \"type\": \"action\",\n \"name\": \"add-a-bandwidth-degradation-toxic\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaostp.proxy.actions\",\n \"func\": \"add_toxic\",\n \"arguments\": {\n \"proxy_name\": \"c1\",\n \"toxic_name\": \"bandwidth_degradation_toxic\",\n \"type\": \"bandwidth\",\n \"stream\": \"upstream\",\n \"toxicity\": 0.5,\n \"attributes\": {\"rate\": 400}\n }\n },\n \"pauses\": {\n \"before\": 10,\n \"after\": 40\n }\n },\n {\n \"type\": \"action\",\n \"name\": \"delete_all_toxics\", \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaostp.proxy.actions\",\n \"func\": \"delete_all_toxics\",\n \"arguments\": {\n \"name\": \"c1\"\n }\n }\n }\n ],\n \"rollbacks\": []\n}\n```\n\nPlease explore the code to see existing probes and actions.\n\n### Discovery\n\nYou may use the Chaos Toolkit to discover the capabilities of this extension:\n\n```\n$ chaos discover sky-chaostoolkit-toxiproxy --no-install\n```\n\n## Configuration\n\nThe module expects a toxiproxy-server running and listening on the default port 8474,\nthere is currently no way to configure another server address.\n\n## Contribute\n\nIf you wish to contribute more functions to this package, you are more than\nwelcome to do so. Please fork this project, make your changes following the\nusual [PEP 8][pep8] code style, add appropriate tests and submit a PR for\nreview.\n\n[pep8]: https://pycodestyle.readthedocs.io/en/latest/\n\nThe Chaos Toolkit projects require all contributors must sign a\n[Developer Certificate of Origin][dco] on each commit they would like to merge\ninto the master branch of the repository. Please, make sure you can abide by\nthe rules of the DCO before submitting a PR.\n\n[dco]: https://github.com/probot/dco#how-it-works\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": "http://chaostoolkit.org", "keywords": "", "license": "Apache License Version 2.0", "maintainer": "", "maintainer_email": "", "name": "sky-chaostoolkit-toxiproxy-2", "package_url": "https://pypi.org/project/sky-chaostoolkit-toxiproxy-2/", "platform": "", "project_url": "https://pypi.org/project/sky-chaostoolkit-toxiproxy-2/", "project_urls": { "Homepage": "http://chaostoolkit.org" }, "release_url": "https://pypi.org/project/sky-chaostoolkit-toxiproxy-2/0.1.8/", "requires_dist": [ "toxiproxy-python", "logzero", "chaostoolkit-lib", "pyyaml", "requests" ], "requires_python": ">=3.5.*", "summary": "Chaos Toolkit toxiproxy support by SKY", "version": "0.1.8" }, "last_serial": 5989849, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "7e18a7d32c2856329f53a29580c58bac", "sha256": "ca7fb2cc21b5c09b4320ee6a53cd339a7311735f5eeec7b0cd17d1e36f269661" }, "downloads": -1, "filename": "sky_chaostoolkit_toxiproxy_2-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7e18a7d32c2856329f53a29580c58bac", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.*", "size": 9424, "upload_time": "2019-10-15T13:38:33", "url": "https://files.pythonhosted.org/packages/03/83/e895eab984a403859d5f4d4fa8da7069af235b81875a23dc844b20c124d5/sky_chaostoolkit_toxiproxy_2-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fe5becdedd392033ff1951e91ebb2b0b", "sha256": "bc8d46117dba3deb52671a413c370f7838d6b617316a6b0748596da3bf753de8" }, "downloads": -1, "filename": "sky-chaostoolkit-toxiproxy-2-0.1.3.tar.gz", "has_sig": false, "md5_digest": "fe5becdedd392033ff1951e91ebb2b0b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 17234, "upload_time": "2019-10-15T13:38:36", "url": "https://files.pythonhosted.org/packages/20/d5/2db35605b9bd95da5f84956449a516da2d39a5fbede9353a843ad69f4a8d/sky-chaostoolkit-toxiproxy-2-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "924e5176471f3b84d6f9aec4f2a6e04a", "sha256": "de198f604bc99c768bcdc02edcb9de66fc072252923c1924a9b63a98f033cca7" }, "downloads": -1, "filename": "sky_chaostoolkit_toxiproxy_2-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "924e5176471f3b84d6f9aec4f2a6e04a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.*", "size": 9361, "upload_time": "2019-10-15T15:31:44", "url": "https://files.pythonhosted.org/packages/7d/b0/4116f7ab73baad25a8805519f16b430d4b2ce5fc215b0a0db469d4640dc3/sky_chaostoolkit_toxiproxy_2-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "681876c6192f4ef20b0fe4dd34daca17", "sha256": "981d555dc73baf25535a3c19ee6fde22b1da3d41019cbfcf51ab45909ead570b" }, "downloads": -1, "filename": "sky-chaostoolkit-toxiproxy-2-0.1.4.tar.gz", "has_sig": false, "md5_digest": "681876c6192f4ef20b0fe4dd34daca17", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 17181, "upload_time": "2019-10-15T15:31:55", "url": "https://files.pythonhosted.org/packages/cf/b2/d1c084e4e9fa338d2d879bee766cc1387a44618033af05cb99b4140fa55f/sky-chaostoolkit-toxiproxy-2-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c25593483d8301aadb8e97da1bef2ac4", "sha256": "e98802110bf2da69081afc3014279b2584493dd828a5f29e67a14e0a2d6625b0" }, "downloads": -1, "filename": "sky_chaostoolkit_toxiproxy_2-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c25593483d8301aadb8e97da1bef2ac4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.*", "size": 9374, "upload_time": "2019-10-16T08:37:55", "url": "https://files.pythonhosted.org/packages/99/d4/fa29e75b3a443f26548dce0b6a7199e897500b999737581f18da2c879667/sky_chaostoolkit_toxiproxy_2-0.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d974f3b1ec35099a996082e1785ba814", "sha256": "f48a3f8882cdbf41ca76121fc75e01fd00fb3e4e763a7d532ea59ea550ecbd99" }, "downloads": -1, "filename": "sky-chaostoolkit-toxiproxy-2-0.1.5.tar.gz", "has_sig": false, "md5_digest": "d974f3b1ec35099a996082e1785ba814", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 17196, "upload_time": "2019-10-16T08:37:57", "url": "https://files.pythonhosted.org/packages/8b/85/6b8542b7270dc0bb94db408742ed0200917f9627b9560df2fd8f75f0faa7/sky-chaostoolkit-toxiproxy-2-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "8b24eafd0bfde2293972eff1ace11465", "sha256": "4d4e7e3704ad451333707d756fb6c2e43f3996fb9ff1d15249bd1b34617558d8" }, "downloads": -1, "filename": "sky_chaostoolkit_toxiproxy_2-0.1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8b24eafd0bfde2293972eff1ace11465", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.*", "size": 9368, "upload_time": "2019-10-16T09:08:36", "url": "https://files.pythonhosted.org/packages/21/4f/2dd88e464e49f775cc2e2583ce7ae61a1e22a6908f549cc75f916a84bd7c/sky_chaostoolkit_toxiproxy_2-0.1.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e247ba7220bae7162d4f8fc35e27138c", "sha256": "764cecbc6974239502c8a860e17bbd081124142093032218ce3408cea2ba0832" }, "downloads": -1, "filename": "sky-chaostoolkit-toxiproxy-2-0.1.6.tar.gz", "has_sig": false, "md5_digest": "e247ba7220bae7162d4f8fc35e27138c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 17190, "upload_time": "2019-10-16T09:08:38", "url": "https://files.pythonhosted.org/packages/e7/3d/a701644dfcfc54576d6b84c87f2294bcb89fe50fd7d4707a6b5d35842de5/sky-chaostoolkit-toxiproxy-2-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "620aedd58bb8789f135e31bb2c6e39dd", "sha256": "6dc0a3944d1d402db2bdaa350cbade0a79632bb7a272091ef38081759d519f18" }, "downloads": -1, "filename": "sky_chaostoolkit_toxiproxy_2-0.1.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "620aedd58bb8789f135e31bb2c6e39dd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.*", "size": 9367, "upload_time": "2019-10-16T09:29:20", "url": "https://files.pythonhosted.org/packages/0c/39/4c27e46acc9009b3e46cfc0adc4da6bbfc1ee475e1d3cdb9290f8003e332/sky_chaostoolkit_toxiproxy_2-0.1.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b70943e8faa33a173e659a2f00e2c31", "sha256": "fa61044ee2343d112e1cf4e92d93a0846221036b111cfa00e81e77aac6e3632f" }, "downloads": -1, "filename": "sky-chaostoolkit-toxiproxy-2-0.1.7.tar.gz", "has_sig": false, "md5_digest": "7b70943e8faa33a173e659a2f00e2c31", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 17195, "upload_time": "2019-10-16T09:29:23", "url": "https://files.pythonhosted.org/packages/f2/c1/dfaaee28482b2c74a4934af2734c6d4f36bb2234dd4c87d2fa2805eea226/sky-chaostoolkit-toxiproxy-2-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "4ccde3dade2a33634f94257610b87a7b", "sha256": "09948741f39e9cd0fcb1a7735b5d10e4d1a8ba9900787daf8ef680d74070cf3a" }, "downloads": -1, "filename": "sky_chaostoolkit_toxiproxy_2-0.1.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4ccde3dade2a33634f94257610b87a7b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.*", "size": 9364, "upload_time": "2019-10-17T13:39:35", "url": "https://files.pythonhosted.org/packages/23/cd/fca4940d228987b4425ce4bdee308fb4ddd85a58807b181fdc7f3cc67d65/sky_chaostoolkit_toxiproxy_2-0.1.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "23aa7b761a5bf12a7be65f891a2c7f90", "sha256": "2e50588c2cb5b89b0e2e84988bf29bccdd152bc9687a31f76591058b4d1f3c41" }, "downloads": -1, "filename": "sky-chaostoolkit-toxiproxy-2-0.1.8.tar.gz", "has_sig": false, "md5_digest": "23aa7b761a5bf12a7be65f891a2c7f90", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 17187, "upload_time": "2019-10-17T13:39:37", "url": "https://files.pythonhosted.org/packages/be/84/57f9caba46b8f3917eefcf6eec0cacd439513a8d8cfa987299c4833c596d/sky-chaostoolkit-toxiproxy-2-0.1.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4ccde3dade2a33634f94257610b87a7b", "sha256": "09948741f39e9cd0fcb1a7735b5d10e4d1a8ba9900787daf8ef680d74070cf3a" }, "downloads": -1, "filename": "sky_chaostoolkit_toxiproxy_2-0.1.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4ccde3dade2a33634f94257610b87a7b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.*", "size": 9364, "upload_time": "2019-10-17T13:39:35", "url": "https://files.pythonhosted.org/packages/23/cd/fca4940d228987b4425ce4bdee308fb4ddd85a58807b181fdc7f3cc67d65/sky_chaostoolkit_toxiproxy_2-0.1.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "23aa7b761a5bf12a7be65f891a2c7f90", "sha256": "2e50588c2cb5b89b0e2e84988bf29bccdd152bc9687a31f76591058b4d1f3c41" }, "downloads": -1, "filename": "sky-chaostoolkit-toxiproxy-2-0.1.8.tar.gz", "has_sig": false, "md5_digest": "23aa7b761a5bf12a7be65f891a2c7f90", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 17187, "upload_time": "2019-10-17T13:39:37", "url": "https://files.pythonhosted.org/packages/be/84/57f9caba46b8f3917eefcf6eec0cacd439513a8d8cfa987299c4833c596d/sky-chaostoolkit-toxiproxy-2-0.1.8.tar.gz" } ] }