Sha256: 031a22c5955af735926f1938e192284d795e164f69697121750660e577efba78

Contents?: true

Size: 772 Bytes

Versions: 10

Compression:

Stored size: 772 Bytes

Contents

require 'fog/core/collection'

module Fog
  module OracleCloud
    class Database
      class Recoveries < Fog::Collection

        model Fog::OracleCloud::Database::Recovery

        def all(db_name)
          data = service.list_recoveries(db_name).body['recoveryList']
          load(data)
        end

        # There is no get service for recoveries in the Oracle Cloud
        # Call the list and extract the recovery 
        def get(db_name, type=nil, value=nil)
          clean_type = 'dbTag' if type == 'tag'
          clean_type, value = ['latest', true] if type.nil?
          data = service.list_recoveries(db_name).body['recoveryList'].find { |r| r[clean_type] == value }
          new(data)
        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/recoveries.rb
fog-oraclecloud-0.1.11 lib/fog/oraclecloud/models/database/recoveries.rb
fog-oraclecloud-0.1.10 lib/fog/oraclecloud/models/database/recoveries.rb
fog-oraclecloud-0.1.9 lib/fog/oraclecloud/models/database/recoveries.rb
fog-oraclecloud-0.1.8 lib/fog/oraclecloud/models/database/recoveries.rb
fog-oraclecloud-0.1.7 lib/fog/oraclecloud/models/database/recoveries.rb
fog-oraclecloud-0.1.6 lib/fog/oraclecloud/models/database/recoveries.rb
fog-oraclecloud-0.1.5 lib/fog/oraclecloud/models/database/recoveries.rb
fog-oraclecloud-0.1.4 lib/fog/oraclecloud/models/database/recoveries.rb
fog-oraclecloud-0.1.3 lib/fog/oraclecloud/models/database/recoveries.rb