Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python moref id vsphere

from pyVim.connect import SmartConnect
from pyVmomi import vim
si = SmartConnect(host='10.12.254.137', user='administrator@vsphere.local', pwd='password')
content = si.RetrieveContent()
children = content.rootFolder.childEntity
for child in children:
    print child

'vim.Datacenter:datacenter-33'
'vim.Datacenter:datacenter-2'
children[0].name
'1000110'
dc = vim.Datacenter('datacenter-33')
dc._stub = si._stub
dc.name
'1000110'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #moref #id #vsphere
ADD COMMENT
Topic
Name
4+8 =