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.
38 39 40 |
# File 'lib/fog/rackspace/identity.rb', line 38 def auth_token @auth_token end |
#service_catalog ⇒ Object (readonly)
Returns the value of attribute service_catalog.
38 39 40 |
# File 'lib/fog/rackspace/identity.rb', line 38 def service_catalog @service_catalog end |
Instance Method Details
#apply_options(options) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fog/rackspace/identity.rb', line 46 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
40 41 42 43 44 |
# File 'lib/fog/rackspace/identity.rb', line 40 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 |