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.



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

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



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

def api_key
  @api_key
end

#auth_urlObject

Rackspace Auth URL (optional)



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

def auth_url
  @auth_url
end

#containerObject

Rackspace Container Name



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

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.



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

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))



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

def fog_options
  @fog_options
end

#max_retriesObject

Number of times to retry failed operations.

Default: 10



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

def max_retries
  @max_retries
end

#regionObject

Rackspace Region (optional)



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

def region
  @region
end

#retry_waitsecObject

Time in seconds to pause before each retry.

Default: 30



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

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)



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

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.



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

def segments_container
  @segments_container
end

#servicenetObject

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



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

def servicenet
  @servicenet
end

#usernameObject

Rackspace CloudFiles Credentials



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

def username
  @username
end