Class: VagrantPlugins::Vrealize::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Vrealize::Config
- Defined in:
- lib/vagrant-vrealize/config.rb
Instance Attribute Summary collapse
-
#catalog_item_id ⇒ Object
Returns the value of attribute catalog_item_id.
-
#cpus ⇒ Object
Returns the value of attribute cpus.
-
#lease_days ⇒ Object
Returns the value of attribute lease_days.
-
#memory ⇒ Object
Returns the value of attribute memory.
-
#requested_for ⇒ Object
Returns the value of attribute requested_for.
-
#subtenant_id ⇒ Object
Returns the value of attribute subtenant_id.
-
#vra_base_url ⇒ String
The VRealize endpoint URL.
-
#vra_password ⇒ String
The password for accessing the VRealize instance.
-
#vra_tenant ⇒ String
The tenant to own the requested resource.
-
#vra_username ⇒ String
The username for accessing the VRealize instance.
Instance Method Summary collapse
- #add_entries {|@__extra_entries| ... } ⇒ Object
- #extra_entries ⇒ Object
-
#initialize(*args, &blk) ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize(*args, &blk) ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/vagrant-vrealize/config.rb', line 8 def initialize(*args, &blk) @vra_username = @vra_password = @vra_tenant = @vra_base_url = @subtenant_id = @catalog_item_id = @requested_for = UNSET_VALUE @cpus = 1 @memory = 1024 @lease_days = 5 @__extra_entries = ExtraEntries.new super end |
Instance Attribute Details
#catalog_item_id ⇒ Object
Returns the value of attribute catalog_item_id.
55 56 57 |
# File 'lib/vagrant-vrealize/config.rb', line 55 def catalog_item_id @catalog_item_id end |
#cpus ⇒ Object
Returns the value of attribute cpus.
56 57 58 |
# File 'lib/vagrant-vrealize/config.rb', line 56 def cpus @cpus end |
#lease_days ⇒ Object
Returns the value of attribute lease_days.
56 57 58 |
# File 'lib/vagrant-vrealize/config.rb', line 56 def lease_days @lease_days end |
#memory ⇒ Object
Returns the value of attribute memory.
56 57 58 |
# File 'lib/vagrant-vrealize/config.rb', line 56 def memory @memory end |
#requested_for ⇒ Object
Returns the value of attribute requested_for.
56 57 58 |
# File 'lib/vagrant-vrealize/config.rb', line 56 def requested_for @requested_for end |
#subtenant_id ⇒ Object
Returns the value of attribute subtenant_id.
54 55 56 |
# File 'lib/vagrant-vrealize/config.rb', line 54 def subtenant_id @subtenant_id end |
#vra_base_url ⇒ String
The VRealize endpoint URL.
50 51 52 |
# File 'lib/vagrant-vrealize/config.rb', line 50 def vra_base_url @vra_base_url end |
#vra_password ⇒ String
The password for accessing the VRealize instance.
36 37 38 |
# File 'lib/vagrant-vrealize/config.rb', line 36 def vra_password @vra_password end |
#vra_tenant ⇒ String
The tenant to own the requested resource.
43 44 45 |
# File 'lib/vagrant-vrealize/config.rb', line 43 def vra_tenant @vra_tenant end |
#vra_username ⇒ String
The username for accessing the VRealize instance.
30 31 32 |
# File 'lib/vagrant-vrealize/config.rb', line 30 def vra_username @vra_username end |
Instance Method Details
#add_entries {|@__extra_entries| ... } ⇒ Object
58 59 60 |
# File 'lib/vagrant-vrealize/config.rb', line 58 def add_entries yield @__extra_entries end |
#extra_entries ⇒ Object
62 63 64 |
# File 'lib/vagrant-vrealize/config.rb', line 62 def extra_entries @__extra_entries end |
#validate(machine) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/vagrant-vrealize/config.rb', line 66 def validate(machine) errors = _detected_errors() validation_failures = [ validate_vra_username(), validate_vra_password(), validate_vra_username(), validate_vra_password(), validate_vra_tenant(), validate_vra_base_url(), validate_requested_for(), validate_subtenant_id(), validate_catalog_item_id(), validate_memory() ].compact validation_failures.each do |msg| errors << msg end {'Vrealize provider' => errors} end |