Class: Fog::Storage::K5::Real
- Inherits:
-
Object
- Object
- Fog::Storage::K5::Real
- Includes:
- K5::Shared, Utils
- Defined in:
- lib/fog/storage/k5/real.rb,
lib/fog/storage/k5/requests/get_object.rb,
lib/fog/storage/k5/requests/put_object.rb,
lib/fog/storage/k5/requests/list_objects.rb,
lib/fog/storage/k5/requests/delete_object.rb,
lib/fog/storage/k5/requests/list_containers.rb
Constant Summary
Constants included from K5::Shared
K5::Shared::K5_URL_SCHEME, K5::Shared::K5_URL_SUFFIX
Instance Attribute Summary collapse
-
#k5_project_id ⇒ Object
readonly
Returns the value of attribute k5_project_id.
-
#k5_region ⇒ Object
readonly
Returns the value of attribute k5_region.
Instance Method Summary collapse
- #delete_object(container, object, _options = {}) ⇒ Object
- #get_object(container, object, _options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Real
constructor
A new instance of Real.
- #list_containers(_options = {}) ⇒ Object
- #list_objects(container, _options = {}) ⇒ Object
- #put_object(container, object, data, _options = {}) ⇒ Object
Methods included from K5::Shared
#build_url, #refresh_auth_token_if_expired
Methods included from Utils
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
10 11 12 13 14 15 |
# File 'lib/fog/storage/k5/real.rb', line 10 def initialize( = {}) refresh_credentials() url = build_url(url_type: K5_STORAGE_URL_TYPE) @connection = Fog::Core::Connection.new(url, false, params) end |
Instance Attribute Details
#k5_project_id ⇒ Object (readonly)
Returns the value of attribute k5_project_id.
8 9 10 |
# File 'lib/fog/storage/k5/real.rb', line 8 def k5_project_id @k5_project_id end |
#k5_region ⇒ Object (readonly)
Returns the value of attribute k5_region.
8 9 10 |
# File 'lib/fog/storage/k5/real.rb', line 8 def k5_region @k5_region end |
Instance Method Details
#delete_object(container, object, _options = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/storage/k5/requests/delete_object.rb', line 5 def delete_object(container, object, = {}) request( method: :DELETE, path: "#{container}/#{object}", expects: 204, ) end |
#get_object(container, object, _options = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/storage/k5/requests/get_object.rb', line 5 def get_object(container, object, = {}) request( method: :GET, path: "#{container}/#{object}", expects: 200, ) end |
#list_containers(_options = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/storage/k5/requests/list_containers.rb', line 5 def list_containers( = {}) request( method: :GET, path: '/', expects: 200, ) end |
#list_objects(container, _options = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/storage/k5/requests/list_objects.rb', line 5 def list_objects(container, = {}) request( method: :GET, path: container, expects: 200, ) end |
#put_object(container, object, data, _options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/fog/storage/k5/requests/put_object.rb', line 5 def put_object(container, object, data, = {}) data = Fog::Storage.parse_data(data) params = { method: :PUT, path: "#{container}/#{object}", expects: 201, } request(params.merge(data)) end |