Class: Miasma::Contrib::RackspaceApiCore
- Inherits:
-
OpenStackApiCore
- Object
- OpenStackApiCore
- Miasma::Contrib::RackspaceApiCore
- Defined in:
- lib/miasma/contrib/rackspace.rb
Overview
Rackspace API core helper
Defined Under Namespace
Modules: ApiCommon Classes: Authenticate
Constant Summary collapse
- AUTH_ENDPOINT =
Returns Authentication endpoints.
Smash.new( :us => 'https://identity.api.rackspacecloud.com/v2.0', :uk => 'https://lon.identity.api.rackspacecloud.com/v2.0' )
- API_MAP =
Note:
[“cloudFilesCDN”, “cloudFiles”, “cloudBlockStorage”,
“cloudImages”, “cloudQueues”, “cloudBigData”, “cloudOrchestration”, “cloudServersOpenStack”, “autoscale”, “cloudDatabases”, “cloudBackup”, “cloudMetrics”, “cloudLoadBalancers”, “cloudNetworks”, “cloudFeeds”, “cloudMonitoring”, “cloudDNS”]
Smash.new( 'compute' => 'cloudServersOpenStack', 'orchestration' => 'cloudOrchestration', 'auto_scale' => 'autoscale', 'load_balancer' => 'cloudLoadBalancers' )
Instance Attribute Summary
Attributes inherited from OpenStackApiCore
Instance Method Summary collapse
-
#account_id ⇒ String
ID of account.
-
#initialize(creds) ⇒ self
constructor
Create a new api instance.
Methods inherited from OpenStackApiCore
#api_token, #endpoint_for, #identity_class
Methods included from Utils::Memoization
#_memo, #clear_memoizations!, #memoize, #unmemoize
Constructor Details
#initialize(creds) ⇒ self
Create a new api instance
86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/miasma/contrib/rackspace.rb', line 86 def initialize(creds) if(creds[:rackspace_region].to_s == 'lon') endpoint = AUTH_ENDPOINT[:uk] else endpoint = AUTH_ENDPOINT[:us] end super Smash.new( :open_stack_username => creds[:rackspace_username], :open_stack_token => creds[:rackspace_api_key], :open_stack_region => creds[:rackspace_region], :open_stack_identity_url => endpoint ) end |
Instance Method Details
#account_id ⇒ String
Returns ID of account.
101 102 103 |
# File 'lib/miasma/contrib/rackspace.rb', line 101 def account_id identity.token[:tenant][:id] end |