Class: Pangea::Network

Inherits:
XObject show all
Defined in:
lib/pangea/objects.rb

Instance Method Summary collapse

Methods inherited from XObject

#ref_call, #uuid

Constructor Details

#initialize(link, ref) ⇒ Network

:nodoc:



626
627
628
629
# File 'lib/pangea/objects.rb', line 626

def initialize(link, ref) #:nodoc:
  super(link, ref)
  @proxy_name = 'network'
end

Instance Method Details

#default_gatewayObject

Returns a string or nil if the gateway is not defined.

xen-api: network.get_default_gateway



641
642
643
644
645
# File 'lib/pangea/objects.rb', line 641

def default_gateway
  gw = ref_call :get_default_gateway
  return nil if gw.strip.chomp.empty?
  gw
end

#default_netmaskObject

Returns a string or nil if the netmask is not defined.

xen-api: network.get_default_netmask



653
654
655
656
657
# File 'lib/pangea/objects.rb', line 653

def default_netmask
  nm = ref_call :get_default_netmask
  return nil if nm.strip.chomp.empty?
  gw
end

#labelObject



631
632
633
# File 'lib/pangea/objects.rb', line 631

def label
  ref_call :get_name_label
end

#vifsObject

Virtual Interfaces bridged to the network bridge

xen-api: network.get_VIFs



664
665
666
667
668
669
670
# File 'lib/pangea/objects.rb', line 664

def vifs
  l = []
  ref_call(:get_VIFs).each do |ref|
    l << VIF.new(@link, ref)
  end
  l
end