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

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]
@host = options[:host] || "services.vcloudexpress.terremark.com"
@path = options[:path] || "/api/v0.8"
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