Class: Openstack::Client

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/openstack/client.rb,
lib/openstack/client/storage.rb,
lib/openstack/client/authenticator.rb,
lib/openstack/client/storage/get_object.rb,
lib/openstack/client/storage/put_object.rb,
lib/openstack/client/storage/list_objects.rb,
lib/openstack/client/authenticator/request.rb,
lib/openstack/client/storage/delete_object.rb,
lib/openstack/client/storage/object_store_url.rb,
lib/openstack/client/storage/bulk_delete_objects.rb,
lib/openstack/client/storage/get_object_by_range.rb,
lib/openstack/client/storage/create_temporary_uri.rb,
lib/openstack/client/storage/show_object_metadata.rb

Overview

:reek:IrresponsibleModule

Defined Under Namespace

Classes: Authenticator, Storage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username:, password:, cache: Rails.cache) ⇒ Client

Returns a new instance of Client.



16
17
18
19
20
# File 'lib/openstack/client.rb', line 16

def initialize(username:, password:, cache: Rails.cache)
  @username = username
  @password = password
  @cache = cache
end

Instance Attribute Details

#cacheObject (readonly)

Returns the value of attribute cache.



8
9
10
# File 'lib/openstack/client.rb', line 8

def cache
  @cache
end

#passwordObject (readonly)

Returns the value of attribute password.



8
9
10
# File 'lib/openstack/client.rb', line 8

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



8
9
10
# File 'lib/openstack/client.rb', line 8

def username
  @username
end

Instance Method Details

#authenticatorObject



22
23
24
25
26
27
28
# File 'lib/openstack/client.rb', line 22

def authenticator
  @authenticator ||= Authenticator.new(
    username: username,
    password: password,
    cache: cache
  )
end

#storage(container:, region:) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/openstack/client.rb', line 30

def storage(container:, region:)
  @storage ||= Storage.new(
    authenticator: authenticator,
    container: container,
    region: region
  )
end