mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
adding an api endpoint to print the current full config
This commit is contained in:
parent
1005a33ed2
commit
9a9dfce316
3 changed files with 19 additions and 3 deletions
|
|
@ -24,6 +24,10 @@ module Vmpooler
|
|||
Vmpooler::API.settings.config[:config]
|
||||
end
|
||||
|
||||
def full_config
|
||||
Vmpooler::API.settings.config
|
||||
end
|
||||
|
||||
def pools
|
||||
Vmpooler::API.settings.config[:pools]
|
||||
end
|
||||
|
|
@ -1734,6 +1738,20 @@ module Vmpooler
|
|||
end
|
||||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
get "#{api_prefix}/full_config/?" do
|
||||
content_type :json
|
||||
|
||||
result = {
|
||||
full_config: full_config,
|
||||
status: {
|
||||
ok: true
|
||||
}
|
||||
}
|
||||
|
||||
status 200
|
||||
JSON.pretty_generate(result)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
require 'simplecov'
|
||||
=begin
|
||||
SimpleCov.start do
|
||||
add_filter '/spec/'
|
||||
end
|
||||
=end
|
||||
require 'helpers'
|
||||
require 'rspec'
|
||||
require 'vmpooler'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue