Class: Fog::OracleCloud::Database::Recoveries

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/oraclecloud/models/database/recoveries.rb

Instance Method Summary collapse

Instance Method Details

#all(db_name) ⇒ Object



10
11
12
13
# File 'lib/fog/oraclecloud/models/database/recoveries.rb', line 10

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

#get(db_name, type = nil, value = nil) ⇒ Object

There is no get service for recoveries in the Oracle Cloud Call the list and extract the recovery



17
18
19
20
21
22
# File 'lib/fog/oraclecloud/models/database/recoveries.rb', line 17

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