Sha256: 9231ba9cbc63d3a8a1e2fea080a7937fc5c3a7671993f06edf31caef834badaf
Contents?: true
Size: 753 Bytes
Versions: 20
Compression:
Stored size: 753 Bytes
Contents
module Vcloud module Fog class ModelInterface def initialize @vcloud = ::Fog::Compute::VcloudDirector.new end def org_name @vcloud.org_name end def current_organization @vcloud.organizations.get_by_name org_name end def current_vdc vdc_id current_organization.vdcs.detect { |v| v.id == vdc_id } end def get_vm_by_href href vm = @vcloud.get_vms_in_lease_from_query( { :filter => "href==#{href}" }).body[:VMRecord].first return nil unless vm vdc = current_vdc(vm[:vdc].split('/').last) vapp = vdc.vapps.get_by_name(vm[:containerName]) vapp.vms.first end end end end
Version data entries
20 entries across 20 versions & 1 rubygems