def search_datastore_spec(client_factory, file_name):
 search_spec = client_factory.create('ns0:HostDatastoreBrowserSearchSpec')
 search_spec.matchPattern = [file_name]
 search_spec.details = client_factory.create('ns0:FileQueryFlags')
 search_spec.details.fileOwner = False
 search_spec.details.fileSize = True
 search_spec.details.fileType = False
 search_spec.details.modification = False
 return search_spec

def search_datastore_spec ( client_factory , file_name ) : search_spec = client_factory . create ( 'ns0:HostDatastoreBrowserSearchSpec' ) search_spec . matchPattern = [ file_name ] search_spec . details = client_factory . create ( 'ns0:FileQueryFlags' ) search_spec . details . fileOwner = False search_spec . details . fileSize = True search_spec . details . fileType = False search_spec . details . modification = False return search_spec
builds the datastore search spec .