mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
move 'content_type :json' to the beginning of endpoint defs
This commit is contained in:
parent
f80dad32c2
commit
2fa7e1e736
1 changed files with 6 additions and 3 deletions
|
|
@ -49,6 +49,8 @@ module Vmpooler
|
|||
end
|
||||
|
||||
get '/dashboard/stats/vmpooler/pool/?' do
|
||||
content_type :json
|
||||
|
||||
result = Hash.new
|
||||
|
||||
$config[:pools].each do |pool|
|
||||
|
|
@ -98,11 +100,12 @@ module Vmpooler
|
|||
end
|
||||
end
|
||||
|
||||
content_type :json
|
||||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
get '/dashboard/stats/vmpooler/running/?' do
|
||||
content_type :json
|
||||
|
||||
result = Hash.new
|
||||
|
||||
$config[:pools].each do |pool|
|
||||
|
|
@ -149,7 +152,6 @@ module Vmpooler
|
|||
end
|
||||
end
|
||||
|
||||
content_type :json
|
||||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
|
|
@ -230,6 +232,8 @@ module Vmpooler
|
|||
end
|
||||
|
||||
get '/summary/?' do
|
||||
content_type :json
|
||||
|
||||
result = {
|
||||
clone: {
|
||||
duration: {
|
||||
|
|
@ -341,7 +345,6 @@ module Vmpooler
|
|||
result[:clone][:count][:average] = mean(total_clones_per_day)
|
||||
end
|
||||
|
||||
content_type :json
|
||||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue