Class: ESX::NetworkInterface

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#_wrapped_objectObject

Returns the value of attribute _wrapped_object.



491
492
493
# File 'lib/esx.rb', line 491

def _wrapped_object
  @_wrapped_object
end

Class Method Details

.wrap(obj) ⇒ Object

Accepts VirtualEthernetCard and GuestNicInfo objects



494
495
496
497
498
# File 'lib/esx.rb', line 494

def self.wrap(obj)
  ni = NetworkInterface.new
  ni._wrapped_object = obj
  ni
end

Instance Method Details

#ip_addressObject

returns nil if the NetworkInterface is of type VirtualEthernetCard returns the IP address if VMWare tools installed in guest and _wrapped_object is of type GuestNicInfo



503
504
505
506
507
508
509
# File 'lib/esx.rb', line 503

def ip_address
  if _wrapped_object.is_a? RbVmomi::VIM::VirtualEthernetCard
    nil
  else
    _wrapped_object.ipAddress.first
  end
end

#macObject



511
512
513
# File 'lib/esx.rb', line 511

def mac
  _wrapped_object.macAddress 
end