1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

(#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.
This commit is contained in:
Jeff McCune 2011-09-02 10:50:06 -07:00
parent 00fbdaa932
commit d6fed7e4e4
3 changed files with 45 additions and 0 deletions

View file

@ -15,6 +15,8 @@ module Fog
request_path 'fog/vsphere/requests/compute'
request :current_time
request :list_virtual_machines
request :find_all_by_uuid
request :find_all_by_instance_uuid
class Mock

View file

@ -0,0 +1,21 @@
module Fog
module Compute
class Vsphere
class Real
def find_all_by_instance_uuid(uuid)
@connection.searchIndex.FindAllByUuid(:uuid => uuid, 'vmSearch' => true, 'instanceUuid' => true)
end
end
class Mock
def find_all_by_instance_uuid(uuid)
Fog::Mock.not_implmented
end
end
end
end
end

View file

@ -0,0 +1,22 @@
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