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:
Brian Cain 2015-10-09 22:06:14 -07:00
parent 12c5fc1cbd
commit 54893cf5fb
5 changed files with 22 additions and 8 deletions

View file

@ -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

View file

@ -1,6 +1,6 @@
class Version
@version = '0.2.6'
@version = '0.2.7'
def self.get
@version