{ "info": { "author": "Ahmed ElBakry", "author_email": "eng.ahmed.elbakry@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5" ], "description": "# elasticgroup-cli\n\nelasticgroup-cli is a Command Line Interface (CLI) to interact with SpotInst API. it allows you to do some functions from the command line like updating autoscaling, configure schedule tasks, check Instances health, and more.\n\n#### These Functions are supported\n We plan to add support for more functions\n\n :heavy_check_mark: List and Filter Configured ElasticGroups\n\n :heavy_check_mark: List and Filter Configured Scheduled Tasks\n\n :heavy_check_mark: List and Describe Autoscaling\n\n :heavy_check_mark: Update Autoscaling Configuration\n\n :heavy_check_mark: Describe Scheduled Tasks for Specific ElasticGroup\n\n :heavy_check_mark: Configure Scheduled Tasks for Specific ElasticGroup\n\n :heavy_check_mark: Check Instances health\n\n## Installation:\n#### First:\nYou need to configure SpotInst Credentials.you can configure the credentials by creating a file ~/.spotinst/credentials and add a profile\n\nExample\n\n```bash\ndefault:\n token: 7df2e7df2e42344860de001de-xxxxxx\n account: act-xxxxxx\n```\nOr export them in environment variables\n```bash\nexport spotinst_token=\"7df2e7df2e42344860de001de-xxxxxx\"\nexport account_id=\"act-xxxxx\"\n```\n#### Second:\nInstall the Package\n```bash\npip3 install elasticgroup-cli\n```\n## Usage\n\nGet the help\n```bash\nelasticgroup-cli -h\n```\n\nList all configured Elasticgroups\n```bash\nelasticgroup-cli --list\n```\nList Elasticgroups and filter based on different criteria like environment or stackgroup\n```bash\nelasticgroup-cli --list --filter=live\nelasticgroup-cli --list --filter=checkout\n```\nList all configured scheduled tasks\n```bash\nelasticgroup-cli -lt\nelasticgroup-cli --list-tasks\n```\nList and filter configured scheduled tasks\n```bash\nelasticgroup-cli --list-tasks --filter=live\n```\n\nCheck the instance health of specific Elasticgroup\n```bash\nelasticgroup-cli --instances-health \n```\nList configured Autoscaling Actions of specific Elasticgroup\n```bash\nelasticgroup-cli --describe-autoscaling \n```\nConfigure Autoscaling for specific Elasticgroup\n```bash\nelasticgroup-cli --configure-autoscaling --min=x --max=x --target=x\n```\n\nList configured Scheduled Tasks of specific Elasticgroup\n```bash\nelasticgroup-cli --describe-scheduled-tasks \n```\nConfigure Scheduled Tasks of specific Elasticgroup\n```bash\nelasticgroup-cli --configure-scheduled-tasks --cron-expression=\"expression\" --min=x --max=x --target=x\n```\n#### Note\n - If the Cron Expression exist, the schedule will be updated, if not, the schedule will be created\n - target is optional\n\n## Examples:\n\n```bash\n\u2514\u2500 $ \u25b6 elasticgroup-cli --list --filter=checkout\n Elasticgroups\n+-------------------------------------------+\n| Elasticgroup Name |\n+-------------------------------------------+\n| checkout-staging-508 |\n| checkout-staging-199 |\n+-------------------------------------------+\n```\n\n```bash\n\u2514\u2500 $ \u25b6 elasticgroup-cli --describe-autoscaling token-staging-52\n\n Configured AutoScaling\n+-----------+--------------------------------------------------------------------+\n| Type | Properties |\n+-----------+--------------------------------------------------------------------+\n| Scaleup | Cooldown = 60 |\n| | Statistic = average |\n| | Namespace = AWS/EC2 |\n| | Threshold = 50 |\n| | Policy_name = Scale if CPU >= 50 percent for 4.0 minutes (average) |\n| | Adjustment = 1 |\n| | Metric_name = CPUUtilization |\n| | Minimum = 2 |\n| | Maximum = 10 |\n| | Target = 2 |\n| | Unit = instance |\n| | |\n| Scaledown | Cooldown = 60 |\n| | Statistic = average |\n| | Namespace = AWS/EC2 |\n| | Threshold = 20 |\n| | Policy_name = Scale if CPU < 20 percent for 4.0 minutes (average) |\n| | Adjustment = 1 |\n| | Metric_name = CPUUtilization |\n| | Minimum = 2 |\n| | Maximum = 10 |\n| | Target = 2 |\n| | Unit = instance |\n| | |\n+-----------+--------------------------------------------------------------------+\n```\n```bash\n\u2514\u2500 $ \u25b6 elasticgroup-cli --describe-scheduled-tasks cart-staging-green-80\n\n Scheduled Actions of Elasticgroup cart-staging-green-80\n+-----------------+--------------------+--------------------+-----------------------+------------+\n| cron_expression | scale_min_capacity | scale_max_capacity | scale_target_capacity | is_enabled |\n+-----------------+--------------------+--------------------+-----------------------+------------+\n| 0 5 * * 1-5 | 2 | 10 | 2 | True |\n| 0 21 * * 1-5 | 0 | 0 | 0 | True |\n+-----------------+--------------------+--------------------+-----------------------+------------+\n```\n```bash\n\u2514\u2500 $ \u25b6 elasticgroup-cli --update-autoscaling cart-staging-green-80 --min=2 --max=3 --target=2\n\n Updating Elasticgroup cart-staging-green-80 Capacity...\n Elasticgroup cart-staging-green-80 has been scaled successfully. it may takes few seconds to reflect....\n```\n\n```bash\n\u2514\u2500 $ \u25b6 elasticgroup-cli --configure-scheduled-tasks cart-staging-green-80 --cron-expression=\"0 21 * * 1-5\" --min=1 --target=1 --max=2\n\n Scheduled Tasks of Elasticgroup cart-staging-green-80 have been configured successfully.\n```\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/amelbakry/elasticgroup-cli", "keywords": "spotinst elasticgroup spot aws", "license": "", "maintainer": "", "maintainer_email": "", "name": "elasticgroup-cli", "package_url": "https://pypi.org/project/elasticgroup-cli/", "platform": "", "project_url": "https://pypi.org/project/elasticgroup-cli/", "project_urls": { "Homepage": "https://github.com/amelbakry/elasticgroup-cli" }, "release_url": "https://pypi.org/project/elasticgroup-cli/0.5/", "requires_dist": null, "requires_python": "", "summary": "CLI for Spotinst Elasticgroups", "version": "0.5" }, "last_serial": 5154188, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "0f2efe18b36898fe1d7f8838ddf0db6f", "sha256": "7b83e125501ee78f96597869377cb89b1957f6032647bec65b6c1e082e4d1dab" }, "downloads": -1, "filename": "elasticgroup-cli-0.1.tar.gz", "has_sig": false, "md5_digest": "0f2efe18b36898fe1d7f8838ddf0db6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5726, "upload_time": "2019-04-16T19:32:10", "url": "https://files.pythonhosted.org/packages/d2/6d/080d76919f10c141340bdf18b7aafe30ac1a6cfb73ba7a0765590c37086d/elasticgroup-cli-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "651ccd50df79fa5ce1e2a89ece207c47", "sha256": "67ee3c316ed398e74b5b03cdb543fdb93b593023e7a0b443e4a61661224f6441" }, "downloads": -1, "filename": "elasticgroup-cli-0.2.tar.gz", "has_sig": false, "md5_digest": "651ccd50df79fa5ce1e2a89ece207c47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5724, "upload_time": "2019-04-16T19:38:21", "url": "https://files.pythonhosted.org/packages/c8/b8/58ab8034ee08b69ee04fe82ee112783408730c5eafa9373e6590685854fc/elasticgroup-cli-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "9c080af96f0891e31a2a3d176eac1939", "sha256": "ee0aca8cb85fccd722617b3d4d1af43833cc16280f9298697b4b0e0cfab2e43a" }, "downloads": -1, "filename": "elasticgroup-cli-0.3.tar.gz", "has_sig": false, "md5_digest": "9c080af96f0891e31a2a3d176eac1939", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5742, "upload_time": "2019-04-17T09:06:33", "url": "https://files.pythonhosted.org/packages/93/b5/60170c84bb029721eb2e046ee3337e56381b62040614c1632422996d510b/elasticgroup-cli-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "b0871b493a67f5d149204c80afd3dc3f", "sha256": "2242c1a5663e3a5ca8b574a81eafaf230a94519070d650da3289a02dabc384d0" }, "downloads": -1, "filename": "elasticgroup-cli-0.4.tar.gz", "has_sig": false, "md5_digest": "b0871b493a67f5d149204c80afd3dc3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5740, "upload_time": "2019-04-17T09:11:41", "url": "https://files.pythonhosted.org/packages/e5/90/bd7999ea0ae7cf7a4aee7e9de9a3dd0f9e087e67e851cf29e47d67ec5315/elasticgroup-cli-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "3e8f64fed800db71cd1f1e025b5b0321", "sha256": "cdb6165951ca48d6202a723aa9a15fcdfe96ff608a7f1d364a8aa94e53ec028b" }, "downloads": -1, "filename": "elasticgroup-cli-0.5.tar.gz", "has_sig": false, "md5_digest": "3e8f64fed800db71cd1f1e025b5b0321", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5744, "upload_time": "2019-04-17T09:22:08", "url": "https://files.pythonhosted.org/packages/ab/84/c678ea4880ba81d79b33cc9da404d50b7506c8c7128490cac70ac51532f3/elasticgroup-cli-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3e8f64fed800db71cd1f1e025b5b0321", "sha256": "cdb6165951ca48d6202a723aa9a15fcdfe96ff608a7f1d364a8aa94e53ec028b" }, "downloads": -1, "filename": "elasticgroup-cli-0.5.tar.gz", "has_sig": false, "md5_digest": "3e8f64fed800db71cd1f1e025b5b0321", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5744, "upload_time": "2019-04-17T09:22:08", "url": "https://files.pythonhosted.org/packages/ab/84/c678ea4880ba81d79b33cc9da404d50b7506c8c7128490cac70ac51532f3/elasticgroup-cli-0.5.tar.gz" } ] }