Sha256: 672c10581e7ab70f93d1143a56386344459b57ed3935dc1204f152fcff2ba57f

Contents?: true

Size: 1.01 KB

Versions: 10

Compression:

Stored size: 1.01 KB

Contents

require 'fog/core/model'

module Fog
  module OracleCloud
    class Database
      class Recovery < Fog::Model

        attribute :db_tag, :aliases=>'dbTag'
        attribute :recovery_start_date,  :aliases=>'recoveryStartDate'
        attribute :recovery_complete_date,  :aliases=>'recoveryCompleteDate'
        attribute :status
        attribute :latest
        attribute :timestamp
        attribute :database_id
       
        def completed?
          status == "COMPLETED"
        end

        private

        def reload
          requires :database_id

          data = begin
            if !db_tag.nil? then
              collection.get(database_id, 'tag', db_tag)
            else
              collection.get(database_id)
            end
          rescue Excon::Errors::SocketError
            nil
          end
          return unless data

          new_attributes = data.attributes
          merge_attributes(new_attributes)
          self
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.12 lib/fog/oraclecloud/models/database/recovery.rb
fog-oraclecloud-0.1.11 lib/fog/oraclecloud/models/database/recovery.rb
fog-oraclecloud-0.1.10 lib/fog/oraclecloud/models/database/recovery.rb
fog-oraclecloud-0.1.9 lib/fog/oraclecloud/models/database/recovery.rb
fog-oraclecloud-0.1.8 lib/fog/oraclecloud/models/database/recovery.rb
fog-oraclecloud-0.1.7 lib/fog/oraclecloud/models/database/recovery.rb
fog-oraclecloud-0.1.6 lib/fog/oraclecloud/models/database/recovery.rb
fog-oraclecloud-0.1.5 lib/fog/oraclecloud/models/database/recovery.rb
fog-oraclecloud-0.1.4 lib/fog/oraclecloud/models/database/recovery.rb
fog-oraclecloud-0.1.3 lib/fog/oraclecloud/models/database/recovery.rb