mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
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.
This commit is contained in:
parent
482d4328d1
commit
05a133fc72
6 changed files with 78 additions and 9 deletions
|
|
@ -37,6 +37,7 @@ class Vmfloaty
|
|||
c.option '--notoken', 'Makes a request without a token'
|
||||
c.option '--force', 'Forces vmfloaty to get requested vms'
|
||||
c.option '--json', 'Prints retrieved vms in JSON format'
|
||||
c.option '--ondemand', 'Requested vms are provisioned upon receival of the request, tracked by a request ID'
|
||||
c.action do |args, options|
|
||||
verbose = options.verbose || config['verbose']
|
||||
service = Service.new(options, config)
|
||||
|
|
@ -63,9 +64,13 @@ class Vmfloaty
|
|||
exit 1
|
||||
end
|
||||
|
||||
response = service.retrieve(verbose, os_types, use_token)
|
||||
response = service.retrieve(verbose, os_types, use_token, options.ondemand)
|
||||
request_id = response['request_id'] if options.ondemand
|
||||
response = service.wait_for_request(verbose, request_id) if options.ondemand
|
||||
|
||||
hosts = Utils.standardize_hostnames(response)
|
||||
if options.json
|
||||
|
||||
if options.json || options.ondemand
|
||||
puts JSON.pretty_generate(hosts)
|
||||
else
|
||||
puts Utils.format_host_output(hosts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue