1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

added voxcloud_delete request

This commit is contained in:
James W. Brinkerhoff 2011-02-09 17:03:02 -05:00 committed by geemus
parent 128d531505
commit 33c3777e77
3 changed files with 31 additions and 1 deletions

View file

@ -4,7 +4,6 @@ module Fog
class Real class Real
def devices_list( device_id = nil ) def devices_list( device_id = nil )
# name, processing_cores, status, facility # name, processing_cores, status, facility
options = { :verbosity => 'normal' } options = { :verbosity => 'normal' }
unless device_id.nil? unless device_id.nil?

View file

@ -0,0 +1,30 @@
module Fog
module Voxel
class Compute
class Real
def voxcloud_delete( device_id )
options = { :device_id => device_id }
data = request("voxel.voxcloud.delete", options )
unless data['stat'] == 'ok'
raise "Error from Voxel hAPI: #{data['err']['msg']}"
end
true
end
end
class Mock
def voxcloud_delete( device_id )
device = devices_list.select { |d| d[:id] == device_id }
if device.empty?
false
else
true
end
end
end
end
end
end

View file

@ -15,6 +15,7 @@ module Fog
request :devices_list request :devices_list
request :voxcloud_create request :voxcloud_create
request :voxcloud_status request :voxcloud_status
request :voxcloud_delete
class Mock class Mock
include Collections include Collections