Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpeteuil committed May 1, 2017
2 parents 18fc612 + cc9596f commit c40aeef
Show file tree
Hide file tree
Showing 18 changed files with 656 additions and 661 deletions.
4 changes: 3 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ environment:
- TOXENV: py35
- TOXENV: py36
- TOXENV: flake8
- TOXENV: bandit
- TOXENV: readme
cache: .tox
build_script:
- cmd: pip install -e .
test_script:
- cmd: tox
deploy_script:
deploy: off
on_success:
- cmd: >-
echo Test Success
Expand Down
36 changes: 0 additions & 36 deletions .codeclimate.yml

This file was deleted.

14 changes: 5 additions & 9 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ confidence=INFERENCE_FAILURE
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=

#intern-builtin,nonzero-method,parameter-unpacking,backtick,raw_input-builtin,dict-view-method,filter-builtin-not-iterating,long-builtin,unichr-builtin,input-builtin,unicode-builtin,file-builtin

#map-builtin-not-iterating,delslice-method,apply-builtin,cmp-method,setslice-method,coerce-method,long-suffix,raising-string,import-star-module-level,buffer-builtin,reload-builtin,unpacking-in-except,print-statement,hex-method,old-octal-literal,metaclass-assignment,dict-iter-method,range-builtin-not-iterating,using-cmp-argument,indexing-exception,no-absolute-import,coerce-builtin,getslice-method,suppressed-message,execfile-builtin,round-builtin,useless-suppression,reduce-builtin,old-raise-syntax,zip-builtin-not-iterating,cmp-builtin,xrange-builtin,standarderror-builtin,old-division,oct-method,next-method-called,old-ne-operator,basestring-builtin
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,redefined-builtin,redefined-variable-type,R0204,W0603,W0123,W0612,E0401


[REPORTS]
Expand Down Expand Up @@ -189,7 +185,7 @@ max-nested-blocks=5
[FORMAT]

# Maximum number of characters on a single line.
max-line-length=100
max-line-length=79

# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
Expand All @@ -202,7 +198,7 @@ single-line-if-stmt=no
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator
# no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=1000
Expand Down Expand Up @@ -289,7 +285,7 @@ generated-members=
[VARIABLES]

# Tells whether we should check for unused import in __init__ files.
init-import=no
init-import=yes

# A regular expression matching the name of dummy variables (i.e. expectedly
# not used).
Expand Down Expand Up @@ -348,7 +344,7 @@ max-parents=7
max-attributes=10

# Minimum number of public methods for a class (see R0903).
min-public-methods=1
min-public-methods=0

# Maximum number of public methods for a class (see R0904).
max-public-methods=20
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ matrix:
env: TOXENV=py36
- python: 3.5
env: TOXENV=flake8
- python: 2.7
env: TOXENV=bandit
- python: 2.7
env: TOXENV=readme
- os: osx
Expand All @@ -51,4 +53,3 @@ after_success:
- coverage combine
- coverage xml
- python-codacy-coverage -r coverage.xml
- codeclimate-test-reporter
100 changes: 66 additions & 34 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
AWS Shortcuts for Command-Line Instance Control
===============================================

List, start, stop and ssh to AWS instances using Name or Instance-ID
---------------------------------------------------------------------------------
List, start, stop and ssh to AWS instances using Name, ID and Wilcards
----------------------------------------------------------------------


|TRAVIS| |Code Climate| |GitHub issues| |PyPi release| |lang| |license|

|TRAVIS| |AppVeyor| |Codacy Grade| |Codacy Cov| |PyPi release| |Py ver| |license sm|

--------------

AWS Shortcuts (awss) allows listing, starting, stopping and connecting to instances by Name or ID. Future versions will also allow referencing instances with any ``Tag`` : ``Value`` combination.

Note: This utility requires Python 2.7 or newer. There is a similar utility written in Bash called `aws-quick-cli <https://github.com/robertpeteuil/aws-quick-cli>`_.
AWS Shortcuts (awss) allows listing, starting, stopping and connecting to instances by name, instance-id, and supports wilcards. The ``awss list`` command displays every tag & value for each instances along with their status and core info. In the near future you will also be able to use any combination of ``Tag`` : ``Value`` combinations when specifying instances.


Overview
--------

``awss`` has the following sub-commands: ``list``, ``start``, ``stop``, and ``ssh``.

- SSH to an Instance: ``awss ssh NAME`` or ``aws ssh -i ID``
- SSH to an Instance: ``awss ssh NAME`` or ``awss ssh -i ID``

- Additional paramters described in `Details`_.

Expand All @@ -31,61 +28,75 @@ Overview
- Start Instance: ``awss start NAME`` or ``awss start -i ID``
- Stop Instance: ``awss stop NAME`` or ``awss stop -i ID``

Example output of ``awss list``
-------------------------------

.. image:: https://cloud.githubusercontent.com/assets/1554603/25595372/6c3bd5e2-2e79-11e7-9ebc-4730f93c2cb6.png

Details
-------

- SSH to Instance: ``awss ssh NAME`` or ``awss ssh -i ID``

- automatically calculates login-name based on the image-type of the instance
- typing ``awss ssh`` without a name or ID will display all running instances

- this allows the user to select from the list if they can't remember the name.
- this can be combined with wilcards, for example ``awss ssh U*`` to display
a list of instances starting with "U" to select from.

- the login-name is automatically calculated based on the image-type of the instance
- override the calculated login-name ``-u USERNAME``
- connect without PEM keys (if properly configured) ``-p``
- command specific help ``awss ssh -h``

- List Instances: ``awss list``

