Class: Backup::Storage::CloudFiles

Inherits:
Base
  • Object
show all
Includes:
Cycler
Defined in:
lib/backup/storage/cloud_files.rb

Defined Under Namespace

Classes: Error

Instance Attribute Summary collapse

Attributes inherited from Base

#keep, #model, #package, #path, #storage_id

Instance Method Summary collapse

Methods inherited from Base

#perform!

Methods included from Config::Helpers

included

Constructor Details

#initialize(model, storage_id = nil) ⇒ CloudFiles

Returns a new instance of CloudFiles.



74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/backup/storage/cloud_files.rb', line 74

def initialize(model, storage_id = nil)
  super

  @servicenet         ||= false
  @segment_size       ||= 0
  @max_retries        ||= 10
  @retry_waitsec      ||= 30

  @path ||= 'backups'
  path.sub!(/^\//, '')

  check_configuration
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backup::Config::Helpers

Instance Attribute Details

#api_keyObject

Rackspace CloudFiles Credentials



12
13
14
# File 'lib/backup/storage/cloud_files.rb', line 12

def api_key
  @api_key
end

#auth_urlObject

Rackspace Auth URL (optional)



16
17
18
# File 'lib/backup/storage/cloud_files.rb', line 16

def auth_url
  @auth_url
end

#containerObject

Rackspace Container Name



29
30
31
# File 'lib/backup/storage/cloud_files.rb', line 29

def container
  @container
end

#days_to_keepObject

If set, all backup package files (including SLO segments) will be scheduled for automatic removal by the server.

The ‘keep` option should not be used if this is set, unless you’re transitioning from the ‘keep` option.



55
56
57
# File 'lib/backup/storage/cloud_files.rb', line 55

def days_to_keep
  @days_to_keep
end

#fog_optionsObject

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



72
73
74
# File 'lib/backup/storage/cloud_files.rb', line 72

def fog_options
  @fog_options
end

#max_retriesObject

Number of times to retry failed operations.

Default: 10



61
62
63
# File 'lib/backup/storage/cloud_files.rb', line 61

def max_retries
  @max_retries
end

#regionObject

Rackspace Region (optional)



25
26
27
# File 'lib/backup/storage/cloud_files.rb', line 25

def region
  @region
end

#retry_waitsecObject

Time in seconds to pause before each retry.

Default: 30



67
68
69
# File 'lib/backup/storage/cloud_files.rb', line 67

def retry_waitsec
  @retry_waitsec
end

#segment_sizeObject

SLO Segment size, specified in MiB.

Each package file larger than segment_size will be uploaded as a Static Large Objects (SLO).

Defaults to 0 for backward compatibility (pre v.3.7.0), since #segments_container would be required.

Minimum: 1 (0 disables SLO support) Maximum: 5120 (5 GiB)



47
48
49
# File 'lib/backup/storage/cloud_files.rb', line 47

def segment_size
  @segment_size
end

#segments_containerObject

Rackspace Container Name for SLO Segments Required if #segment_size is set. Must be different from #container.



34
35
36
# File 'lib/backup/storage/cloud_files.rb', line 34

def segments_container
  @segments_container
end

#servicenetObject

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



21
22
23
# File 'lib/backup/storage/cloud_files.rb', line 21

def servicenet
  @servicenet
end

#usernameObject

Rackspace CloudFiles Credentials



12
13
14
# File 'lib/backup/storage/cloud_files.rb', line 12

def username
  @username
end