1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/vsphere/requests/compute/find_all_by_uuid.rb
Jeff McCune d6fed7e4e4 (#9241) Add ability to find VMs by UUID
This patch adds two request methods to the compute service for VMware.
First, finding a VM by it's own UUID (from the vmx file) is supported.
This UUID is not guaranteed to be unique so this patch also implements
finding by instance UUID which is guaranteed to be unique.

The server models will primarily use these requests to obtain VM
managed objects to issue commands against.
2011-09-10 13:32:58 -07:00

22 lines
336 B
Ruby

module Fog
module Compute
class Vsphere
class Real
def find_all_by_uuid(uuid)
@connection.searchIndex.FindAllByUuid(:uuid => uuid, 'vmSearch' => true)
end
end
class Mock
def find_all_by_uuid(uuid)
Fog::Mock.not_implmented
end
end
end
end
end