Commit graph

120 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
3b92f12ee9 Print obtained token during get command if no token exists 2015-11-16 09:04:52 -08:00
Brian Cain
f15df69eef Fix missing end 2015-11-15 14:35:16 -08:00
Brian Cain
c6cf86669a Cleanup vmfloaty library and command line functions 2015-11-15 14:24:24 -08:00
Brian Cain
3394a14ea0 (#14) Remove printing in auth library 2015-11-15 13:27:07 -08:00
Brian Cain
a0ba604006 (#11) Provide a way to delete all vms acquired by token
This commit adds a way for a user to delete all vms that were obtained
by a specific token. It will ask the user if they are sure before
deleting everything.
2015-11-13 11:52:01 -08:00
Brian Cain
bc4cff5363 (maint) Have pooler delete class take array
Prior to this commit, the pooler class was expecting a comma separated
string of hosts to delete. This commit updates that to expect hostnames
to be an array instead.
2015-11-10 11:42:56 -08:00
Brian Cain
fa92da5c05 (maint) Update token status to not require password 2015-11-05 13:28:37 -08:00
Brian Cain
b62cffa2cd (spec) Add format spec test 2015-10-21 22:21:13 -07:00
Brian Cain
3a17b418cf Add default for grabbing an os
If a user does not specify a number of vms with the get command (i.e.
does not include an = sign after the os), the get command will assume
the user just wants 1 vm.
2015-10-16 15:48:16 -07:00
Brian Cain
0effe55c31 Add failure message if modify command did not work 2015-10-14 17:17:00 -07:00
Brian Cain
2153507098 Merge branch 'master' of github.com:briancain/vmfloaty 2015-10-14 09:56:54 -07:00
Brian Cain
221e5db6b5 Improve formatting of cli tool 2015-10-13 23:15:47 -07:00
Brian Cain
559005057e Ensure vm number is specified from cli args 2015-10-12 09:48:17 -07:00
Brian Cain
54893cf5fb Improve how to retrieve vms
This commit changes the get command to have users request vms by
specifying the hosts they want and then the number of hosts rather than
having to say each one separated by a comma.
2015-10-09 22:06:14 -07:00
Brian Cain
76a2d23973 (#3) Add initial formatter class 2015-10-01 23:39:23 -07:00
Brian Cain
c738b0c566 Abstract conf parsing to class 2015-10-01 23:32:17 -07:00
Brian Cain
9b176a7bd5 Add class for getting version 2015-10-01 23:30:12 -07:00
Brian Cain
c75bc69ea2 Add warning string if no conf file exists 2015-10-01 19:40:26 -07:00
Brian Cain
9495dd3ee8 Fix --notoken flag 2015-09-25 15:56:28 -07:00
Brian Cain
98741e5e4a Fix token auth for methods
Properly set the header to be X-AUTH-TOKEN for requests to the pooler.
2015-09-25 14:03:47 -07:00
Brian Cain
5908fe2d9e Update modify command to properly handle tags and TTL 2015-09-19 15:18:55 -07:00
Brian Cain
c28f015346 Only set/parse tags if flag argument is called 2015-09-19 15:11:17 -07:00
Brian Cain
28b145d762 Simplify how notoken arg is processed in get 2015-09-19 15:07:18 -07:00
Brian Cain
5588c941c2 Bump version 0.2.3 2015-09-17 21:17:01 -07:00
Brian Cain
39a3d09766 Fix modify command bug
Hash is not a valid flag type so instead it will use string
2015-09-17 21:11:31 -07:00
Brian Cain
40fd138214 Remove host options and use argument instead 2015-09-17 21:05:09 -07:00
Brian Cain
7015fc3b20 Check for token variable instead of from options
Update the get method to only retrieve tokens if one doesn't exist from
either the cli arguments or from a dotfile
2015-09-15 15:22:13 -07:00
Brian Cain
3e7b2b54fe Respect token from config file 2015-09-15 13:32:49 -07:00
Brian Cain
f8cc329447 Fix typo for delete methods 2015-09-15 13:28:53 -07:00
Brian Cain
a72303c859 Grab host instead of hostname for options params 2015-09-15 13:23:36 -07:00
Brian Cain
a9bce6ec97 Grab proper hostname flag for query command 2015-09-15 13:22:36 -07:00
Brian Cain
9fc9820120 Simplify how floaty gets vms
Instead of building a json hash for each requested vm, sub the host
strings commas with + and append it to the request url.
2015-09-15 13:08:52 -07:00
Brian Cain
9e4e7b3dab Do not ask for password if token is provided 2015-09-15 10:44:51 -07:00