File: Datacenter.rb

package info (click to toggle)
ruby-rbvmomi 1.8.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,756 kB
  • sloc: ruby: 5,590; sh: 36; makefile: 7
file content (17 lines) | stat: -rw-r--r-- 472 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class RbVmomi::VIM::Datacenter
  # Traverse the given inventory +path+ to find a ComputeResource.
  def find_compute_resource path
    hostFolder.traverse path, RbVmomi::VIM::ComputeResource
  end

  # Find the Datastore with the given +name+.
  def find_datastore name
    datastore.find { |x| x.name == name }
  end

  # Traverse the given inventory +path+ to find a VirtualMachine.
  def find_vm path
    vmFolder.traverse path, RbVmomi::VIM::VirtualMachine
  end
end