diff --git a/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/MultiVODirectoryMetadata.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/MultiVODirectoryMetadata.py index e0aa1d625d7..68268200996 100644 --- a/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/MultiVODirectoryMetadata.py +++ b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/MultiVODirectoryMetadata.py @@ -158,17 +158,17 @@ def setMetaParameter(self, dPath, metaName, metaValue, credDict): def getDirectoryMetadata(self, path, credDict, inherited=True, ownData=True): """ - Get metadata for the given directory aggregating metadata for the directory itself - and for all the parent directories if inherited flag is True. Get also the non-indexed - metadata parameters. - - :param str path: directory path - :param dict credDict: client credential dictionary - :param bool inherited: include parent directories if True - :param bool ownData: - :return: standard Dirac result object + additional MetadataOwner \ - and MetadataType dict entries if the operation is successful. - """ + Get metadata for the given directory aggregating metadata for the directory itself + and for all the parent directories if inherited flag is True. Get also the non-indexed + metadata parameters. + + :param str path: directory path + :param dict credDict: client credential dictionary + :param bool inherited: include parent directories if True + :param bool ownData: + :return: standard Dirac result object + additional MetadataOwner \ + and MetadataType dict entries if the operation is successful. + """ result = super().getDirectoryMetadata(path, credDict, inherited, ownData) if not result["OK"]: @@ -181,9 +181,13 @@ def getDirectoryMetadata(self, path, credDict, inherited=True, ownData=True): return result - def findDirIDsByMetadata(self, metaDict, dPath, credDict): - """Find Directories satisfying the given metadata and being subdirectories of - the given path + def findDirectoriesByMetadata(self, queryDict, path, credDict): """ - fMetaDict = _getMetaNameDict(metaDict, credDict) - return super().findDirIDsByMetadata(fMetaDict, dPath, credDict) + + :param dict queryDict: + :param str path: + :param dict credDict: + :return: standard Dirac result object + """ + fMetaDict = _getMetaNameDict(queryDict, credDict) + return super().findDirectoriesByMetadata(fMetaDict, path, credDict) diff --git a/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/MultiVOFileMetadata.py b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/MultiVOFileMetadata.py index b39825a6fa3..ce6e31c4a57 100644 --- a/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/MultiVOFileMetadata.py +++ b/src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/FileMetadata/MultiVOFileMetadata.py @@ -116,3 +116,15 @@ def getFileUserMetadata(self, path, credDict): result["Value"] = _stripSuffix(result["Value"], credDict) return result + + def findFilesByMetadata(self, metaDict, path, credDict): + """Find Files satisfying the given metadata + :param dict metaDict: dictionary with the metaquery parameters + :param str path: Path to search into + :param dict credDict: Dictionary with the user credentials + + :return: S_OK/S_ERROR, Value ID:LFN dictionary of selected files + """ + + fMetaDict = _getMetaNameDict(metaDict, credDict) + return super().findFilesByMetadata(fMetaDict, path, credDict)