From 40cb635db5c3387232b6ed8af206f7b1a1b6007c Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Fri, 14 Feb 2014 14:17:12 -0800 Subject: [PATCH] Allow optional trailing slash --- vmware-host-pooler-api | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vmware-host-pooler-api b/vmware-host-pooler-api index d69b614..bc71a56 100755 --- a/vmware-host-pooler-api +++ b/vmware-host-pooler-api @@ -37,7 +37,7 @@ get '/' do } end -get '/dashboard/stats/vcloud/numbers' do +get '/dashboard/stats/vcloud/numbers/?' do result = Hash.new result['pending'] = 0 result['cloning'] = 0 @@ -62,7 +62,7 @@ get '/dashboard/stats/vcloud/numbers' do JSON.pretty_generate(result) end -get '/dashboard/stats/vcloud/pool' do +get '/dashboard/stats/vcloud/pool/?' do result = Hash.new $config[:pools].each do |pool| @@ -114,7 +114,7 @@ get '/dashboard/stats/vcloud/pool' do JSON.pretty_generate(result) end -get '/dashboard/stats/vcloud/running' do +get '/dashboard/stats/vcloud/running/?' do result = Hash.new $config[:pools].each do |pool| @@ -163,7 +163,7 @@ get '/dashboard/stats/vcloud/running' do JSON.pretty_generate(result) end -get '/vm' do +get '/vm/?' do content_type :json result = [] @@ -175,7 +175,7 @@ get '/vm' do JSON.pretty_generate(result) end -get '/vm/:template' do +get '/vm/:template/?' do content_type :json result = {} @@ -185,7 +185,7 @@ get '/vm/:template' do JSON.pretty_generate(result) end -post '/vm/:template' do +post '/vm/:template/?' do content_type :json result = {} @@ -210,7 +210,7 @@ post '/vm/:template' do JSON.pretty_generate(result) end -delete '/vm/:hostname' do +delete '/vm/:hostname/?' do content_type :json result = {}