Module: Fog::Rackspace::Identity::Common
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
readonly
Returns the value of attribute auth_token.
-
#service_catalog ⇒ Object
readonly
Returns the value of attribute service_catalog.
Instance Method Summary collapse
Instance Attribute Details
#auth_token ⇒ Object (readonly)
Returns the value of attribute auth_token.
37 38 39 |
# File 'lib/fog/rackspace/identity.rb', line 37 def auth_token @auth_token end |
#service_catalog ⇒ Object (readonly)
Returns the value of attribute service_catalog.
37 38 39 |
# File 'lib/fog/rackspace/identity.rb', line 37 def service_catalog @service_catalog end |
Instance Method Details
#apply_options(options) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fog/rackspace/identity.rb', line 45 def () @rackspace_username = [:rackspace_username] @rackspace_api_key = [:rackspace_api_key] @rackspace_region = [:rackspace_region] @rackspace_auth_url = [:rackspace_auth_url] || US_ENDPOINT @uri = URI.parse(@rackspace_auth_url) @host = @uri.host @path = @uri.path @port = @uri.port @scheme = @uri.scheme @persistent = [:persistent] || false @connection_options = [:connection_options] || {} end |
#authenticate(options = {}) ⇒ Object
39 40 41 42 43 |
# File 'lib/fog/rackspace/identity.rb', line 39 def authenticate(={}) data = self.create_token(@rackspace_username, @rackspace_api_key).body @service_catalog = ServiceCatalog.from_response(self, data) @auth_token = data['access']['token']['id'] end |