Sha256: f041b917b44583f050803f1200788b464808913d59ae681c03e3c8575b905ef1

Contents?: true

Size: 692 Bytes

Versions: 5

Compression:

Stored size: 692 Bytes

Contents

require 'fog/core/collection'

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

        model Fog::OracleCloud::Database::Backup

        def all(db_name)
          data = service.list_backups(db_name).body['backupList']
          load(data)
        end

        # There is no get service for backups in the Oracle Cloud
        # Call the list and extract the backup given a tag
        def get(db_name, tag)
          data = {}
          service.list_backups(db_name).body['backupList'].each { |b| 
            if b['dbTag'] == tag then
              data = b
            end
          }
          new(data)
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.17 lib/fog/oraclecloud/models/database/backups.rb
fog-oraclecloud-0.1.16 lib/fog/oraclecloud/models/database/backups.rb
fog-oraclecloud-0.1.15 lib/fog/oraclecloud/models/database/backups.rb
fog-oraclecloud-0.1.14 lib/fog/oraclecloud/models/database/backups.rb
fog-oraclecloud-0.1.13 lib/fog/oraclecloud/models/database/backups.rb