mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
(POOLER-92) Add the alias information in the API status page for each pool
Before this change if a pool had an alias configured, the information would not be made public in the API. This commit adds the alias key in the pool object for each pool if configured. The alias key can be abscent, a string or an one or multiple array of strings. The value of the alias is copied from the configuration and can represent another name for the pool, or another configured pool.
This commit is contained in:
parent
0b5abd9bd3
commit
f10bcadf7e
3 changed files with 95 additions and 5 deletions
|
|
@ -199,6 +199,7 @@ module Vmpooler
|
|||
running = backend.scard('vmpooler__running__' + pool['name']).to_i
|
||||
pending = backend.scard('vmpooler__pending__' + pool['name']).to_i
|
||||
max = pool['size']
|
||||
aka = pool['alias']
|
||||
|
||||
result[:pools][pool['name']] = {
|
||||
ready: ready,
|
||||
|
|
@ -207,6 +208,10 @@ module Vmpooler
|
|||
max: max
|
||||
}
|
||||
|
||||
if aka
|
||||
result[:pools][pool['name']][:alias] = aka
|
||||
end
|
||||
|
||||
# for backwards compatibility, include separate "empty" stats in "status" block
|
||||
if ready == 0
|
||||
result[:status][:empty] ||= []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue