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

39 lines
970 B
Ruby
Raw Normal View History

module Fog
module Voxel
class Compute < Fog::Service
requires :voxel_api_key, :voxel_api_secret
model_path 'fog/compute/models/voxel'
model :image
collection :images
2011-01-19 17:07:04 -05:00
model :server
collection :servers
request_path 'fog/compute/requests/voxel'
request :images_list
2011-01-19 17:07:04 -05:00
request :devices_list
request :voxcloud_create
request :voxcloud_status
class Mock
include Collections
end
class Real
include Collections
def initialize(options = {})
require 'hapi'
@connection = HAPI.new( :authkey => { :key => options[:voxel_api_key], :secret => options[:voxel_api_secret] }, :default_format => :ruby )
end
2011-01-19 17:07:04 -05:00
def request(method_name, options = {})
api_method_name = @connection.translate_api_to_method( method_name )
@connection.send(api_method_name, options)
end
end
end
end
end