Class: VagrantPlugins::Rightscale::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Rightscale::Config
- Defined in:
- lib/vagrant-rightscale/config.rb
Constant Summary collapse
- VAGRANT_CLOUD_NAME =
This plugin requires that you have the BlueSkies cloud registered in your RightScale account. This cloud is currently in private beta. Contact [email protected] for more information.
"BlueSkies"
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#api_url ⇒ Object
Returns the value of attribute api_url.
-
#cloud_name ⇒ Object
Returns the value of attribute cloud_name.
-
#deployment_name ⇒ Object
Returns the value of attribute deployment_name.
-
#email ⇒ Object
Returns the value of attribute email.
-
#multi_cloud_image_name ⇒ Object
Returns the value of attribute multi_cloud_image_name.
-
#operational_scripts ⇒ Object
Returns the value of attribute operational_scripts.
-
#password ⇒ Object
Returns the value of attribute password.
-
#server_inputs ⇒ Object
Returns the value of attribute server_inputs.
-
#server_name ⇒ Object
Returns the value of attribute server_name.
-
#servertemplate ⇒ Object
name or id.
Instance Method Summary collapse
-
#finalize! ⇒ Object
This method is called only once ever on the final configuration object in order to set defaults.
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
22 23 24 25 26 27 28 29 |
# File 'lib/vagrant-rightscale/config.rb', line 22 def initialize super # default all local instance variables to UNSET_VALUE setters = (t.methods - Object.methods).select { |m| m =~ /=/ } puts setters.inspect setters.map { |var| t.instance_variable_set(:@var, UNSET_VALUE) } end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
12 13 14 |
# File 'lib/vagrant-rightscale/config.rb', line 12 def account_id @account_id end |
#api_url ⇒ Object
Returns the value of attribute api_url.
13 14 15 |
# File 'lib/vagrant-rightscale/config.rb', line 13 def api_url @api_url end |
#cloud_name ⇒ Object
Returns the value of attribute cloud_name.
17 18 19 |
# File 'lib/vagrant-rightscale/config.rb', line 17 def cloud_name @cloud_name end |
#deployment_name ⇒ Object
Returns the value of attribute deployment_name.
15 16 17 |
# File 'lib/vagrant-rightscale/config.rb', line 15 def deployment_name @deployment_name end |
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/vagrant-rightscale/config.rb', line 10 def email @email end |
#multi_cloud_image_name ⇒ Object
Returns the value of attribute multi_cloud_image_name.
16 17 18 |
# File 'lib/vagrant-rightscale/config.rb', line 16 def multi_cloud_image_name @multi_cloud_image_name end |
#operational_scripts ⇒ Object
Returns the value of attribute operational_scripts.
20 21 22 |
# File 'lib/vagrant-rightscale/config.rb', line 20 def operational_scripts @operational_scripts end |
#password ⇒ Object
Returns the value of attribute password.
11 12 13 |
# File 'lib/vagrant-rightscale/config.rb', line 11 def password @password end |
#server_inputs ⇒ Object
Returns the value of attribute server_inputs.
19 20 21 |
# File 'lib/vagrant-rightscale/config.rb', line 19 def server_inputs @server_inputs end |
#server_name ⇒ Object
Returns the value of attribute server_name.
18 19 20 |
# File 'lib/vagrant-rightscale/config.rb', line 18 def server_name @server_name end |
#servertemplate ⇒ Object
name or id
14 15 16 |
# File 'lib/vagrant-rightscale/config.rb', line 14 def servertemplate @servertemplate end |
Instance Method Details
#finalize! ⇒ Object
This method is called only once ever on the final configuration object in order to set defaults. If finalize! is called, that configuration will never be merged again, it is final. This lets you detect any UNSET_VALUE and set the proper default.
35 36 37 |
# File 'lib/vagrant-rightscale/config.rb', line 35 def finalize! @cloud_name = VAGRANT_CLOUD_NAME if @cloud_name == UNSET_VALUE || @cloud_name == nil end |
#validate(machine) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/vagrant-rightscale/config.rb', line 39 def validate(machine) # define the set of required options required_values = { "email" => @email, "password" => @password, "account_id" => @account_id } # verify all required options have a value required_values.keys.each do |key| if required_values[key] == UNSET_VALUE || required_values[key] == nil return { "rightscale" => ["you must supply a value for #{key}"] } end end {} end |