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.



562
563
564
# File 'lib/esx.rb', line 562

def _wrapped_object
  @_wrapped_object
end

Class Method Details

.wrap(obj) ⇒ Object

Accepts VirtualEthernetCard and GuestNicInfo objects



565
566
567
568
569
# File 'lib/esx.rb', line 565

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



574
575
576
577
578
579
580
# File 'lib/esx.rb', line 574

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

#macObject



582
583
584
# File 'lib/esx.rb', line 582

def mac
  _wrapped_object.macAddress
end