Sha256: 08c72367537b61f4d0e72d89db4a48846a3faa97682f4e6d44a5bcda79728e61

Contents?: true

Size: 1.02 KB

Versions: 57

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.find {|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

57 entries across 55 versions & 7 rubygems

Version Path
fog-2.3.0 tests/vcloud_director/models/compute/helper.rb
fog-ifeel-2.2.0 tests/vcloud_director/models/compute/helper.rb
fog-2.2.0 tests/vcloud_director/models/compute/helper.rb
fog-2.1.0 tests/vcloud_director/models/compute/helper.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/tests/vcloud_director/models/compute/helper.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/tests/vcloud_director/models/compute/helper.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/tests/vcloud_director/models/compute/helper.rb
fog-1.42.1 tests/vcloud_director/models/compute/helper.rb
fog-vcloud-director-0.2.2 tests/vcloud_director/models/compute/helper.rb
fog-vcloud-director-0.2.1 tests/vcloud_director/models/compute/helper.rb
fog-vcloud-director-0.2.0 tests/vcloud_director/models/compute/helper.rb
fog-vcloud-director-0.1.10 tests/vcloud_director/models/compute/helper.rb
fog-vcloud-director-0.1.9 tests/vcloud_director/models/compute/helper.rb
fog-2.0.0 tests/vcloud_director/models/compute/helper.rb
fog-1.42.0 tests/vcloud_director/models/compute/helper.rb
fog-1.41.0 tests/vcloud_director/models/compute/helper.rb
fog-1.40.0 tests/vcloud_director/models/compute/helper.rb
fog-1.39.0 tests/vcloud_director/models/compute/helper.rb
fog-vcloud-director-0.1.8 tests/vcloud_director/models/compute/helper.rb
fog-vcloud-director-0.1.7 tests/vcloud_director/models/compute/helper.rb