mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Add a 'delete' path to the API
This commit is contained in:
parent
bd8a778f8f
commit
aec1e3ea16
1 changed files with 15 additions and 0 deletions
|
|
@ -79,4 +79,19 @@ post '/vm/:template' do
|
|||
result.to_json
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue