Class: VagrantPlugins::Vrealize::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-vrealize/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject

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

#cpusObject

Returns the value of attribute cpus.



56
57
58
# File 'lib/vagrant-vrealize/config.rb', line 56

def cpus
  @cpus
end

#lease_daysObject

Returns the value of attribute lease_days.



56
57
58
# File 'lib/vagrant-vrealize/config.rb', line 56

def lease_days
  @lease_days
end

#memoryObject

Returns the value of attribute memory.



56
57
58
# File 'lib/vagrant-vrealize/config.rb', line 56

def memory
  @memory
end

#requested_forObject

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_idObject

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_urlString

The VRealize endpoint URL.

Returns:

  • (String)


50
51
52
# File 'lib/vagrant-vrealize/config.rb', line 50

def vra_base_url
  @vra_base_url
end

#vra_passwordString

The password for accessing the VRealize instance.

Returns:

  • (String)


36
37
38
# File 'lib/vagrant-vrealize/config.rb', line 36

def vra_password
  @vra_password
end

#vra_tenantString

The tenant to own the requested resource.

Returns:

  • (String)


43
44
45
# File 'lib/vagrant-vrealize/config.rb', line 43

def vra_tenant
  @vra_tenant
end

#vra_usernameString

The username for accessing the VRealize instance.

Returns:

  • (String)


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

Yields:

  • (@__extra_entries)


58
59
60
# File 'lib/vagrant-vrealize/config.rb', line 58

def add_entries
  yield @__extra_entries
end

#extra_entriesObject



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