Sha256: d78dda5b5d3b92500d4ccf0c5c1d5115b99947ce00b50db4dcc89ed10342ad8c
Contents?: true
Size: 1.92 KB
Versions: 7
Compression:
Stored size: 1.92 KB
Contents
module Fog module Parsers module Vcloud module Terremark module Ecloud class GetVdc < Fog::Parsers::Vcloud::Base def reset @target = nil @response = Struct::TmrkEcloudVdc.new([],[],[],Struct::VcloudXCapacity.new,Struct::VcloudXCapacity.new, Struct::VcloudXCapacity.new,Struct::VcloudXCapacity.new, Struct::VcloudXCapacity.new) end def start_element(name, attributes) @value = '' case name when 'Cpu' @target = :cpu_capacity when 'DeployedVmsQuota' @target = :deployed_vm_quota when 'InstantiatedVmsQuota' @target = :instantiated_vm_quota when 'Memory' @target = :memory_capacity when 'StorageCapacity' @target = :storage_capacity when 'Link' @response.links << generate_link(attributes) when 'Network' @response.networks << generate_link(attributes) when 'ResourceEntity' @response.resource_entities << generate_link(attributes) when 'Vdc' handle_root(attributes) end end def end_element(name) case name when 'Allocated', 'Limit', 'Used' @response[@target][name.downcase] = @value.to_i when 'Units' @response[@target][name.downcase] = @value when 'Cpu', 'DeployedVmsQuota', 'InstantiatedVmsQuota', 'Memory', 'StorageCapacity' @target = nil when 'Description' @response.description = @value end end end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems