mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
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.
This commit is contained in:
parent
12c5fc1cbd
commit
54893cf5fb
5 changed files with 22 additions and 8 deletions
|
|
@ -19,13 +19,21 @@ class Pooler
|
|||
end
|
||||
|
||||
def self.retrieve(verbose, os_type, token, url)
|
||||
os = os_type.gsub(',','+')
|
||||
conn = Http.get_conn(verbose, url)
|
||||
if token
|
||||
conn.headers['X-AUTH-TOKEN'] = token
|
||||
end
|
||||
|
||||
response = conn.post "/vm/#{os}"
|
||||
os_string = ""
|
||||
os_type.each do |os,num|
|
||||
num.times do |i|
|
||||
os_string << os+"+"
|
||||
end
|
||||
end
|
||||
|
||||
os_string = os_string.chomp("+")
|
||||
|
||||
response = conn.post "/vm/#{os_string}"
|
||||
|
||||
res_body = JSON.parse(response.body)
|
||||
res_body
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
class Version
|
||||
@version = '0.2.6'
|
||||
@version = '0.2.7'
|
||||
|
||||
def self.get
|
||||
@version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue