Class: Backup::Storage::S3
- Includes:
- Cycler
- Defined in:
- lib/backup/storage/s3.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
Amazon Simple Storage Service (S3) Credentials.
-
#bucket ⇒ Object
Amazon S3 bucket name.
-
#chunk_size ⇒ Object
Multipart chunk size, specified in MiB.
-
#encryption ⇒ Object
Encryption algorithm to use for Amazon Server-Side Encryption.
-
#fog_options ⇒ Object
Additional options to pass along to fog.
-
#max_retries ⇒ Object
Number of times to retry failed operations.
-
#region ⇒ Object
Region of the specified S3 bucket.
-
#retry_waitsec ⇒ Object
Time in seconds to pause before each retry.
-
#secret_access_key ⇒ Object
Amazon Simple Storage Service (S3) Credentials.
-
#storage_class ⇒ Object
Storage class to use for the S3 objects uploaded.
-
#use_iam_profile ⇒ Object
Amazon Simple Storage Service (S3) Credentials.
Attributes inherited from Base
#keep, #model, #package, #path, #storage_id
Instance Method Summary collapse
-
#initialize(model, storage_id = nil) ⇒ S3
constructor
A new instance of S3.
Methods inherited from Base
Methods included from Config::Helpers
Constructor Details
#initialize(model, storage_id = nil) ⇒ S3
Returns a new instance of S3.
72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/backup/storage/s3.rb', line 72 def initialize(model, storage_id = nil) super @chunk_size ||= 5 # MiB @max_retries ||= 10 @retry_waitsec ||= 30 @path ||= 'backups' @storage_class ||= :standard @path = @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
#access_key_id ⇒ Object
Amazon Simple Storage Service (S3) Credentials
12 13 14 |
# File 'lib/backup/storage/s3.rb', line 12 def access_key_id @access_key_id end |
#bucket ⇒ Object
Amazon S3 bucket name
16 17 18 |
# File 'lib/backup/storage/s3.rb', line 16 def bucket @bucket end |
#chunk_size ⇒ Object
Multipart chunk size, specified in MiB.
Each package file larger than chunk_size
will be uploaded using S3 Multipart Upload.
Minimum: 5 (but may be disabled with 0) Maximum: 5120 Default: 5
31 32 33 |
# File 'lib/backup/storage/s3.rb', line 31 def chunk_size @chunk_size end |
#encryption ⇒ Object
Encryption algorithm to use for Amazon Server-Side Encryption
Supported values:
-
:aes256
Default: nil
53 54 55 |
# File 'lib/backup/storage/s3.rb', line 53 def encryption @encryption end |
#fog_options ⇒ Object
Additional options to pass along to fog. e.g. Fog::Storage.new({ :provider => ‘AWS’ }.merge(fog_options))
70 71 72 |
# File 'lib/backup/storage/s3.rb', line 70 def @fog_options end |
#max_retries ⇒ Object
Number of times to retry failed operations.
Default: 10
37 38 39 |
# File 'lib/backup/storage/s3.rb', line 37 def max_retries @max_retries end |
#region ⇒ Object
Region of the specified S3 bucket
20 21 22 |
# File 'lib/backup/storage/s3.rb', line 20 def region @region end |
#retry_waitsec ⇒ Object
Time in seconds to pause before each retry.
Default: 30
43 44 45 |
# File 'lib/backup/storage/s3.rb', line 43 def retry_waitsec @retry_waitsec end |
#secret_access_key ⇒ Object
Amazon Simple Storage Service (S3) Credentials
12 13 14 |
# File 'lib/backup/storage/s3.rb', line 12 def secret_access_key @secret_access_key end |
#storage_class ⇒ Object
Storage class to use for the S3 objects uploaded
Supported values:
-
:standard (default)
-
:standard_ia
-
:reduced_redundancy
Default: :standard
65 66 67 |
# File 'lib/backup/storage/s3.rb', line 65 def storage_class @storage_class end |
#use_iam_profile ⇒ Object
Amazon Simple Storage Service (S3) Credentials
12 13 14 |
# File 'lib/backup/storage/s3.rb', line 12 def use_iam_profile @use_iam_profile end |