mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Add a 'status' path
This commit is contained in:
parent
0c187a5486
commit
026a4a459c
1 changed files with 15 additions and 0 deletions
|
|
@ -26,6 +26,21 @@ get '/' do
|
|||
puts ''
|
||||
end
|
||||
|
||||
get '/status' do
|
||||
content_type :json
|
||||
|
||||
result = {}
|
||||
|
||||
pools.each do |pool|
|
||||
result[pool['name']] = {}
|
||||
[ 'pending', 'ready', 'completed' ].each do |queue|
|
||||
result[pool['name']][queue] = $redis.scard("vmware_host_pool__#{queue}__#{pool['name']}")
|
||||
end
|
||||
end
|
||||
|
||||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
get '/vm/:template' do
|
||||
content_type :json
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue