Class: Fog::Compute::VcloudDirector::Vms

Inherits:
Collection
  • Object
show all
Includes:
VcloudDirector::Query
Defined in:
lib/fog/vcloud_director/models/compute/vms.rb

Instance Method Summary collapse

Methods included from VcloudDirector::Query

#find_by_query

Methods inherited from Collection

#all, #get, #get_by_name, #get_everyone, #index

Instance Method Details

#get_by_metadata(key, value) ⇒ Object



15
16
17
18
19
# File 'lib/fog/vcloud_director/models/compute/vms.rb', line 15

def (key, value)
  data = service.(key, value).body
  items = data[:vm_records]
  load(items)
end

#get_single_vm(vm_id) ⇒ Object



21
22
23
24
25
# File 'lib/fog/vcloud_director/models/compute/vms.rb', line 21

def get_single_vm(vm_id)
  item = service.get_vm(vm_id).body
  return nil unless item
  new(item[:vm])
end

#query_typeObject



27
28
29
# File 'lib/fog/vcloud_director/models/compute/vms.rb', line 27

def query_type
  "vm"
end