mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
Update modify command to properly handle tags and TTL
This commit is contained in:
parent
c28f015346
commit
5908fe2d9e
2 changed files with 11 additions and 6 deletions
|
|
@ -34,15 +34,20 @@ class Pooler
|
|||
end
|
||||
|
||||
def self.modify(verbose, url, hostname, token, lifetime, tags)
|
||||
modify_body = {'lifetime'=>lifetime, 'tags'=>tags}
|
||||
modify_body = {}
|
||||
if lifetime
|
||||
modify_body['lifetime'] = lifetime
|
||||
end
|
||||
if tags
|
||||
modify_body['tags'] = tags
|
||||
end
|
||||
|
||||
puts modify_body
|
||||
conn = Http.get_conn_with_token(verbose, url, token)
|
||||
conn.headers['X-AUTH-TOKEN']
|
||||
|
||||
response = conn.put do |req|
|
||||
req.url "/vm/#{hostname}"
|
||||
end
|
||||
response = conn.put "/vm/#{hostname}"
|
||||
res_body = JSON.parse(response.body)
|
||||
|
||||
res_body
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue