MultiVODirectoryMetadata

DIRAC Multi VO FileCatalog plugin class to manage directory metadata for multiple VO.

class DIRAC.DataManagementSystem.DB.FileCatalogComponents.DirectoryMetadata.MultiVODirectoryMetadata.MultiVODirectoryMetadata(database=None)

Bases: DirectoryMetadata

Multi-VO FileCatalog plugin implementation.

__init__(database=None)
addMetadataField(pName, pType, credDict)

Add a new metadata parameter to the Metadata Database. Modified to use fully qualified metadata names.

Parameters:
  • pName (str) – parameter name

  • pType (str) – parameter type in the MySQL notation

  • credDict (dict) – client credential dictionary

Returns:

standard Dirac result object

addMetadataSet(metaSetName, metaSetDict, credDict)

Add a new metadata set with the contents from metaSetDict

Parameters:
  • metaSetName (str) – metaSet name

  • metaSetDict (dict) – contents of the meta set definition

  • credDict (dict) – client credential dictionary

Returns:

S_OK/S_ERROR

deleteMetadataField(pName, credDict)

Remove metadata field. Table name is now fully qualified

Parameters:
  • pName (str) – parameter name

  • credDict (dict) – client credential dictionary

Returns:

standard Dirac result object

findDirIDsByMetadata(**kwargs)
findDirectoriesByMetadata(queryDict, path, credDict)

Find Directory names satisfying the given metadata and being subdirectories of the given path.

Parameters:
  • queryDict (dict) – dictionary containing query data

  • path (str) – starting directory path

  • credDict (dict) – client credential dictionary

Returns:

S_OK/S_ERROR, Value list of selected directory paths

findFileIDsByMetadata(metaDict, path, credDict, startItem=0, maxItems=25)

Find Files satisfying the given metadata

Parameters:
  • metaDict (dict) – dictionary with the selection metadata

  • path (str) – starting directory path

  • credDict (dict) – client credential dictionary

  • startItem (int) – offset in the file list

  • maxItems (int) – max number of files to rteurn

Returns:

S_OK/S_ERROR, Value list file IDs in selected directories

findFilesByMetadata(metaDict, path, credDict)

Find Files satisfying the given metadata

Parameters:
  • metaDict (dict) – dictionary with the selection metadata

  • path (str) – starting directory path

  • credDict (dict) – client credential dictionary

Returns:

S_OK/S_ERROR, Value list files in selected directories

getCompatibleMetadata(queryDict, path, credDict)

Get distinct metadata values compatible with the given already defined metadata

Parameters:
  • queryDict (dict) – dictionary containing query data

  • path (str) – starting directory path

  • credDict (dict) – client credential dictionary

Returns:

S_OK/S_ERROR, Value dictionary of metadata

getDirectoryMetaParameters(dpath, credDict, inherited=True)

Get meta parameters for the given directory

Parameters:
  • dPath (str) – directory name

  • credDict (dict) – client credential dictionary

Returns:

S_OK/S_ERROR, Value dictionary of meta parameters

getDirectoryMetadata(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.

Parameters:
  • path (str) – directory path

  • credDict (dict) – client credential dictionary

  • inherited (bool) – include parent directories if True

  • ownData (bool)

Returns:

standard Dirac result object + additional MetadataOwner and MetadataType dict entries if the operation is successful.

getMetadataFields(credDict)

Get all the defined metadata fields

Parameters:

credDict (dict) – client credential dictionary

Returns:

standard Dirac result object

getMetadataSet(metaSetName, expandFlag, credDict)

Get fully expanded contents of the metadata set

Parameters:
  • metaSetName (str) – metaSet name

  • expandFlag (bool) – flag to whether to expand the metaset recursively

  • credDict (dict) – client credential dictionary

Returns:

S_OK/S_ERROR, Value dictionary of the meta set definition contents

removeMetadata(dPath, metaList, credDict)

Remove the specified metadata for the given directory for users own VO.

Parameters:
  • dPath (str) – directory path

  • metaList (dict) – metadata names list

  • credDict (dict) – client credential dictionary

Returns:

standard Dirac result object

removeMetadataForDirectory(dirList, credDict)

Remove all the metadata for the given directory list

Parameters:
  • dirList (list) – list of directory paths

  • credDict (dict) – client credential dictionary

Returns:

S_OK/S_ERROR, Value Successful/Failed dictionaries

setDatabase(database)
setMetaParameter(dPath, metaName, metaValue, credDict)

Set an meta parameter - metadata which is not used in the the data search operations.

Parameters:
  • dPath (str) – directory path

  • metaName (str) – metadata name

  • metaValue (str) – metadata value

  • credDict (dict) – client credential dictionary

Returns:

standard Dirac result object

setMetadata(dPath, metaDict, credDict)

Set the value of a given metadata field for the the given directory path

Parameters:
  • dPath (str) – directory path

  • metaDict (dict) – dictionary with the user metadata

  • credDict (dict) – client credential dictionary

Returns:

standard Dirac result object