Search in sources :

Example 1 with VmDiskFileQuery

use of com.vmware.vim25.VmDiskFileQuery in project photon-model by vmware.

the class EnumerationClient method createHostDatastoreBrowserSearchSpecForDisk.

/**
 * Create search specification that searches for exact disk name.
 */
private HostDatastoreBrowserSearchSpec createHostDatastoreBrowserSearchSpecForDisk(String diskName) {
    VmDiskFileQueryFilter vdiskFilter = new VmDiskFileQueryFilter();
    VmDiskFileQuery fQuery = new VmDiskFileQuery();
    fQuery.setFilter(vdiskFilter);
    HostDatastoreBrowserSearchSpec searchSpec = new HostDatastoreBrowserSearchSpec();
    searchSpec.getQuery().add(fQuery);
    FileQueryFlags flag = new FileQueryFlags();
    flag.setFileOwner(true);
    flag.setFileSize(true);
    flag.setFileType(true);
    flag.setModification(true);
    searchSpec.setDetails(flag);
    searchSpec.getMatchPattern().add(diskName + ".vmdk");
    return searchSpec;
}
Also used : HostDatastoreBrowserSearchSpec(com.vmware.vim25.HostDatastoreBrowserSearchSpec) FileQueryFlags(com.vmware.vim25.FileQueryFlags) VmDiskFileQuery(com.vmware.vim25.VmDiskFileQuery) VmDiskFileQueryFilter(com.vmware.vim25.VmDiskFileQueryFilter)

Aggregations

FileQueryFlags (com.vmware.vim25.FileQueryFlags)1 HostDatastoreBrowserSearchSpec (com.vmware.vim25.HostDatastoreBrowserSearchSpec)1 VmDiskFileQuery (com.vmware.vim25.VmDiskFileQuery)1 VmDiskFileQueryFilter (com.vmware.vim25.VmDiskFileQueryFilter)1