lib/rbvmomi/vim/ManagedEntity.rb
# Retrieve the ancestors of the entity.
# @return [Array] Ancestors of this entity, starting with the root.
Retrieve the ancestors of the entity.
Retrieve the ancestors of the entity .
def path
    filterSpec = RbVmomi::VIM.PropertyFilterSpec(
      :objectSet => [{
        :obj => self,
        :selectSet => [
          RbVmomi::VIM.TraversalSpec(
            :name => 'tsME',
            :type => 'ManagedEntity',
            :path => 'parent',
            :skip => false,
            :selectSet => [
              RbVmomi::VIM.SelectionSpec(:name => 'tsME')
            ]
          )
        ]
      }],
      :propSet => [{
        :pathSet => %w(name parent),
        :type => 'ManagedEntity'
      }]
    )
    result = @soap.propertyCollector.RetrieveProperties(:specSet => [filterSpec])
    tree = {}
    result.each { |x| tree[x.obj] = [x['parent'], x['name']] }
    a = []
    cur = self
    while cur
      parent, name = *tree[cur]
      a << [cur, name]
      cur = parent
    end
    a.reverse
  end
def path filterSpec = RbVmomi :: VIM . PropertyFilterSpec ( :objectSet => [ { :obj => self , :selectSet => [ RbVmomi :: VIM . TraversalSpec ( :name => 'tsME' , :type => 'ManagedEntity' , :path => 'parent' , :skip => false , :selectSet => [ RbVmomi :: VIM . SelectionSpec ( :name => 'tsME' ) ] ) ] } ] , :propSet => [ { :pathSet => %w( name parent ) , :type => 'ManagedEntity' } ] ) result = @soap . propertyCollector . RetrieveProperties ( :specSet => [ filterSpec ] ) tree = { } result . each { | x | tree [ x . obj ] = [ x [ 'parent' ] , x [ 'name' ] ] } a = [ ] cur = self while cur parent , name = * tree [ cur ] a << [ cur , name ] cur = parent end a . reverse end
Retrieve the ancestors of the entity.
Retrieve the ancestors of the entity .
Ancestors of this entity, starting with the root.
Ancestors of this entity starting with the root .
Array