Commit graph

185 commits

Author SHA1 Message Date
Brian Cain
b670596f57 Update to 0.7.9 2017-07-31 08:04:40 -07:00
Jesse Scott
6d57a1b5df Add basic bash completion script and framework for others 2017-07-27 11:27:16 -07:00
Brian Cain
5fa65b6400 Merge branch 'master' of github.com:briancain/vmfloaty 2017-03-14 08:58:51 -07:00
Brian Cain
cfbad921ce (maint) Be clearer about which password to use 2017-03-14 08:58:28 -07:00
Ryan McKern
5c794cd2b0 Use the Classname::VERSION pattern
Instead of having a hardcoded version identifier in multiple
locations, we can leverage the Classname::VERSION pattern to have a
single canonical version number that everything can reference
programmatically.
2017-03-01 14:02:58 -08:00
Brian Cain
c8525bd0f1 Bump to 0.7.8 2016-12-20 08:42:09 -08:00
Brian Cain
313742ebfd Use actual hostname when creating snapshots in warn msg 2016-12-16 11:21:20 -08:00
Brian Cain
82afa94b6e Properly check for large pool size requests 2016-12-14 11:04:51 -08:00
Brian Cain
82a3589db8 Bump to version 0.7.6 2016-12-09 08:57:25 -08:00
Brian Cain
c9b718b379 (#40) Require a --force flag when users request large pools
Prior to this commit, a user could easily steam roll vmpooler by
accidentally adding an extra digit to their get request:

$ floaty get centos=100

Accidentially hitting enter on this would completely drain a centos
pool.

This commit updates that bevaior to force users to use the --force flag
if they really want to get more than 5 vms per template. 5 was choosen
because most vm pools at Puppet were in the 5-10 range.
2016-12-08 21:26:14 -08:00
Brian Cain
345300f58a (#41) Improve help text for vmfloaty
General clean up of the text around the --help flag for all vmfloaty
commands.
2016-12-08 21:15:01 -08:00
Brian Cain
b023339516 Move pretty status printing to Utils namespace and out of commands 2016-12-06 11:21:21 -08:00
Brian Cain
faf92a502d Include colorize in gemspec 2016-12-05 10:29:27 -08:00
Brian Cain
614fc4f7d8 Bump to 0.7.3 2016-12-05 08:42:50 -08:00
Nick Lewis
7ee73083fd Show the status of pools with floaty status
Previously, `floaty status` would simply pretty-print the JSON output of
the status request to the pooler. That data requires additional
parsing, either human or machine, in order to be able to deduce any
meaningful information about the state of the pooler.

This commit updates `floaty status` to visually represent the state of
pools, indicating which pools have nodes missing or being built. It also
prints the status summary message returned by the pooler, providing an
easy way to tell if everything is okay.

By default, this command will only show the state of pools that aren't
full. If `--verbose` is passed, it will show all pools. If the complete
status information provided by the API is desired, the `--json` option
will print the raw JSON output, preserving the previous functionality.

This also updates the status command to exit non-zero if the status is
not ok.
2016-12-02 13:47:58 -08:00
Brian Cain
a6ff0515d3 Raise TokenError if none provided to Pooler.delete 2016-11-14 09:49:23 -08:00
Brian Cain
97e188cf6d (#36) Update floaty modify command to work with multiple hosts
Prior to this commit, you could only modify 1 host at a time with the
floaty modify command. This commit updates that command to allow users
to modify either all known token vms, or vms passed in as a comma
separated list.
2016-11-12 14:25:08 -08:00
Brian Cain
586f4f5c05 Abstract out getting all active token vms into Utils 2016-11-12 13:59:26 -08:00
Brian Cain
414ac22f40 (#37) floaty snapshot warns users about snapshots pending
Vmpooler works by generating a snapshot sha and queueing
the host for taking a snapshot. Depending on the load of
vmpooler, this could take quite a while to complete
making it a little confusing to users trying to use that
snapshot name right away. This commit adds a warning to
the snapshot command about taking snapshots.
2016-11-12 13:39:16 -08:00
Brian Cain
41c0e931bb Bump verison to 0.7.1 2016-10-10 09:31:38 -07:00
Brian Cain
b51a549fe5 (#34) Raise TokenError on operations that require tokens
Prior to this commit, the Pooler class would raise an exception if the
token provided was nil and it attempted to make a request with Faraday.
This fixes that by catching when nil tokens are provided and instead
raising a TokenError to be caught by the consumer.
2016-10-07 18:10:52 -07:00
Brian Cain
9bd552686c Update to 0.7.0 2016-09-24 13:38:19 -07:00
Brian Cain
c9e582c24a (maint) Catch TokenError from Auth class 2016-09-24 13:34:28 -07:00
Brian Cain
c62c1c7083 (#33) Handle more exceptions in vmfloaty command class
This commit adds more handling to the vmfloaty command class that deals
with exceptions thrown from the Pooler class.
2016-09-24 13:29:43 -07:00
Brian Cain
478761023d (maint) Don't raise error in command class 2016-09-24 13:13:27 -07:00
Brian Cain
8b8ac88578 (maint) Use correct exit code in token delete 2016-09-24 11:19:44 -07:00
Brian Cain
579320e988 (#33) Raise TokenError if no token provided 2016-09-24 11:15:44 -07:00
Brian Cain
8da1deaf6b (#33) Handle Auth class errors
This commit updates the Auth class to properly raise an error when
something goes wrong. It also updates the vmpooler command class to
handle when those errors get raised.
2016-09-24 11:11:14 -07:00
Brian Cain
05e9d5a0cc (#32) Handle vmpooler responses when token is invalid
This commit adds an errors class to handle when pooler tokens are
invalid. The retrieve method in Pooler will raise an AuthError if it
gets an HTTP 401 from the vmpooler.
2016-09-24 10:22:48 -07:00
Brian Cain
1d0fc42c80 (#31) Improve how users can provide arguments to commands
Prior this commit, some commands did not accept some options as an
argument and instead only worked through a flag. This commit updates
that behavior to allow users to specify some options through arguments,
while leaving the ability to continue to specify those options through
flags. Command line arguments take precedence over flags. It also fixes
an issue where if a snapshot sha was nil, it would submit a request to
take a snapshot to vmpooler.
2016-09-17 16:07:21 -07:00
Brian Cain
b07139b64c (#29) Don't system exit in Auth class
This commit cleans up the Auth class so that it no longer system exits
if an error occurs. Instead it will return nil if it could not properly
make the request, and it's on the consumer of the class to handle
error cases.
2016-09-15 08:47:38 -07:00
Brian Cain
59eb5678ed Bump to version 0.6.0 2016-08-26 10:09:42 -07:00
Brian Cain
9a1d4a15d6 (#27) Handle URLs that do not have HTTP or HTTPS
Prior to this commit, if a user provided a url without HTTP or HTTPS
Faraday would fail to make a connection to the pooler since it doesn't
seem to handle urls without that. This commit adds a simple check to see
what kind of URI the user gave us, and if its missing that protocol add
it to the beginning of the URL before making a request.
2016-08-26 10:08:38 -07:00
Brian Cain
93e842a2aa (#28) Add new ssh command to vmfloaty
This commit adds a new feature to vmfloaty. It grabs a single vm from
the pooler based on the os template provided and then attempts to ssh
into it from the host machine.
2016-08-26 10:01:08 -07:00
Brian Cain
64a88106a0 Format hosts if --notoken is used 2016-08-15 11:46:19 -07:00
Brian Cain
5f6cd1df1d (#25) Remove printing from delete method in pooler api 2016-07-09 19:53:12 -07:00
Brian Cain
a6c5f1dceb (#24) Improve 'get' output
This commit updates how hosts are formated when shown to the user. It
applies a domain to each hostname instead of being a different key.
2016-07-02 11:41:02 -07:00
Brian Cain
06206456c7 Bump to version 0.3.1 2016-06-04 17:25:49 -07:00
Justin Stoller
1dd8230017 (maint) Include tags in host pretty printing when available 2016-06-03 10:45:34 -07:00
Brian Cain
2e24a455a3 (#19) Update vmfloaty to expect /api/v1 in URL for disk endpoint
This commit updates floaty to use a new endpoint to modify vms. Now you
can use the modify command to extend the disk space of a given vm. The
downside is this new endpoint only exists at /api/v1 on the pooler, and
the way Faraday works required an update to removing a leading slash for
each request endpoint. Users should update their URL in the floaty dot
file to include a /api/v1 at the end of the pooler url
2016-05-03 14:57:00 -07:00
Brian Cain
56924fa811 Make query request before printing all vm information 2015-11-21 13:43:30 -08:00
Brian Cain
0cb635a6c7 Update to 0.2.18 2015-11-21 12:44:32 -08:00
Brian Cain
d4d6010eda Make force flag single dash 2015-11-21 12:43:32 -08:00
Brian Cain
8a3ad76b81 (#17) Add a force option for delete --all 2015-11-21 12:26:09 -08:00
Brian Cain
e3218a0fc9 Bump to version 0.2.17 2015-11-16 09:39:25 -08:00
Brian Cain
53f3c7db03 Fixup how vms are printed on list command 2015-11-16 09:24:45 -08:00
Brian Cain
6447a5f217 (#12) List active vms for a given token
This commit updates the list command to add a flag --active. It will
list all active vms based on the given token as well as what template
they are and how long they've been running for. As a result, this also
updates how the delete --all command formats running vms.
2015-11-16 09:19:51 -08:00
Brian Cain
2a5e5ba9bb Bump to version 0.2.16 2015-11-16 09:17:48 -08:00
Brian Cain
3b92f12ee9 Print obtained token during get command if no token exists 2015-11-16 09:04:52 -08:00
Brian Cain
e8094fb91d Use correct variable for formatting hosts 2015-11-16 08:59:25 -08:00