Class: Bosh::Blobstore::SwiftBlobstoreClient
- Inherits:
-
BaseClient
- Object
- Client
- BaseClient
- Bosh::Blobstore::SwiftBlobstoreClient
- Defined in:
- lib/blobstore_client/swift_blobstore_client.rb
Constant Summary
Constants inherited from Client
Client::PROVIDER_NAMES, Client::VERSION
Instance Method Summary collapse
- #container ⇒ Object
-
#initialize(options) ⇒ SwiftBlobstoreClient
constructor
Blobstore client for OpenStack Swift.
Methods inherited from BaseClient
#create, #delete, #exists?, #get
Methods inherited from Client
Constructor Details
#initialize(options) ⇒ SwiftBlobstoreClient
Blobstore client for OpenStack Swift
18 19 20 21 |
# File 'lib/blobstore_client/swift_blobstore_client.rb', line 18 def initialize() super() @http_client = HTTPClient.new end |
Instance Method Details
#container ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/blobstore_client/swift_blobstore_client.rb', line 23 def container return @container if @container (@options) swift_provider = @options[:swift_provider] = { provider: swift_provider } .merge!(@options[swift_provider.to_sym]) if .has_key?(:openstack_auth_url) unless [:openstack_auth_url].match(/\/tokens$/) [:openstack_auth_url] = [:openstack_auth_url] + '/tokens' end end swift = Fog::Storage.new() container_name = @options[:container_name] @container = swift.directories.get(container_name) raise NotFound, "Swift container '#{container_name}' not found" if @container.nil? @container end |