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:
parent
128d531505
commit
33c3777e77
3 changed files with 31 additions and 1 deletions
|
@ -4,7 +4,6 @@ module Fog
|
|||
class Real
|
||||
def devices_list( device_id = nil )
|
||||
# name, processing_cores, status, facility
|
||||
|
||||
options = { :verbosity => 'normal' }
|
||||
|
||||
unless device_id.nil?
|
||||
|
|
30
lib/fog/compute/requests/voxel/voxcloud_delete.rb
Normal file
30
lib/fog/compute/requests/voxel/voxcloud_delete.rb
Normal 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
|
|
@ -15,6 +15,7 @@ module Fog
|
|||
request :devices_list
|
||||
request :voxcloud_create
|
||||
request :voxcloud_status
|
||||
request :voxcloud_delete
|
||||
|
||||
class Mock
|
||||
include Collections
|
||||
|
|
Loading…
Reference in a new issue