Skip to main content

CLI tool for interacting with Spotinst AWS elasticgroups

Project description

# spotinst-cli
spotinst-cli is is an interactive command line tool which allows you to to control your spotinst groups and instances.

### Installation
```
pip install spotinstcli
```

### Usage

spotinst-cli has the following flags -
```
-h, --help show this help message and exit
-a ACCOUNT, --account=ACCOUNT spotinst account id defined as environment variable
-g GREP, --grep=GREP text to filter groups by
-u UNGREP, --ungrep=UNGREP text to exclude groups
-l, --list show group list and exit
-j, --json output pure json -- useful for piping into json parsers like jq
-d, --get-data get groups data from spotinst
-s, --get-status get groups status
--get-health get groups health per instance
--min=MIN update group minimum capacity, must supply with max and target
--target=TARGET update group target capacity, must supply with min and max
--max=MAX update group maximum capacity, must supply with min and target
--scale-up=SCALE_UP scale up group by X number of instances
--scale-down=SCALE_DOWN scale down group by X number of instances
--suspend suspend group activities
--unsuspend unsuspend group activities
--suspension-status get groups suspension status
--roll roll a group, must supply batch-size, and grace-period
--batch-size=BATCH roll batch size - must supply with the roll flag
--grace-period=GRACE roll grace period - must supply with the roll flag
--replace-ami=AMI replace AMI for group
--replace-health=HEALTH replace the health check type - can be HCS, EC2, ELB
--set-user-data=USER_DATA updated user data - supply a file path which contains the user data script (cloud init)
--get-user-data fetch the user data script (cloud init)
--roll-status check the status of deployments
-y, --skip-validation skip prompt validation for non-interactive mode
```

### Multiple Accounts
spotinst-cli can use environment variables to reference multiple provider accounts.
Set variables like:

export spotinst_account_prod="act-asdfasdf"
export spotinst_account_qa="act-hjklhjkl"
export spotinst_account_dev="act-zxcvzxcv"

$> spotinst-cli --account prod

====================================================
Getting groups from Spotisnt, please wait...
====================================================

===================================
Found the following groups:
===================================

+---+-------------------------------+--------------+-----+--------+-----+
| # | Group name | ID | Min | Target | Max |
+---+-------------------------------+--------------+-----+--------+-----+
| 1 | Group-A | sig-adsfadfd | 0 | 0 | 200 |
| 2 | Group-B | sig-fddgdfgd | 0 | 0 | 200 |
| 3 | Group-C | sig-hdfhsfdg | 0 | 52 | 200 |
| 4 | Web Servers | sig-hfhdgdhg | 0 | 0 | 4 |
| 5 | ECS | sig-dfghdfgh | 1 | 8 | 12 |
+---+-------------------------------+--------------+-----+--------+-----+

SpotInst account ids can be found in the web console under settings/account for each of your accounts.
There is currently no way to pull account ids from the SpotInst API.




Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spotinstcli-0.1.3-py2-none-any.whl (9.4 kB view details)

Uploaded Python 2

File details

Details for the file spotinstcli-0.1.3-py2-none-any.whl.

File metadata

  • Download URL: spotinstcli-0.1.3-py2-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/2.7.15

File hashes

Hashes for spotinstcli-0.1.3-py2-none-any.whl
Algorithm Hash digest
SHA256 8ed68f27f8f6ee55ae87a1a9d0e6f2e40e5af571654554b005756af41f3a242b
MD5 4b1a5a9b8ef19dfe28bb65f76a50a03b
BLAKE2b-256 c176bfbdcb34380d6f65914cc5a3cab70844bf3b1e0b1bbfc7a1d1064262b267

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page