Issue using VmDiskQuery and VmDiskQuery.Details

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Issue using VmDiskQuery and VmDiskQuery.Details

brunoer
vim.host.DatastoreBrowser.VmDiskQuery

When I attempt to use VMDiskQuery.Details with VmDiskQuery I get attribute type excepting saying it is expecting FileInfo.Details.

This works
                       search_spec = vim.host.DatastoreBrowser.SearchSpec(query=[vim.host.DatastoreBrowser.VmDiskQuery()])
                        queryDetails = vim.host.DatastoreBrowser.FileInfo.Details()
                        queryDetails.fileSize = True
                        queryDetails.modification = True
                        queryDetails.fileType = True
                        queryDetails.fileOwner = True
                        search_spec.details = queryDetails

This throws and exception.
                       search_spec = vim.host.DatastoreBrowser.SearchSpec(query=[vim.host.DatastoreBrowser.VmDiskQuery()])
                        queryDetailsDisk = vim.host.DatastoreBrowser.VmDiskQuery.Details()
                        queryDetailsDisk.capacityKb = True
                        queryDetailsDisk.diskType = True
                        queryDetailsDisk.hardwareVersion = True
                        queryDetailsDisk.thin = True
                        search_spec.details = queryDetailsDisk
 

   File "./test.py", line NNNN, in myFunction
     search_spec.details = queryDetailsDisk
 
   File "/usr/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 537, in __setattr__
     CheckField(self._GetPropertyInfo(name), val)
 
   File "/usr/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 972, in CheckField
     % (info.name, info.type.__name__, valType.__name__))
 
 TypeError: For "details" expected type vim.host.DatastoreBrowser.FileInfo.Details, but got vim.host.DatastoreBrowser.VmDiskQuery.Details

Looking for suggestions on usage or could this be an actually issue.  
The server ESXI 6.5.