Commit graph

220 commits

Author SHA1 Message Date
mattkirby
81c6e48528
Merge pull request #97 from puppetlabs/types-docs
(DIO-991) Add service command
2020-09-17 08:58:24 -07:00
mattkirby
e34964be00
Merge pull request #96 from puppetlabs/dio-911
( DIO-911) Include job_id in ABS --json output
2020-09-17 08:55:43 -07:00
9e61247cfe
Add service command
This change creates the `floaty service` command with two valid
arguemnts: types and examples

- `floaty service types` prints out a list of valid types for use in a
  service definition in ~/.vmfloaty.yml
- `floaty service examples` prints out example configuration files for
  both a single service and multiple services.
2020-09-16 12:55:42 -04:00
Samuel Beaulieu
dbf6c54173 The main goal for this PR is to enable using all of the vmfloaty scenarios when
the service is set to ABS. Since ABS does not implement all the services, it
fallsback on vmpooler when needed (example increasing the lifetime value)

- Validating JSON can be parsed before parsing, as it used to throw uncaught errors
- self.list_active is returning hosts for both nspooler and vmpooler but was returning
job_ids for abs. Now standardized the returned values for use in the "modify" cli,
and created a separate list_active_job_ids for the cases where a job_id list is expected

- added a way to change the service in place for methods that do not make sense
for ABS, and instead fallback on using vmpooler in those cases:
1. summary
2. modify
3. snapshot
4. revert
5. disk
For those methods in the class itself, raising a NoMethodError, in case it is used directly

- query now returns the queue info. For information on VMs, users should use --service vmpooler
- pretty_print_hosts (used in list, and delete scenarios) will now print the job_id
ABS information and indent each VM within and print it's metadata. Useful for
knowing the running time and extending it.

- added a new utility method to get the config for the vmpooler service, used for the fallback
- added a passthrough for the vmpooler token to use when running ABS. This enables
vmpooler to track the VMs used by each token (user). Also aligns the list between
both ABS and vmpooler. Fixes the bit-bar issue where the VMs do not appear when created
via ABS
2020-09-11 13:38:24 -05:00
Nate Wolfe
cb1ea8247b
WIP (DIO-911) Include job_id in ABS --json output
Prior to this commit, when using --service=abs and --json the job_id
value is not included in the JSON blob, which makes it difficult for
calling code to grab both the job_id and the hosts without text
processing the log messages printed to standard error.
2020-08-24 16:07:49 -07:00
Nate Wolfe
9a44cc480e
(maint) Add --user CLI option on delete and list subcommands
To support usage without a configuration file.
2020-08-24 12:11:06 -07:00
Nate Wolfe
8341a5f45d
(maint) Mention configuration file in CLI help text description
So users can be aware of the configuration file since it will no
longer be emitted as a warning during CLI invocation.
2020-08-21 15:45:10 -07:00
Nate Wolfe
04c73a970d
(maint) Remove warning about missing configuration file
Previously the CLI would emit a warning about missing configuration
file, but a configuration file does not appear to be a requirement, at
least based on the documentation and the fact that everything can be
specified directly on the command line.

This commit simply removes the warning.

