Class: Fog::Account::Softlayer::Real
- Inherits:
-
Object
- Object
- Fog::Account::Softlayer::Real
- Includes:
- Softlayer::Compute::Shared, Softlayer::Slapi
- Defined in:
- lib/fog/softlayer/account.rb,
lib/fog/softlayer/requests/account/get_brand.rb,
lib/fog/softlayer/requests/account/create_brand.rb,
lib/fog/softlayer/requests/account/get_account_owned_brands.rb,
lib/fog/softlayer/requests/account/get_brand_owned_accounts.rb
Overview
Makes real connections to Softlayer.
Instance Method Summary collapse
- #create_brand(attributes) ⇒ Object
- #get_account_owned_brands(identifier) ⇒ Object
- #get_brand(identifier) ⇒ Object
- #get_brand_owned_accounts(identifier) ⇒ Object
-
#initialize(options = {}) ⇒ Real
constructor
A new instance of Real.
- #request(service, path, options = {}) ⇒ Object
Methods included from Softlayer::Compute::Shared
Methods included from Softlayer::Slapi
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
54 55 56 57 |
# File 'lib/fog/softlayer/account.rb', line 54 def initialize(={}) @softlayer_api_key = [:softlayer_api_key] @softlayer_username = [:softlayer_username] end |
Instance Method Details
#create_brand(attributes) ⇒ Object
35 36 37 |
# File 'lib/fog/softlayer/requests/account/create_brand.rb', line 35 def create_brand(attributes) request(:brand, :create_object, :body => attributes, :http_method => :POST) end |
#get_account_owned_brands(identifier) ⇒ Object
31 32 33 34 |
# File 'lib/fog/softlayer/requests/account/get_account_owned_brands.rb', line 31 def get_account_owned_brands(identifier) return request(:account, :getOwnedBrands) if identifier.nil? request(:account, "#{identifier}/getOwnedBrands") end |
#get_brand(identifier) ⇒ Object
30 31 32 |
# File 'lib/fog/softlayer/requests/account/get_brand.rb', line 30 def get_brand(identifier) request(:brand, identifier, :expected => [200, 404], :query => 'objectMask=mask[account]') end |
#get_brand_owned_accounts(identifier) ⇒ Object
32 33 34 |
# File 'lib/fog/softlayer/requests/account/get_brand_owned_accounts.rb', line 32 def get_brand_owned_accounts(identifier) request(:brand, "#{identifier}/getOwnedAccounts") end |
#request(service, path, options = {}) ⇒ Object
59 60 61 62 |
# File 'lib/fog/softlayer/account.rb', line 59 def request(service, path, = {}) = {:username => @softlayer_username, :api_key => @softlayer_api_key}.merge() Fog::Softlayer::Slapi.slapi_request(service, path, ) end |