Class: Stax::Aws::S3
Class Method Summary collapse
- .bucket_region(bucket) ⇒ Object
- .bucket_tags(bucket) ⇒ Object
- .client ⇒ Object
- .get_lifecycle(bucket) ⇒ Object
- .list_buckets ⇒ Object
- .put(opt) ⇒ Object
- .put_lifecycle(bucket, cfg) ⇒ Object
Methods inherited from Sdk
Class Method Details
.bucket_region(bucket) ⇒ Object
25 26 27 |
# File 'lib/stax/aws/s3.rb', line 25 def bucket_region(bucket) client.get_bucket_location(bucket: bucket).location_constraint end |
.bucket_tags(bucket) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/stax/aws/s3.rb', line 15 def (bucket) client.get_bucket_tagging(bucket: bucket).tag_set rescue ::Aws::Errors::NoSuchEndpointError warn("socket error for #{bucket}, retrying") sleep 1 retry rescue ::Aws::S3::Errors::NoSuchTagSet [] end |
.client ⇒ Object
7 8 9 |
# File 'lib/stax/aws/s3.rb', line 7 def client @_client ||= ::Aws::S3::Client.new end |
.get_lifecycle(bucket) ⇒ Object
33 34 35 |
# File 'lib/stax/aws/s3.rb', line 33 def get_lifecycle(bucket) client.get_bucket_lifecycle_configuration(bucket: bucket).rules end |
.list_buckets ⇒ Object
11 12 13 |
# File 'lib/stax/aws/s3.rb', line 11 def list_buckets client.list_buckets.buckets end |
.put(opt) ⇒ Object
29 30 31 |
# File 'lib/stax/aws/s3.rb', line 29 def put(opt) client.put_object(opt) end |
.put_lifecycle(bucket, cfg) ⇒ Object
37 38 39 |
# File 'lib/stax/aws/s3.rb', line 37 def put_lifecycle(bucket, cfg) client.put_bucket_lifecycle_configuration(bucket: bucket, lifecycle_configuration: cfg) end |