Users will no longer get a warning when doing things like `floaty
--version`, `floaty help`, and any other subcommand.
2020-08-21 14:38:04 -07:00
kirby@puppetlabs.com
3f10e987b4 Update version for 0.11.1 release 2020-08-20 14:06:08 -07:00
mattkirby
d3d6ebeb1a
Merge pull request #86 from McdonaldSeanp/json_output
Json output for delete/list + better ABS error handling
2020-08-20 14:02:53 -07:00
mattkirby
13fee7ef13
Merge pull request #87 from jarretlavallee/fix/master/nspooler
Fix the argument list for nonstandardpooler
2020-08-20 14:01:38 -07:00
Christopher Thorn
701534872d (maint) Fix using ABS service without a .vmfloaty.yml file
If you do not use a config file, and define everything on the command line,
previously the service always defaulted to vmpooler. Even if you requested ABS.
This PR fixes that, now we'll see if the config has no service defined and we
defined on the command line a service, we'll use that service.
2020-08-20 11:37:20 -07:00
Jarret Lavallee
e684933525 (maint) Fix the argument list for nonstandardpooler
Prior to this commit, 7 arguments would be sent into the `retrieve`
method in nonstandardpooler. There were only 6 arguments in the method
definition so an error would be thrown. This commit adds the `ondemand`
argument to the `retrieve` method, but does not utilize it.
2020-08-13 12:37:09 -06:00
Sean P. McDonald
1eaa80706c
(maint) Fail in ABS when queue requests don't return 200/202
When ABS returns an http status code other than 200 or 202, the ABS code
should fail
2020-08-12 16:14:02 -05:00
Sean P. McDonald
d22e2b4194
(new-feature) Add json option to list/delete command
This commit adds an option `--json` to the list and delete commands. When the
json flag is used the commands will print output as formatted JSON rather than
pretty printed strings.
2020-08-12 16:13:58 -05:00
kirby@puppetlabs.com
b44b9c6e98 Bump version for 0.11.0 release 2020-08-12 11:47:58 -07:00
Austin Blatt
35faeab6be Move logger instance to class var in FloatyLogger
This moves the instance of the logger class to a class variable in the
`FloatyLogger` class and provides three class methods to log with in the
rest of the project `FloatyLogger.info`, `FloatyLogger.warn`, and
`FloatyLogger.error`.
2020-08-12 09:57:18 -07:00
barriserloth
8ec90007ca Use Logger for non-result output
This adds the Logger class for log output, all of which goes to STDERR,
and uses puts to send only the command result to STDOUT.
2020-08-11 12:41:22 -07:00
Austin Blatt
4755343df2 Print all non-success output to STDERR 2020-08-10 16:20:25 -07:00
kirby@puppetlabs.com
a245316252 Bump version to 0.10.0 for release 2020-08-04 15:16:19 -07:00
kirby@puppetlabs.com
05a133fc72 Add support for ondemand provisioning to vmfloaty
This commit adds support for provisioning instances on demand with
vmpooler. Additionally, this change adds a capability to detect on
demand pools available in ABS. Without this change vmfloaty does not
support provisioning instances via the vmpooler ondemand endpoints.
2020-08-04 11:24:11 -07:00
28fb9290d4
Update docs
This chane updates docs to reflect that ownership has moved to the DIO
team at Puppet. It also includes some formatting changes.
2020-07-02 12:52:32 -04:00
Brandon High
1e38bb4244
Bump version.rb to 0.9.2 for release 2020-02-05 11:08:10 -08:00
Brian Cain
5dbe19e10b
Merge branch 'master' into qeng-7604_add_jobid_to_delete 2020-01-28 13:40:53 -08:00
Mikker Gimenez-Peterson
ac14629eb3 SSH Command respects ABS now and tests should fail if the API changes again 2020-01-27 15:29:00 -08:00
Brandon High
51a7eb809e
(QENG-7604) Add support for Job IDs to ABS delete
This commit adds support for passing in a JobID when deleting with ABS.
2020-01-27 14:17:06 -08:00
Brandon High
f1be1fec23
Bump version.rb to 0.9.1
For 0.9.1 release. Includes:
- Bug fix for delete action on vmpooler and nspooler #58
2020-01-14 10:03:34 -08:00
Mikker Gimenez-Peterson
dc3bfecd28 Adding spec test to ensure that all the interfaces are the same, while doing so, fix the broken interfaces for delete on vmpooler and nonstandard pooler(they were passed 5 by service.rb but expected 4) 2020-01-14 09:45:28 -08:00
Brian Cain
dac2c2bae6
Merge branch 'master' into bump_version_to_0.9.0 2019-12-17 09:45:47 -08:00
Mikker Gimenez-Peterson
2c456f1157 ABS will sometimes return null values in the /status/queue endpoint 2019-12-16 16:13:33 -08:00
Brandon High
6605a3eee6
Minor version bump to 0.9.0
I figure adding a new service like ABS would necessitate at least a
minor bump since it's more than a security/bug fix.
2019-12-05 10:08:07 -08:00
Brandon High
17c18679e2
Update pooler provider to throw an exception if the API returns non-OK
Prior to this commit the API could fail and return `ok: false` but
floaty wouldn't recognize that as a failure.
This commit updates the pooler code to check for `ok` and raise and
error with the body of what the api returns if it's non-truthy.
2019-12-04 16:44:42 -08:00
Brandon High
1e67715e2c
Fix rubocop issues 2019-12-04 16:40:57 -08:00
Mikker Gimenez-Peterson
d963e357d3 Adding delete and get active requests 2019-12-04 11:37:17 -08:00
Mikker Gimenez-Peterson
7e27542670 Adding delete and get active requests 2019-11-04 11:41:49 -08:00
Mikker Gimenez-Peterson
a77ea84092 Rebasing fixed tests 2019-10-31 14:25:47 -07:00
Mikker Gimenez-Peterson
de7d0fdeab Adding command to list pools out of ABS 2019-10-31 11:33:07 -07:00
Tim Sharpe
6e1f626d7b (rubocop) Fix Style/IfUnlessModifier 2019-02-03 15:40:17 +11:00
Tim Sharpe
426e9ce96b (rubocop) Fix Style/ConditionalAssignment 2019-02-03 15:37:50 +11:00
Tim Sharpe
af6dc740e4 (rubocop) Fix Naming/UncommunicativeMethodParamName 2019-02-03 13:28:43 +11:00
Tim Sharpe
e50d4b3259 (rubocop) Fix Naming/HeredocDelimiterNaming 2019-02-03 13:27:25 +11:00
Tim Sharpe
e1379a8b9c (rubocop) Fix Naming/PredicateName 2019-02-03 13:25:33 +11:00
Tim Sharpe
63eb49c747 (rubocop) Fix Lint/UnusedBlockArgument 2019-02-03 13:20:57 +11:00
Tim Sharpe
f0863e7fb0 (rubocop) Fix Lint/UnusedMethodArgument 2019-02-03 13:19:54 +11:00
Tim Sharpe
2a05f0d976 (rubocop) Fix Lint/ScriptPermission 2019-02-03 13:18:24 +11:00
Tim Sharpe
c97af3f7db (rubocop) Fix Performance/RegexpMatch 2019-02-03 13:15:53 +11:00
Tim Sharpe
851009b1f6 (rubocop) Fix Layout/AlignHash & Layout/IndentHash 2019-02-03 13:08:00 +11:00
Tim Sharpe
f2167f8be7 (rubocop) Fix Layout/CaseIndentation 2019-02-03 12:59:34 +11:00
Tim Sharpe
9afae18ee2 (rubocop) Fix Layout/SpaceAfterComma 2019-02-03 12:48:04 +11:00
Tim Sharpe
cecea8bc05 (rubocop) Fix Layout/SpaceAfterNot 2019-02-03 12:47:16 +11:00