class Backup::Syncer::Cloud::CloudFiles

Attributes

api_key[RW]

Rackspace CloudFiles Credentials

auth_url[RW]

Rackspace AuthURL (optional)

container[RW]

Rackspace CloudFiles Container

fog_options[RW]

Additional options to pass along to fog. e.g. Fog::Storage.new({ :provider => ‘Rackspace’ }.merge(fog_options))

region[RW]

Rackspace Region (optional)

servicenet[RW]

Rackspace Service Net (LAN-based transfers to avoid charges and improve performance)

username[RW]

Rackspace CloudFiles Credentials

Public Class Methods

new(syncer_id = nil) click to toggle source
Calls superclass method Backup::Syncer::Cloud::Base::new
# File lib/backup/syncer/cloud/cloud_files.rb, line 35
def initialize(syncer_id = nil)
  super

  @servicenet ||= false

  check_configuration
end

Private Instance Methods

check_configuration() click to toggle source
# File lib/backup/syncer/cloud/cloud_files.rb, line 71
        def check_configuration
          required = %w(username api_key container)
          raise Error, <<-EOS if required.map { |name| send(name) }.any?(&:nil?)
            Configuration Error
            #{required.map { |name| "##{name}" }.join(", ")} are all required
          EOS
        end
cloud_io() click to toggle source
# File lib/backup/syncer/cloud/cloud_files.rb, line 45
def cloud_io
  @cloud_io ||= CloudIO::CloudFiles.new(
    username: username,
    api_key: api_key,
    auth_url: auth_url,
    region: region,
    servicenet: servicenet,
    container: container,
    max_retries: max_retries,
    retry_waitsec: retry_waitsec,
    # Syncer can not use SLOs.
    segments_container: nil,
    segment_size: 0,
    fog_options: fog_options
  )
end
get_remote_files(remote_base) click to toggle source
# File lib/backup/syncer/cloud/cloud_files.rb, line 62
def get_remote_files(remote_base)
  hash = {}
  cloud_io.objects(remote_base).each do |object|
    relative_path = object.name.sub(remote_base + "/", "")
    hash[relative_path] = object.hash
  end
  hash
end