- list all instances (default)
- list all instances (default), or use wilcards ``awss list D*``
- list running instances ``-r`` or ``--running``
- list stopped instances ``-s`` or ``--stopped``
- list instances with specified name ``awss list NAME``
- list instance with specified instance-id ``awss list -i ID``
- state, NAME, and instance-id may be combined in queries
- instance-state and NAME may be combined in queries.

- ex: list instances with NAME currently running: ``awss list NAME -r``

- command specific help ``awss list -h``

- Start Instance: ``awss start NAME`` or ``awss start -i ID``

- typing ``awss start`` without a name or ID will display all stopped instances

- this allows the user to select from the list if they can't remember the name.
- this can be combined with wilcards, for example ``awss start U*`` to display
a list of instances starting with "U" to select from.

- start instance by name or instance-id
- command specific help ``awss start -h``

- Stop Instance: ``awss stop NAME`` or ``awss stop -i ID``

- start instance by name or instance-id
- command specific help ``awss stop -h``

Target Instance Verification
----------------------------
- typing ``awss stop`` without a name or ID will display all running instances

The ``start``, ``stop``, and ``ssh`` commands verify that their action will apply to only one instance
- this allows the user to select from the list if they can't remember the name.
- this can be combined with wilcards, for example ``awss stop U*`` to display
a list of instances starting with "U" to select from.

- This check is performed by looking for other instances that match:
- start instance by name or instance-id
- command specific help ``awss stop -h``

- the instance-specification given (name or ID)
- the running-state appropriate for the command
Target Instance Determination
-----------------------------

- If multiple instances match these conditions, they are listed and the user selects the intended target.
The ``start``, ``stop``, and ``ssh`` commands check if multiple instances match the parameters.
If so, the the matching instances are listed, and the user selects the intended target.

The **running-state** appropriate for each command is as follows:
Example screenshot of selecting instance from list:

- The ``ssh`` command looks for **running** instances (it cannot connect to stopped instanced)
- The ``stop`` command looks for **running** instances (it cannot stop instances that are already stopped)
- The ``start`` command looks for **stopped** instances (it cannot start instances that are already started)
- The ``list`` command looks at all instances, unless optional parameters have been specified to narrow its search to **running**, **stopped** or specific instances.
.. image:: https://cloud.githubusercontent.com/assets/1554603/25595396/84b4ef64-2e79-11e7-922f-d645b007af57.png


Supported Versions & Platforms
------------------------------
Platforms & Python Versions Tested
----------------------------------

Python 2.7, 3.3, 3.4, 3.5, 3.6

Expand All @@ -105,17 +116,38 @@ This utility can be installed with ``pip``:
pip install awss
.. |Code Climate| image:: https://codeclimate.com/github/robertpeteuil/aws-shortcuts/badges/gpa.svg?style=flat-square
:target: https://codeclimate.com/github/robertpeteuil/aws-shortcuts
.. |PyPi release| image:: https://img.shields.io/pypi/v/awss.svg
:target: https://pypi.python.org/pypi/awss

.. |Travis| image:: https://travis-ci.org/robertpeteuil/aws-shortcuts.svg?branch=master
:target: https://travis-ci.org/robertpeteuil/aws-shortcuts

.. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/1meclb632h49sik7/branch/master?svg=true
:target: https://ci.appveyor.com/project/robertpeteuil/aws-shortcuts/branch/master

.. |Codacy Grade| image:: https://api.codacy.com/project/badge/Grade/477279a80d31407a99fb3c3551e066cb
:target: https://www.codacy.com/app/robertpeteuil/aws-shortcuts?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=robertpeteuil/aws-shortcuts&amp;utm_campaign=Badge_Grade

.. |Codacy Cov| image:: https://api.codacy.com/project/badge/Coverage/477279a80d31407a99fb3c3551e066cb
:target: https://www.codacy.com/app/robertpeteuil/aws-shortcuts?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=robertpeteuil/aws-shortcuts&amp;utm_campaign=Badge_Coverage

.. |Py ver| image:: https://img.shields.io/pypi/pyversions/awss.svg
:target: https://pypi.python.org/pypi/bandit/
:alt: Python Versions

.. |license sm| image:: https://img.shields.io/badge/license-MIT-1c64bf.svg?style=flat-square
:target: https://github.com/robertpeteuil/aws-shortcuts


.. |GitHub issues| image:: https://img.shields.io/github/issues/robertpeteuil/aws-shortcuts.svg
:target: https://github.com/robertpeteuil/aws-shortcuts
.. |GitHub release| image:: https://img.shields.io/github/release/robertpeteuil/aws-shortcuts.svg?colorB=1c64bf
:target: https://github.com/robertpeteuil/aws-shortcuts
.. |Code Climate| image:: https://codeclimate.com/github/robertpeteuil/aws-shortcuts/badges/gpa.svg?style=flat-square
:target: https://codeclimate.com/github/robertpeteuil/aws-shortcuts
.. |lang| image:: https://img.shields.io/badge/language-python-3572A5.svg?style=flat-square
:target: https://github.com/robertpeteuil/aws-shortcuts
.. |license| image:: https://img.shields.io/github/license/robertpeteuil/aws-shortcuts.svg?colorB=1c64bf
:target: https://github.com/robertpeteuil/aws-shortcuts
.. |PyPi release| image:: https://img.shields.io/pypi/v/awss.svg
:target: https://pypi.python.org/pypi/awss
.. |Travis| image:: https://travis-ci.org/robertpeteuil/aws-shortcuts.svg?branch=master
:target: https://travis-ci.org/robertpeteuil/aws-shortcuts
Loading

0 comments on commit c40aeef

Please sign in to comment.