Add a 'delete' path to the API

This commit is contained in:
Scott Schneider 2013-10-03 14:59:23 -07:00
parent bd8a778f8f
commit aec1e3ea16

View file

@ -79,4 +79,19 @@ post '/vm/:template' do
result.to_json result.to_json
end end
delete '/vm/:hostname' do
content_type :json
result = {}
pools.each do |pool|
if $redis.sismember('vmware_host_pool__running__'+pool['name'], params[:hostname])
$redis.srem('vmware_host_pool__running__'+pool['name'], params[:hostname])
$redis.sadd('vmware_host_pool__completed__'+pool['name'], params[:hostname])
end
end
result['ok'] = 'true'
result.to_json
end