Class: Fog::Parsers::Redshift::AWS::DescribeReservedNodes

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/aws/parsers/redshift/describe_reserved_nodes.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#attr_value, #characters, #end_element_namespace, #initialize, #start_element_namespace, #value

Constructor Details

This class inherits a constructor from Fog::Parsers::Base

Instance Method Details

#end_element(name) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/fog/aws/parsers/redshift/describe_reserved_nodes.rb', line 42

def end_element(name)    
  super        
  case name
  when 'Marker'
    @response[name] = value
  when 'Duration', 'NodeCount'
    @reserved_node[name] = value.to_i
  when 'StartTime'
    @reserved_node[name] = Time.parse(value)
  when 'FixedPrice', 'UsagePrice'
    @reserved_node[name] = value.to_f
  when 'CurrencyCode', 'OfferingType', 'NodeType', 'ReservedNodeOfferingId', 'ReservedNodeId', 'State'
    @reserved_node[name] = value
  when 'RecurringChargeAmount'
    @recurring_charge[name] = value.to_f
  when 'RecurringChargeFrequency'
    @recurring_charge[name] = value
  when 'RecurringCharge'
    @reserved_node['RecurringCharges'] << {name => @recurring_charge}
    @recurring_charge = {}
  when 'ReservedNode'
    @response['ReservedNodes'] << {name => @reserved_node}
    @reserved_node = fresh_reserved_nodes
  end
end

#fresh_reserved_nodesObject



28
29
30
# File 'lib/fog/aws/parsers/redshift/describe_reserved_nodes.rb', line 28

def fresh_reserved_nodes
 {'RecurringCharges' => []}
end

#resetObject

:marker - (String) :reserved_nodes - (Array)

:reserved_node_id - (String) 
:reserved_node_offering_id - (String) 
:node_type - (String) 
:start_time - (Time)
:duration - (Integer) 
:fixed_price - (Numeric) 
:usage_price - (Numeric) 
:currency_code - (String)
:node_count - (Integer) 
:state - (String) 
:offering_type - (String) 
:recurring_charges - (Array) 
  :recurring_charge_amount - (Numeric) 
  :recurring_charge_frequency - (String)


24
25
26
# File 'lib/fog/aws/parsers/redshift/describe_reserved_nodes.rb', line 24

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

#start_element(name, attrs = []) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/fog/aws/parsers/redshift/describe_reserved_nodes.rb', line 32

def start_element(name, attrs = [])
  super
  case name
  when 'ReservedNodes'
    @reserved_node = fresh_reserved_nodes
  when 'RecurringCharges'
    @recurring_charge = {}
  end
end