Class: Fog::Parsers::Redshift::AWS::ClusterSnapshotParser

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

Direct Known Subclasses

ClusterSnapshot, DescribeClusterSnapshots

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



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/fog/aws/parsers/redshift/cluster_snapshot_parser.rb', line 44

def end_element(name)  
  super          
  case name
  when 'SnapshotIdentifier', 'ClusterIdentifier', 'Status', 'AvailabilityZone', 'MasterUsername', 'ClusterVersion', 'SnapshotType', 'NodeType',
    'DBName', 'VpcId', 'OwnerAccount'
    @snapshot['Snapshot'][name] = value
  when 'Port', 'NumberOfNodes', 'ElapsedTimeInSeconds', 'EstimatedSecondsToCompletion'
    @snapshot['Snapshot'][name] = value.to_i
  when 'SnapshotCreateTime', 'ClusterCreateTime'
    @snapshot['Snapshot'][name] = Time.parse(value)
  when 'Encrypted'
    @snapshot['Snapshot'][name] = (value == "true")
  when 'TotalBackupSizeInMegaBytes', 'ActualIncrementalBackupSizeInMegaBytes', 'BackupProgressInMegaBytes', 'CurrentBackupRateInMegaBytesPerSecond'
    @snapshot['Snapshot'][name] = value.to_f
  when 'AccountId'
    @snapshot['Snapshot']['AccountsWithRestoreAccess'] << value
  end
end

#fresh_snapshotObject



36
37
38
# File 'lib/fog/aws/parsers/redshift/cluster_snapshot_parser.rb', line 36

def fresh_snapshot
  {'Snapshot' =>  { 'AccountsWithRestoreAccess' => [] }}
end

#resetObject

:snapshot_identifier - (String) :cluster_identifier - (String) :snapshot_create_time - (Time) :status - (String) :port - (Integer) :availability_zone - (String) :cluster_create_time - (Time) :master_username - (String) :cluster_version - (String) :snapshot_type - (String) :node_type - (String) :number_of_nodes - (Integer) :db_name - (String) :vpc_id - (String) :encrypted - (Boolean) :accounts_with_restore_access - (Array)

:account_id - (String)

:owner_account - (String) :total_backup_size_in_mega_bytes - (Numeric) :actual_incremental_backup_size_in_mega_bytes - (Numeric) :backup_progress_in_mega_bytes - (Numeric) :current_backup_rate_in_mega_bytes_per_second - (Numeric) :estimated_seconds_to_completion - (Integer) :elapsed_time_in_seconds - (Integer)



32
33
34
# File 'lib/fog/aws/parsers/redshift/cluster_snapshot_parser.rb', line 32

def reset
  @snapshot = fresh_snapshot
end

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



40
41
42
# File 'lib/fog/aws/parsers/redshift/cluster_snapshot_parser.rb', line 40

def start_element(name, attrs = [])
  super
end