minimal support for TMRK eCloud.

Fixed a small issue with ComputeCapacity not working.
This commit is contained in:
Edward Muller 2010-04-16 15:20:02 +08:00 committed by Wesley Beary
parent 05f24e4c8a
commit 58e58cf213
3 changed files with 15 additions and 10 deletions

View File

@ -81,8 +81,16 @@ module Fog
def initialize(options={})
@terremark_password = options[:terremark_password]
@terremark_username = options[:terremark_username]
case options[:terremark_service]
when :ecloud
@host = options[:host] || "services.enterprisecloud.terremark.com"
@path = options[:path] || "/api/v0.8a-ext2.0"
when :vcloud
@host = options[:host] || "services.vcloudexpress.terremark.com"
@path = options[:path] || "/api/v0.8"
else
raise "Unsupported Terremark Service"
end
@port = options[:port] || 443
@scheme = options[:scheme] || 'https'
@cookie = get_organizations.headers['Set-Cookie']

View File

@ -11,10 +11,7 @@ module Terremark
credentials = Fog.credentials.reject do |k,v|
![:terremark_username, :terremark_password].include?(k)
end
hash[key] = case key
when :vcloud
Fog::Terremark.new(credentials)
end
hash[key] = Fog::Terremark.new(credentials.merge(:terremark_service => key))
end
@@connections[service]
end

View File

@ -74,13 +74,13 @@ module Fog
case name
when 'Allocated', 'Limit', 'Units', 'Used'
if @in_cpu
@response['Compute Capacity']['Cpu'][name] = @value
@response['ComputeCapacity']['Cpu'][name] = @value
elsif @in_deployed_vms_quota
@response['Compute Capacity']['DeployedVmsQuota'][name] = @value
@response['ComputeCapacity']['DeployedVmsQuota'][name] = @value
elsif @in_instantiated_vms_quota
@response['Compute Capacity']['InstantiatedVmsQuota'][name] = @value
@response['ComputeCapacity']['InstantiatedVmsQuota'][name] = @value
elsif @in_memory
@response['Compute Capacity']['Memory'][name] = @value
@response['ComputeCapacity']['Memory'][name] = @value
elsif @in_storage_capacity
@response['StorageCapacity'][name] = @value
end