Class: Skeme::Managers::RightScale
- Inherits:
-
Object
- Object
- Skeme::Managers::RightScale
- Defined in:
- lib/managers/rightscale.rb
Constant Summary collapse
- @@region_hash =
{'us-east-1' => 1, 'eu-west-1' => 2, 'us-west-1' => 3, 'ap-northeast-1' => 4, 'ap-southeast-1' => 5}
Instance Attribute Summary collapse
-
#gotime ⇒ Object
Returns the value of attribute gotime.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RightScale
constructor
A new instance of RightScale.
- #set_tag(params = {}) ⇒ Object
- #unset_tag(params = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ RightScale
Returns a new instance of RightScale.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/managers/rightscale.rb', line 24 def initialize(={}) @logger = [:logger] if [:rs_email] && [:rs_pass] && [:rs_acct_num] pass = [:rs_pass].gsub('"', '\\"') @logger.info("RightScale credentials supplied. RightScale Tagging Enabled.") ::RightScale::Api::BaseExtend.class_eval <<-EOF @@connection ||= RestConnection::Connection.new @@connection.settings = { :user => "#{[:rs_email]}", :pass => "#{pass}", :api_url => "https://my.rightscale.com/api/acct/#{[:rs_acct_num]}", :common_headers => { "X_API_VERSION" => "1.0" } } EOF ::RightScale::Api::Base.class_eval <<-EOF @@connection ||= RestConnection::Connection.new @@connection.settings = { :user => "#{[:rs_email]}", :pass => "#{pass}", :api_url => "https://my.rightscale.com/api/acct/#{[:rs_acct_num]}", :common_headers => { "X_API_VERSION" => "1.0" } } EOF @gotime = true end end |
Instance Attribute Details
#gotime ⇒ Object
Returns the value of attribute gotime.
20 21 22 |
# File 'lib/managers/rightscale.rb', line 20 def gotime @gotime end |
#logger ⇒ Object
Returns the value of attribute logger.
20 21 22 |
# File 'lib/managers/rightscale.rb', line 20 def logger @logger end |
Instance Method Details
#set_tag(params = {}) ⇒ Object
57 58 59 |
# File 'lib/managers/rightscale.rb', line 57 def set_tag(params={}) tag(params.merge({:action => "set"})) end |
#unset_tag(params = {}) ⇒ Object
61 62 63 |
# File 'lib/managers/rightscale.rb', line 61 def unset_tag(params={}) tag(params.merge({:action => "unset"})) end |