Sha256: da9bd75a4668e7554c9941963123b9bfb02dee9c02808f5cb83e09213a2476ea

Contents?: true

Size: 1.22 KB

Versions: 46

Compression:

Stored size: 1.22 KB

Contents

module Fog
  module Parsers
    module AWS
      module RDS

        class DescribeDBLogFiles < Fog::Parsers::Base

          attr_reader :rds_id

          def initialize(rds_id)
            @rds_id = rds_id
            super()
          end

          def reset
            @response = { 'DescribeDBLogFilesResult' => {'DBLogFiles' => []}, 'ResponseMetadata' => {} }
            fresh_log_file
          end

          def fresh_log_file
            @db_log_file = {'DBInstanceIdentifier' => @rds_id}
          end

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

          def end_element(name)
            case name
            when 'LastWritten' then @db_log_file[name] = Time.at(value.to_i / 1000)
            when 'LogFileName' then @db_log_file[name] = value
            when 'Size' then @db_log_file[name] = value.to_i
            when 'DescribeDBLogFilesDetails'
              @response['DescribeDBLogFilesResult']['DBLogFiles'] << @db_log_file
              fresh_log_file
            when 'Marker' then @response['DescribeDBLogFilesResult'][name] = value
            when 'RequestId' then @response['ResponseMetadata'][name] = value
            end
          end
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 3 rubygems

Version Path
fog-1.22.0 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-1.21.0 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-1.20.0 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-1.19.0 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/parsers/rds/describe_db_log_files.rb