{ "info": { "author": "Narrative Science", "author_email": "anelson@narrativescience.com", "bugtrack_url": null, "classifiers": [], "description": "## LSI\n\nThe `lsi` command provides an easy way to rapidly query AWS to find information\nabout an instance, SSH onto it, or run an SSH command on multiple hosts in\nparallel.\n\n#### Instance search\n\nSearching for an instance is exceedingly easy. Simply type `lsi` followed by\nzero or more filters, which are substrings of an instance's name, IP address,\nor other identifying information:\n\n```\n> lsi stg database\n+---------------------------------------|-----------+\n| Instance Name | Public IP |\n| database-data-stg-1 | 10.0.1.2 |\n| database-data-stg-2 | 10.0.1.2 |\n| database-data-stg-3 | 10.0.1.2 |\n| database-services-stg-1 | 10.0.1.2 |\n| database-services-stg-2 | 10.0.1.2 |\n| database-services-stg-3 | 10.0.1.2 |\n| stg-database-config-server-i-153dc5e9 | 10.0.1.2 |\n| stg-database-config-server-i-1d21dcf5 | 10.0.1.2 |\n| stg-database-config-server-i-2bd0d1c5 | 10.0.1.2 |\n+---------------------------------------|-----------+\n```\n\nYou can provide exclusionary filters with `-v`:\n\n```\n> lsi stg database -v services\n+---------------------------------------|-----------+\n| Instance Name | Public IP |\n| database-rs-data-stg-1 | 10.0.1.2 |\n| database-rs-data-stg-2 | 10.0.1.2 |\n| database-rs-data-stg-3 | 10.0.1.2 |\n| stg-database-config-server-i-153dc5e9 | 10.0.1.2 |\n| stg-database-config-server-i-1d21dcf5 | 10.0.1.2 |\n| stg-database-config-server-i-2bd0d1c5 | 10.0.1.2 |\n+---------------------------------------|-----------+\n```\n\nThe table by default will consist only of machine names and public IPs. You\ncan pull up additional information by passing the `--show` argument:\n\n\n```\n> lsi stg database --show private_ip\n+---------------------------------------|-----------|------------+\n| Instance Name | Public IP | Private IP |\n| database-rs-data-stg-1 | 10.0.1.2 | 10.0.1.2 |\n| database-rs-data-stg-2 | 10.0.1.2 | 10.0.1.2 |\n| database-rs-data-stg-3 | 10.0.1.2 | 10.0.1.2 |\n| database-rs-services-stg-1 | 10.0.1.2 | 10.0.1.2 |\n| database-rs-services-stg-2 | 10.0.1.2 | 10.0.1.2 |\n| database-rs-services-stg-3 | 10.0.1.2 | 10.0.1.2 |\n| stg-database-config-server-i-153dc5e9 | 10.0.1.2 | 10.0.1.2 |\n| stg-database-config-server-i-1d21dcf5 | 10.0.1.2 | 10.0.1.2 |\n| stg-database-config-server-i-2bd0d1c5 | 10.0.1.2 | 10.0.1.2 |\n+---------------------------------------|-----------|------------+\n```\n\nYou can see all of the things that are available to show by requesting\n`--attributes`:\n\n```\n> lsi --attributes\nThe following attributes are available: logical_id, ami_id, name, tags, stack_name, hostname, launch_time, public_ip, instance_type, private_ip, stack_id, security_groups\n```\n\n#### SSH onto an instance\n\nOften the reason for searching in the first place is to SSH onto one of the\ninstances you find. Rather than copy/pasting manually, you can do this directly\nfrom `lsi` using the `--ssh` or `-s` flag:\n\n```\n> lsi -s stg database data\n+---|---------------------|-------------------------------------------|---------------+\n| | Instance Name | Hostname | Public IP |\n| 0 | database-data-stg-1 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n| 1 | database-data-stg-2 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n| 2 | database-data-stg-3 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n+---|---------------------|-------------------------------------------|---------------+\n3 matching entries.\nCommands:\n : Connect to the nth instance in the list\n u username: Change SSH username to username (currently none set)\n i idfile: Change identity file to idfile (currently none set)\n f : Restrict results to those with patterns\n e : Restrict results to those without patterns\n c : Set ssh command to run on matching hosts (currently none set)\n x: Execute the above command on the above host(s)\n q: Quit\nEnter command:\n```\n\nAt this point, you can enter the number of the instance you want to SSH onto,\nwhich will immediately SSH you onto a machine.\n\nOf course, you might not have permissions onto a machine with your own\nusername, or you might want to log in as another user or with a specific\nidentity file. You can do this with `--username` (`-u`) and `--identity-file`\n(`-i`), respectively. If you do this, you don't need to pass the `-s` flag.\n\n```\n> lsi -u someuser -i ~/.ssh/somekey.pem stg database data\n+---|---------------------|-------------------------------------------|---------------+\n| | Instance Name | Hostname | Public IP |\n| 0 | database-data-stg-1 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n| 1 | database-data-stg-2 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n| 2 | database-data-stg-3 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n+---|---------------------|-------------------------------------------|---------------+\n3 matching entries.\nCommands:\n : Connect to the nth instance in the list\n u username: Change SSH username to username (currently someuser)\n i idfile: Change identity file to idfile (currently /home/anelson/.ssh/somekey.pem)\n f : Restrict results to those with patterns\n e : Restrict results to those without patterns\n c : Set ssh command to run on matching hosts (currently none set)\n x: Execute the above command on the above host(s)\n q: Quit\nEnter command:\n```\n\n#### Running SSH commands across instances\n\nYou can use `lsi` to execute an SSH command remotely on one or more instances.\nTo do this, use the `--command` (`-c`) option. Enter `x` at the confirmation\nscreen.\n\n```\n> lsi -c hostname stg database data\n+---|---------------------|-------------------------------------------|---------------+\n| | Instance Name | Hostname | Public IP |\n| 0 | database-data-stg-1 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n| 1 | database-data-stg-2 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n| 2 | database-data-stg-3 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n+---|---------------------|-------------------------------------------|---------------+\n3 matching entries.\nCommands:\n : Connect to the nth instance in the list\n u username: Change SSH username to username (currently none set)\n i idfile: Change identity file to idfile (currently none set)\n f : Restrict results to those with patterns\n e : Restrict results to those without patterns\n c : Set ssh command to run on matching hosts (currently hostname)\n x: Execute the above command on the above host(s)\n q: Quit\nEnter command: x\nRunning command `hostname` on 3 matching hosts\n[database-data-stg-2 (10.0.1.2)]: ip-10.0.1.2\n[database-data-stg-3 (10.0.1.2)]: ip-10.0.1.2\n[database-data-stg-1 (10.0.1.2)]: ip-10.0.1.2\nAll commands finished\n```\n\n#### Profiles\n\nIt can be a bit tedious to enter extensive command-line arguments, especially\nif they are the same over and over again. To alleviate this, you can create\n*profiles* for LSI, which are collections of configuration. For example, you\ncan create a `someuser` profile which uses the `someuser` username and appropriate\nkeyfile. To do this, add a section to `.lsi`, which is written in the `ini`\nformat. For example:\n\n```ini\n[someuser]\nusername=someuser\nidentity file=~/.ssh/somekey.pem\n```\n\nYou can then invoke your profile with `--profile` (`-p`):\n\n```\n> lsi -p someuser stg database data\n+---|---------------------|-------------------------------------------|---------------+\n| | Instance Name | Hostname | Public IP |\n| 0 | database-data-stg-1 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n| 1 | database-data-stg-2 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n| 2 | database-data-stg-3 | ec2-W-X-Y-Z.compute-1.amazonaws.com | 10.0.1.2 |\n+---|---------------------|-------------------------------------------|---------------+\n3 matching entries.\nCommands:\n : Connect to the nth instance in the list\n u username: Change SSH username to username (currently someuser)\n i idfile: Change identity file to idfile (currently /home/anelson/.ssh/somekey.pem)\n f : Restrict results to those with patterns\n e : Restrict results to those without patterns\n c : Set ssh command to run on matching hosts (currently none set)\n x: Execute the above command on the above host(s)\n q: Quit\nEnter command:\n```\n\nProfiles can inherit from other profiles, allowing you to avoid repetition. For\nexample, you might put the entire above command into a profile:\n\n```ini\n[someuser]\nusername=someuser\nidentity file=~/.ssh/somekey.pem\n\n[stg-database]\ninherits=someuser\nfilters=stg,database,data\n```\n\nThen the `lsi -p stg-database` command will be equivalent to the above.\n\n\n## Installation\n\n\n#### Via `pip`:\n\n\n```bash\n$ pip install lsi\n```", "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/NarrativeScience/lsi", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "lsi", "package_url": "https://pypi.org/project/lsi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lsi/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/NarrativeScience/lsi" }, "release_url": "https://pypi.org/project/lsi/0.4.0/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "0.4.0" }, "last_serial": 2490549, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "31d1c782580c9e0112bd0dbf84fa0bfc", "sha256": "dfe8c060f5887b3505d386c8f212f9bef47da926700509b3f04482f3bbf90a20" }, "downloads": -1, "filename": "lsi-0.0.1.tar.gz", "has_sig": false, "md5_digest": "31d1c782580c9e0112bd0dbf84fa0bfc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16656, "upload_time": "2015-06-25T20:51:33", "url": "https://files.pythonhosted.org/packages/e1/4e/36c73f34ba5557d19f79515932a66915f6d5929930e1e668f9254772b546/lsi-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "16072520ebdadb3a43cf953050c380f4", "sha256": "5d917caf9d8e2fda484a8628e1bf11db87a31817ee05553708f10e3e194fa2e6" }, "downloads": -1, "filename": "lsi-0.0.2.tar.gz", "has_sig": false, "md5_digest": "16072520ebdadb3a43cf953050c380f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16786, "upload_time": "2015-07-07T18:53:02", "url": "https://files.pythonhosted.org/packages/be/b5/e5528acda18a6c1971a9c9195f16a398d1f70069a394c4b9aa3085e36709/lsi-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "2aaaed0373087561ad43acf2e6ad3b0a", "sha256": "b25b5138f44cc528d1770c09ea24146bf38184fa15fc9f7a2ce3dcf0425c5160" }, "downloads": -1, "filename": "lsi-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2aaaed0373087561ad43acf2e6ad3b0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16814, "upload_time": "2015-09-08T20:22:43", "url": "https://files.pythonhosted.org/packages/ba/09/037db390f99541fc3ed275e0d6a18852c233a7357368d2ce04e2924fa69f/lsi-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6209c15d36c31c0848722c5cad12c0a2", "sha256": "a56511e12e69e15a1e1c6f56a600bfe25da48573ef4ae7b0515a4795ed00e151" }, "downloads": -1, "filename": "lsi-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6209c15d36c31c0848722c5cad12c0a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16913, "upload_time": "2015-09-08T20:28:12", "url": "https://files.pythonhosted.org/packages/97/b2/0dd45d8e33b9a7175ac261487ce1604bb6fa056a8b3d994bd2f751b5e06f/lsi-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "607f238c6e9ab05e9e58557080bc53db", "sha256": "4cd6c6fff04fb0f135d218a324cb95f105cc760c9c3573fbbbb36c79eb5d3092" }, "downloads": -1, "filename": "lsi-0.1.2.tar.gz", "has_sig": false, "md5_digest": "607f238c6e9ab05e9e58557080bc53db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16972, "upload_time": "2015-09-08T20:32:06", "url": "https://files.pythonhosted.org/packages/7c/73/c5913256dd78b80fd8c55530b037dcf9e09236c743dfa242713655d5989f/lsi-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a4fa141ae6d1e9cb9fdac2815dabbe3a", "sha256": "49ff27c3a9029d49530eae329f24f0ae9d7909566842dd8a377263bd27e08567" }, "downloads": -1, "filename": "lsi-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a4fa141ae6d1e9cb9fdac2815dabbe3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17253, "upload_time": "2016-02-02T21:24:32", "url": "https://files.pythonhosted.org/packages/4a/f0/db1555ed9a53f5ed6a66bfc7600c54681bbffaeee09b3bf6891c306c7d15/lsi-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "801eef2cc649469b2c0afa03f3d62ce9", "sha256": "d5e528f3a0c12b0d2deb128b3c76b5d90155f8949554fc0baaa167125672a17a" }, "downloads": -1, "filename": "lsi-0.2.1.tar.gz", "has_sig": false, "md5_digest": "801eef2cc649469b2c0afa03f3d62ce9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17335, "upload_time": "2016-02-03T16:37:42", "url": "https://files.pythonhosted.org/packages/4a/03/6495f4f0a14e2f1e50609e1af15bc268673f0d0c35cc8e055077b2e6c322/lsi-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "310b8efb6da63f62e9d605cf898f1d4d", "sha256": "24cd4cefe1e09f9401aa9943da9b253707e8a0e7e6f62177d5d01bb0688c4910" }, "downloads": -1, "filename": "lsi-0.2.2.tar.gz", "has_sig": false, "md5_digest": "310b8efb6da63f62e9d605cf898f1d4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17506, "upload_time": "2016-02-03T23:16:49", "url": "https://files.pythonhosted.org/packages/04/9e/696fce2cc702bfd1f9bb9998fcbfd89704635d353f2f037cf71637e4361c/lsi-0.2.2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e0bc9136e94d3893b44538d8cd3de177", "sha256": "261ce56582ca0495f0843d37214233349b68a77037813eb5970c0efcebe2e041" }, "downloads": -1, "filename": "lsi-0.3.0.tar.gz", "has_sig": false, "md5_digest": "e0bc9136e94d3893b44538d8cd3de177", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18203, "upload_time": "2016-10-11T20:06:33", "url": "https://files.pythonhosted.org/packages/55/e6/99dfd9538b07fdf6b33842c094d1fce6ed78fb8ae190cc05127ba0a8dae8/lsi-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "c832f9fe06219e4cfeb5cd10ea1d86a6", "sha256": "a4a8e9f8305bcf8ead91545a71aa024b3942af4ddaf6a8cc48aa597ad3473f47" }, "downloads": -1, "filename": "lsi-0.3.1.tar.gz", "has_sig": false, "md5_digest": "c832f9fe06219e4cfeb5cd10ea1d86a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18197, "upload_time": "2016-10-12T15:39:07", "url": "https://files.pythonhosted.org/packages/0a/aa/0aa6985e34c8efe6ea8c0343c1127abc3ecc0f26f693f99a8d1474561ce0/lsi-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "978ff91a46de643207c1db0648b75e8f", "sha256": "b2c4a9a276a32f914a6193509503c28b3cc84bf42d58e191214811cfe78f4736" }, "downloads": -1, "filename": "lsi-0.4.0.tar.gz", "has_sig": false, "md5_digest": "978ff91a46de643207c1db0648b75e8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20389, "upload_time": "2016-11-29T21:06:37", "url": "https://files.pythonhosted.org/packages/de/44/d818ffaed22e3eeb867b5d190e8acae9fdb92cb80fea582e66c359de5b9d/lsi-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "978ff91a46de643207c1db0648b75e8f", "sha256": "b2c4a9a276a32f914a6193509503c28b3cc84bf42d58e191214811cfe78f4736" }, "downloads": -1, "filename": "lsi-0.4.0.tar.gz", "has_sig": false, "md5_digest": "978ff91a46de643207c1db0648b75e8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20389, "upload_time": "2016-11-29T21:06:37", "url": "https://files.pythonhosted.org/packages/de/44/d818ffaed22e3eeb867b5d190e8acae9fdb92cb80fea582e66c359de5b9d/lsi-0.4.0.tar.gz" } ] }