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-maestrodev-1.15.0.20130829165835 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-1.15.0 lib/fog/aws/parsers/rds/describe_db_log_files.rb
gapinc-fog-1.14.0 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-1.14.0 lib/fog/aws/parsers/rds/describe_db_log_files.rb
fog-1.13.0 lib/fog/aws/parsers/rds/describe_db_log_files.rb