Class: Vmesh::CustomSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/vmesh/custom_spec.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ CustomSpec

Returns a new instance of CustomSpec.



6
7
8
# File 'lib/vmesh/custom_spec.rb', line 6

def initialize(spec)
  @spec = spec
end

Instance Attribute Details

#ip_addressObject

Returns the value of attribute ip_address.



5
6
7
# File 'lib/vmesh/custom_spec.rb', line 5

def ip_address
  @ip_address
end

#specObject

Returns the value of attribute spec.



5
6
7
# File 'lib/vmesh/custom_spec.rb', line 5

def spec
  @spec
end

Class Method Details

.get(custom_spec_manager, name) ⇒ Object



10
11
12
13
14
# File 'lib/vmesh/custom_spec.rb', line 10

def self.get(custom_spec_manager, name)
  Vmesh::logger.debug "Looking for spec #{name}"
  spec = custom_spec_manager.GetCustomizationSpec(:name => name).spec or raise "unable to find the custom spec #{name}."
  CustomSpec.new(spec)
end

Instance Method Details

#destination_ip_addressObject



21
22
23
# File 'lib/vmesh/custom_spec.rb', line 21

def destination_ip_address
  @spec.nicSettingMap.first.adapter.ip
end

#destination_ip_address=(ip) ⇒ Object



16
17
18
19
# File 'lib/vmesh/custom_spec.rb', line 16

def destination_ip_address=(ip)
  Vmesh::logger.debug "Setting spec ip address to #{ip}"
  @spec.nicSettingMap.first.adapter.ip = RbVmomi::VIM::CustomizationFixedIp("ipAddress" => ip)
end