mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 10:28:41 -05:00
Aggregate API helper methods
This commit is contained in:
parent
d3c5d3b9be
commit
2cd83afeb2
1 changed files with 10 additions and 10 deletions
|
|
@ -86,6 +86,16 @@ module Vmpooler
|
|||
result
|
||||
end
|
||||
|
||||
def update_result_hosts(result, template, vm)
|
||||
result[template] ||= {}
|
||||
if result[template]['hostname']
|
||||
result[template]['hostname'] = Array(result[template]['hostname'])
|
||||
result[template]['hostname'].push(vm)
|
||||
else
|
||||
result[template]['hostname'] = vm
|
||||
end
|
||||
end
|
||||
|
||||
get "#{api_prefix}/status/?" do
|
||||
content_type :json
|
||||
|
||||
|
|
@ -379,16 +389,6 @@ module Vmpooler
|
|||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
def update_result_hosts(result, template, vm)
|
||||
result[template] ||= {}
|
||||
if result[template]['hostname']
|
||||
result[template]['hostname'] = Array(result[template]['hostname'])
|
||||
result[template]['hostname'].push(vm)
|
||||
else
|
||||
result[template]['hostname'] = vm
|
||||
end
|
||||
end
|
||||
|
||||
post "#{api_prefix}/vm/:template/?" do
|
||||
content_type :json
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue