Sha256: 6c6371e174b6d9395024705b26a4366519f9c1014a2ad7c7d8c33e362231a658

Contents?: true

Size: 1.01 KB

Versions: 34

Compression:

Stored size: 1.01 KB

Contents

module Fog
  module Parsers
    module Compute
      module AWS

        class DescribeReservedInstances < Fog::Parsers::Base

          def reset
            @reserved_instance = {}
            @response = { 'reservedInstancesSet' => [] }
          end

          def end_element(name)
            case name
            when 'availabilityZone', 'instanceType', 'productDescription', 'reservedInstancesId', 'state', 'offeringType'
              @reserved_instance[name] = value
            when 'duration', 'instanceCount'
              @reserved_instance[name] = value.to_i
            when 'fixedPrice', 'amount', 'usagePrice'
              @reserved_instance[name] = value.to_f
            when 'item'
              @response['reservedInstancesSet'] << @reserved_instance
              @reserved_instance = {}
            when 'requestId'
              @response[name] = value
            when 'start'
              @reserved_instance[name] = Time.parse(value)
            end
          end

        end

      end
    end
  end
end

Version data entries

34 entries across 34 versions & 9 rubygems

Version Path
gapinc-fog-1.12.1.2.1 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-1.16.0 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-maestrodev-1.15.0.20130927082724 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-1.15.0 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
gapinc-fog-1.14.0 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-1.14.0 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-1.13.0 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
gapinc-fog-1.12.1.2 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
gapinc-fog-1.12.1.1 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
gapinc-fog-1.12.1a lib/fog/aws/parsers/compute/describe_reserved_instances.rb
gapinc-fog-1.12.1 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-1.12.1 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-1.12.0 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
hpfog-0.0.20 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/parsers/compute/describe_reserved_instances.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-nirvanix-1.8.2 lib/fog/aws/parsers/compute/describe_reserved_instances.rb
fog-1.11.1 lib/fog/aws/parsers/compute/describe_reserved_instances.rb