Parent

Class/Module Index [+]

Quicksearch

Fog::Terremark::Vcloud::Real

Public Class Methods

new(options={}) click to toggle source
# File lib/fog/terremark/vcloud.rb, line 40
def initialize(options={})
  @terremark_password = options[:terremark_vcloud_password]
  @terremark_username = options[:terremark_vcloud_username]
  @connection_options = options[:connection_options] || {}
  @host       = options[:host]        || Fog::Terremark::Vcloud::Defaults::HOST
  @path       = options[:path]        || Fog::Terremark::Vcloud::Defaults::PATH
  @persistent = options[:persistent]  || false
  @port       = options[:port]        || Fog::Terremark::Vcloud::Defaults::PORT
  @scheme     = options[:scheme]      || Fog::Terremark::Vcloud::Defaults::SCHEME
  @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end

Public Instance Methods

default_network_id() click to toggle source
# File lib/fog/terremark/vcloud.rb, line 69
def default_network_id
  if default_vdc_id
    @default_network_id ||= begin
      networks = get_vdc(default_vdc_id).body['AvailableNetworks']
      if networks.length == 1
        networks.first['href'].split('/').last.to_i
      else
        nil
      end
    end
  else
    nil
  end
end
default_public_ip_id() click to toggle source
# File lib/fog/terremark/vcloud.rb, line 84
def default_public_ip_id
  if default_vdc_id
    @default_public_ip_id ||= begin
      ips = get_public_ips(default_vdc_id).body['PublicIpAddresses']
      if ips.length == 1
        ips.first['href'].split('/').last.to_i
      else
        nil
      end
    end
  else
    nil
  end
end
default_vdc_id() click to toggle source
# File lib/fog/terremark/vcloud.rb, line 52
def default_vdc_id
  if default_organization_id
    @default_vdc_id ||= begin
      vdcs = get_organization(default_organization_id).body['Links'].select {|link|
        link['type'] == 'application/vnd.vmware.vcloud.vdc+xml'
      }
      if vdcs.length == 1
        vdcs.first['href'].split('/').last.to_i
      else
        nil
      end
    end
  else
    nil
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.