Sha256: f3f3ccac45af5fbc1cd76666a434ae412e516bd15b8f61e152bfbcd1365adc40

Contents?: true

Size: 1.02 KB

Versions: 39

Compression:

Stored size: 1.02 KB

Contents

require 'fog/vcloud_director/compute'

def boolean?(item)
  [TrueClass, FalseClass].include?(item.class)
end

def vcloud_director
  @vcloud_director ||= Fog::Compute::VcloudDirector.new(
    :connection_options => {
      :ssl_verify_peer => false,
      :connect_timeout => 200,
      :read_timeout => 200
    }
  )
end

def organizations
  @organizations ||= vcloud_director.organizations
end

def organization
  @organization ||= organizations.get_by_name(vcloud_director.org_name)
end

def catalogs
  @catalogs ||= organization.catalogs
end

def catalog
  catalogs.first
end

def vdcs
  @vdcs ||= organization.vdcs
end

def vdc
  vdcs.first
end

def vapps
  @vapps ||= vdc.vapps
end

def vapp
  vapps.detect {|vapp| vapp.vms.size >= 1 }
end

def the_network
  @network ||= organization.networks.get_by_name(NETWORK_NAME)
end

def the_catalog
  @catalog ||= organization.catalogs.get_by_name(CATALOG_NAME)
end

def the_catalog_item
  return nil unless the_catalog
  @catalog_item ||= the_catalog.catalog_items.get_by_name(CATALOG_ITEM_NAME)
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
fog-1.22.0 tests/vcloud_director/models/compute/helper.rb
fog-1.21.0 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.20.0.20140305101839 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.20.0.20140305101305 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.19.0.20140212012611 tests/vcloud_director/models/compute/helper.rb
fog-1.20.0 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.19.0.20140110004459 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.19.0.20140110003812 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.19.0.20140109202555 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.19.0.20140107192102 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.19.0.20140107142106 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.19.0.20131219203941 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.18.0.20131219193542 tests/vcloud_director/models/compute/helper.rb
fog-1.19.0 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.18.0.20131219033443 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.18.0.20131219032002 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.18.0.20131219030716 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.18.0.20131219022322 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.18.0.20131218202447 tests/vcloud_director/models/compute/helper.rb
fog-maestrodev-1.18.0.20131209091424 tests/vcloud_director/models/compute/helper.rb