Sha256: 243814226865400399b1c7b76940b7cca2ae2ca5930b84e676dacf85c3448907
Contents?: true
Size: 1017 Bytes
Versions: 20
Compression:
Stored size: 1017 Bytes
Contents
module Vcloud module Core module Fog # Private interface to the fog model layer. # You should not use this directly. Expose required # functionality in {Vcloud::Core::ApiInterface} # # @api private 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 end
Version data entries
20 entries across 20 versions & 1 rubygems