Class: Fog::Compute::XenServer::Vlans

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/xenserver/models/compute/vlans.rb

Instance Method Summary collapse

Instance Method Details

#all(options = {}) ⇒ Array

Return the list of VLANs available

Returns:

  • (Array)

    a list of Fog::Compute::XenServer::VLAN



14
15
16
17
# File 'lib/fog/xenserver/models/compute/vlans.rb', line 14

def all(options = {})
  data = service.get_records 'VLAN'
  load(data)
end

#get(ref) ⇒ Fog::Compute::XenServer::VLAN

Retrieve a VLAN object by by reference.

Returns nil if not found



25
26
27
28
29
30
31
# File 'lib/fog/xenserver/models/compute/vlans.rb', line 25

def get( ref )
  if ref && obj = service.get_record( ref, 'VLAN' )
    new(obj)
  end
rescue Fog::XenServer::NotFound
  nil
end