Module: ClusterFsck::S3Methods
Defined Under Namespace
Classes: ConflictError, KeyDoesNotExistError
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.credentials ⇒ Object
19
20
21
|
# File 'lib/clusterfsck/s3_methods.rb', line 19
def self.credentials
@credentials ||= CredentialGrabber.find
end
|
.s3 ⇒ Object
27
28
29
30
31
32
33
|
# File 'lib/clusterfsck/s3_methods.rb', line 27
def self.s3
if credentials
AWS::S3.new(credentials) else
AWS::S3.new
end
end
|
Instance Method Details
#all_environments ⇒ Object
39
40
41
|
# File 'lib/clusterfsck/s3_methods.rb', line 39
def all_environments
bucket.objects.map(&:key).map {|key| key.split('/').first }.uniq
end
|
#all_files ⇒ Object
35
36
37
|
# File 'lib/clusterfsck/s3_methods.rb', line 35
def all_files
bucket.objects.with_prefix(cluster_fsck_env).collect(&:key)
end
|
#bucket ⇒ Object
11
12
13
|
# File 'lib/clusterfsck/s3_methods.rb', line 11
def bucket
@bucket ||= s3.buckets[ClusterFsck.config_bucket]
end
|
#cluster_fsck_env ⇒ Object
#full_s3_path(key) ⇒ Object
43
44
45
|
# File 'lib/clusterfsck/s3_methods.rb', line 43
def full_s3_path(key)
"#{cluster_fsck_env}/#{key}"
end
|
#s3 ⇒ Object
23
24
25
|
# File 'lib/clusterfsck/s3_methods.rb', line 23
def s3
S3Methods.s3
end
|
#s3_object(object_name) ⇒ Object
7
8
9
|
# File 'lib/clusterfsck/s3_methods.rb', line 7
def s3_object(object_name)
bucket.objects[full_s3_path(object_name)]
end
|