Methods

Files

Class/Module Index [+]

Quicksearch

Fog::Vcloud::Compute::Networks

Public Instance Methods

all() click to toggle source
# File lib/fog/vcloud/models/compute/networks.rb, line 15
def all
  self.href = connection.default_vdc_href unless self.href
  data = nil
  if self.href =~ /\/vdc\//
    check_href!("Vdc")
    data = [connection.get_vdc(self.href).body[:AvailableNetworks][:Network]].flatten.compact
  elsif self.href =~ /\/org\//
    check_href!("Org")
    links = (l=connection.get_organization(self.href).body[:Link]).is_a?(Array) ? l : [l].compact
    data = links.select{|l| l[:type] == 'application/vnd.vmware.vcloud.network+xml' }
  elsif self.href =~ /\/vApp\//
    check_href!("Vapp")
    data = [(connection.get_vapp(self.href).body[:NetworkConfigSection]||{})[:NetworkConfig]].flatten.compact.collect{|n| n[:Configuration][:ParentNetwork] unless n[:Configuration].nil? }.compact
  end
  load([*data]) unless data.nil?
end
get(uri) click to toggle source
# File lib/fog/vcloud/models/compute/networks.rb, line 32
def get(uri)
  if data = connection.get_network(uri)
    new(data.body)
  end
  rescue Fog::Errors::NotFound
  nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.