Class: RbVmomi::VIM::Datacenter

Inherits:
Object
  • Object
show all
Defined in:
lib/rbvmomi/vim/Datacenter.rb

Overview

Copyright © 2011-2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: MIT

Instance Method Summary collapse

Instance Method Details

#find_compute_resource(path) ⇒ Object

Traverse the given inventory path to find a ComputeResource.



7
8
9
# File 'lib/rbvmomi/vim/Datacenter.rb', line 7

def find_compute_resource path
  hostFolder.traverse path, RbVmomi::VIM::ComputeResource
end

#find_datastore(name) ⇒ Object

Find the Datastore with the given name.



12
13
14
# File 'lib/rbvmomi/vim/Datacenter.rb', line 12

def find_datastore name
  datastore.find { |x| x.name == name }
end

#find_folder(path) ⇒ Object

Traverse the given inventory path to find a Folder.



22
23
24
# File 'lib/rbvmomi/vim/Datacenter.rb', line 22

def find_folder path
  vmFolder.traverse path, RbVmomi::VIM::Folder
end

#find_vm(path) ⇒ Object

Traverse the given inventory path to find a VirtualMachine.



17
18
19
# File 'lib/rbvmomi/vim/Datacenter.rb', line 17

def find_vm path
  vmFolder.traverse path, RbVmomi::VIM::VirtualMachine
end