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:
parent
05f24e4c8a
commit
58e58cf213
3 changed files with 15 additions and 10 deletions
|
@ -81,8 +81,16 @@ module Fog
|
||||||
def initialize(options={})
|
def initialize(options={})
|
||||||
@terremark_password = options[:terremark_password]
|
@terremark_password = options[:terremark_password]
|
||||||
@terremark_username = options[:terremark_username]
|
@terremark_username = options[:terremark_username]
|
||||||
@host = options[:host] || "services.vcloudexpress.terremark.com"
|
case options[:terremark_service]
|
||||||
@path = options[:path] || "/api/v0.8"
|
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
|
@port = options[:port] || 443
|
||||||
@scheme = options[:scheme] || 'https'
|
@scheme = options[:scheme] || 'https'
|
||||||
@cookie = get_organizations.headers['Set-Cookie']
|
@cookie = get_organizations.headers['Set-Cookie']
|
||||||
|
|
|
@ -11,10 +11,7 @@ module Terremark
|
||||||
credentials = Fog.credentials.reject do |k,v|
|
credentials = Fog.credentials.reject do |k,v|
|
||||||
![:terremark_username, :terremark_password].include?(k)
|
![:terremark_username, :terremark_password].include?(k)
|
||||||
end
|
end
|
||||||
hash[key] = case key
|
hash[key] = Fog::Terremark.new(credentials.merge(:terremark_service => key))
|
||||||
when :vcloud
|
|
||||||
Fog::Terremark.new(credentials)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
@@connections[service]
|
@@connections[service]
|
||||||
end
|
end
|
||||||
|
|
|
@ -74,13 +74,13 @@ module Fog
|
||||||
case name
|
case name
|
||||||
when 'Allocated', 'Limit', 'Units', 'Used'
|
when 'Allocated', 'Limit', 'Units', 'Used'
|
||||||
if @in_cpu
|
if @in_cpu
|
||||||
@response['Compute Capacity']['Cpu'][name] = @value
|
@response['ComputeCapacity']['Cpu'][name] = @value
|
||||||
elsif @in_deployed_vms_quota
|
elsif @in_deployed_vms_quota
|
||||||
@response['Compute Capacity']['DeployedVmsQuota'][name] = @value
|
@response['ComputeCapacity']['DeployedVmsQuota'][name] = @value
|
||||||
elsif @in_instantiated_vms_quota
|
elsif @in_instantiated_vms_quota
|
||||||
@response['Compute Capacity']['InstantiatedVmsQuota'][name] = @value
|
@response['ComputeCapacity']['InstantiatedVmsQuota'][name] = @value
|
||||||
elsif @in_memory
|
elsif @in_memory
|
||||||
@response['Compute Capacity']['Memory'][name] = @value
|
@response['ComputeCapacity']['Memory'][name] = @value
|
||||||
elsif @in_storage_capacity
|
elsif @in_storage_capacity
|
||||||
@response['StorageCapacity'][name] = @value
|
@response['StorageCapacity'][name] = @value
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue