Class: OpenC3::Bucket
Direct Known Subclasses
Defined Under Namespace
Classes: NotFound
Class Method Summary collapse
Instance Method Summary collapse
- #check_object(bucket:, key:, retries: true) ⇒ Object
- #create(bucket) ⇒ Object
- #delete(bucket) ⇒ Object
- #delete_object(bucket:, key:) ⇒ Object
- #delete_objects(bucket:, keys:) ⇒ Object
- #ensure_public(bucket) ⇒ Object
- #exist?(bucket) ⇒ Boolean
- #get_object(bucket:, key:, path: nil) ⇒ Object
-
#initialize ⇒ Bucket
constructor
A new instance of Bucket.
- #list_files(bucket:, path:, only_directories: false, metadata: false) ⇒ Object
- #list_objects(bucket:, prefix: nil, max_request: nil, max_total: nil) ⇒ Object
- #presigned_request(bucket:, key:, method:, internal: true) ⇒ Object
- #put_object(bucket:, key:, body:, content_type: nil, cache_control: nil, metadata: nil) ⇒ Object
Constructor Details
#initialize ⇒ Bucket
Returns a new instance of Bucket.
36 37 38 |
# File 'lib/openc3/utilities/bucket.rb', line 36 def initialize # Setup the client instance end |
Class Method Details
.getClient ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/openc3/utilities/bucket.rb', line 28 def self.getClient raise 'OPENC3_CLOUD environment variable is required' unless ENV['OPENC3_CLOUD'] # Base is AwsBucket which works with MINIO, Enterprise implements additional bucket_class = ENV['OPENC3_CLOUD'].capitalize + 'Bucket' klass = OpenC3.require_class('openc3/utilities/'+bucket_class.class_name_to_filename) klass.new end |
Instance Method Details
#check_object(bucket:, key:, retries: true) ⇒ Object
72 73 74 |
# File 'lib/openc3/utilities/bucket.rb', line 72 def check_object(bucket:, key:, retries: true) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#create(bucket) ⇒ Object
40 41 42 |
# File 'lib/openc3/utilities/bucket.rb', line 40 def create(bucket) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#delete(bucket) ⇒ Object
52 53 54 |
# File 'lib/openc3/utilities/bucket.rb', line 52 def delete(bucket) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#delete_object(bucket:, key:) ⇒ Object
76 77 78 |
# File 'lib/openc3/utilities/bucket.rb', line 76 def delete_object(bucket:, key:) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#delete_objects(bucket:, keys:) ⇒ Object
80 81 82 |
# File 'lib/openc3/utilities/bucket.rb', line 80 def delete_objects(bucket:, keys:) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#ensure_public(bucket) ⇒ Object
44 45 46 |
# File 'lib/openc3/utilities/bucket.rb', line 44 def ensure_public(bucket) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#exist?(bucket) ⇒ Boolean
48 49 50 |
# File 'lib/openc3/utilities/bucket.rb', line 48 def exist?(bucket) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#get_object(bucket:, key:, path: nil) ⇒ Object
56 57 58 |
# File 'lib/openc3/utilities/bucket.rb', line 56 def get_object(bucket:, key:, path: nil) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#list_files(bucket:, path:, only_directories: false, metadata: false) ⇒ Object
64 65 66 |
# File 'lib/openc3/utilities/bucket.rb', line 64 def list_files(bucket:, path:, only_directories: false, metadata: false) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#list_objects(bucket:, prefix: nil, max_request: nil, max_total: nil) ⇒ Object
60 61 62 |
# File 'lib/openc3/utilities/bucket.rb', line 60 def list_objects(bucket:, prefix: nil, max_request: nil, max_total: nil) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#presigned_request(bucket:, key:, method:, internal: true) ⇒ Object
84 85 86 |
# File 'lib/openc3/utilities/bucket.rb', line 84 def presigned_request(bucket:, key:, method:, internal: true) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#put_object(bucket:, key:, body:, content_type: nil, cache_control: nil, metadata: nil) ⇒ Object
68 69 70 |
# File 'lib/openc3/utilities/bucket.rb', line 68 def put_object(bucket:, key:, body:, content_type: nil, cache_control: nil, metadata: nil) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |