Class: OpenC3::Bucket
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #check_object(bucket:, key:) ⇒ 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_directories(bucket:, path:) ⇒ 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.
32 33 34 |
# File 'lib/openc3/utilities/bucket.rb', line 32 def initialize # Setup the client instance end |
Class Method Details
.getClient ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/openc3/utilities/bucket.rb', line 24 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:) ⇒ Object
68 69 70 |
# File 'lib/openc3/utilities/bucket.rb', line 68 def check_object(bucket:, key:) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#create(bucket) ⇒ Object
36 37 38 |
# File 'lib/openc3/utilities/bucket.rb', line 36 def create(bucket) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#delete(bucket) ⇒ Object
48 49 50 |
# File 'lib/openc3/utilities/bucket.rb', line 48 def delete(bucket) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#delete_object(bucket:, key:) ⇒ Object
72 73 74 |
# File 'lib/openc3/utilities/bucket.rb', line 72 def delete_object(bucket:, key:) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#delete_objects(bucket:, keys:) ⇒ Object
76 77 78 |
# File 'lib/openc3/utilities/bucket.rb', line 76 def delete_objects(bucket:, keys:) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#ensure_public(bucket) ⇒ Object
40 41 42 |
# File 'lib/openc3/utilities/bucket.rb', line 40 def ensure_public(bucket) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#exist?(bucket) ⇒ Boolean
44 45 46 |
# File 'lib/openc3/utilities/bucket.rb', line 44 def exist?(bucket) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#get_object(bucket:, key:, path: nil) ⇒ Object
52 53 54 |
# File 'lib/openc3/utilities/bucket.rb', line 52 def get_object(bucket:, key:, path: nil) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#list_directories(bucket:, path:) ⇒ Object
60 61 62 |
# File 'lib/openc3/utilities/bucket.rb', line 60 def list_directories(bucket:, path:) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |
#list_objects(bucket:, prefix: nil, max_request: nil, max_total: nil) ⇒ Object
56 57 58 |
# File 'lib/openc3/utilities/bucket.rb', line 56 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
80 81 82 |
# File 'lib/openc3/utilities/bucket.rb', line 80 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
64 65 66 |
# File 'lib/openc3/utilities/bucket.rb', line 64 def put_object(bucket:, key:, body:, content_type: nil, cache_control: nil, metadata: nil) raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |