2010-02-18 16:57:50 -08:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
2011-06-16 16:28:54 -07:00
|
|
|
module Compute
|
|
|
|
module AWS
|
2010-02-18 16:57:50 -08:00
|
|
|
|
|
|
|
class DescribeReservedInstances < Fog::Parsers::Base
|
|
|
|
|
|
|
|
def reset
|
|
|
|
@reserved_instance = {}
|
|
|
|
@response = { 'reservedInstancesSet' => [] }
|
|
|
|
end
|
|
|
|
|
|
|
|
def end_element(name)
|
|
|
|
case name
|
|
|
|
when 'availabilityZone', 'instanceType', 'productDescription', 'reservedInstancesId', 'state'
|
2011-05-12 13:15:13 -07:00
|
|
|
@reserved_instance[name] = value
|
2010-02-18 16:57:50 -08:00
|
|
|
when 'duration', 'instanceCount'
|
2011-05-12 13:15:13 -07:00
|
|
|
@reserved_instance[name] = value.to_i
|
2012-04-15 18:50:51 -04:00
|
|
|
when 'fixedPrice', 'amount'
|
2011-05-12 13:15:13 -07:00
|
|
|
@reserved_instance[name] = value.to_f
|
2010-02-18 16:57:50 -08:00
|
|
|
when 'item'
|
|
|
|
@response['reservedInstancesSet'] << @reserved_instance
|
|
|
|
@reserved_instance = {}
|
|
|
|
when 'requestId'
|
2011-05-12 13:15:13 -07:00
|
|
|
@response[name] = value
|
2010-02-18 16:57:50 -08:00
|
|
|
when 'start'
|
2011-07-13 16:54:13 +10:00
|
|
|
@reserved_instance[name] = Time.parse(value)
|
2010-02-18 16:57:50 -08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|