当前位置: 首页>>代码示例>>Python>>正文


Python FileCatalogClient.freezeDataset方法代码示例

本文整理汇总了Python中DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient.freezeDataset方法的典型用法代码示例。如果您正苦于以下问题:Python FileCatalogClient.freezeDataset方法的具体用法?Python FileCatalogClient.freezeDataset怎么用?Python FileCatalogClient.freezeDataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient的用法示例。


在下文中一共展示了FileCatalogClient.freezeDataset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from DIRAC.Resources.Catalog.FileCatalogClient import FileCatalogClient [as 别名]
# 或者: from DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient import freezeDataset [as 别名]

#.........这里部分代码省略.........
        for par, value in parDict.items():
            print par.rjust(20), ":", value

    def getDatasetMetadata(self, datasetName):
        """Return a dict containing a description of metadata with which 
           the given dataset was defined.
           Example usage:
           >>> result = badger.getDatasetMetadata('psipp_661_data_all_exp2')
        """
        result = self.client.getDatasetParameters(datasetName)
        if not result["OK"]:
            print "ERROR: failed to get status of dataset:", result["Message"]
            return S_ERROR(result["Message"])
        else:
            parDict = result["Value"]
            return S_OK(parDict)

    def removeDataset(self, datasetName):
        """remove a dataset
        """
        result = self.client.removeDataset(datasetName)
        if not result["OK"]:
            print "ERROR: failed to remove dataset:", result["Message"]
        else:
            print "Successfully removed dataset", datasetName

    def checkDataset(self, datasetName):
        """ check if the dataset parameters are still valid
        """
        result = self.client.checkDataset(datasetName)
        if not result["OK"]:
            print "ERROR: failed to check dataset:", result["Message"]
        else:
            changeDict = result["Value"]
            if not changeDict:
                print "Dataset is not changed"
            else:
                print "Dataset changed:"
                for par in changeDict:
                    print "   ", par, ": ", changeDict[par][0], "->", changeDict[par][1]

    def updateDataset(self, datasetName):
        """ Update the given dataset parameters
          """
        result = self.client.updateDataset(datasetName)
        if not result["OK"]:
            print "ERROR: failed to update dataset:", result["Message"]
        else:
            print "Successfully updated dataset", datasetName

    def freezeDataset(self, datasetName):
        """ Freeze the given dataset
        """
        result = self.client.freezeDataset(datasetName)
        if not result["OK"]:
            print "ERROR: failed to freeze dataset:", result["Message"]
        else:
            print "Successfully frozen dataset", datasetName

    def releaseDataset(self, datasetName):
        """ Release the given dataset
        """
        result = self.client.releaseDataset(datasetName)
        if not result["OK"]:
            print "ERROR: failed to release dataset:", result["Message"]
        else:
            print "Successfully released dataset", datasetName

    def getFilesByDatasetName(self, datasetName):
        """Return a list of LFNs in the given dataset.
           
           Example usage:
           >>> badger.getFilesByDatasetName('psipp_661_data_all_exp2')
           ['/bes/File/psipp/6.6.1/data/all/exp2/file1', .....]
        """

        fc = self.client
        result = returnSingleResult(fc.getDatasetFiles(datasetName))
        if result["OK"]:
            lfns = result["Value"]
            lfns.sort()
            return S_OK(lfns)
        else:
            print "ERROR: Dataset", datasetName, " not found"
            return S_ERROR(result)

    def listDatasets(self):
        """list the exist dataset"""
        datasetName = ""
        result = self.client.getDatasets(datasetName)
        if not result["OK"]:
            print "ERROR:failed to get datasets"
            return

        datasetDict = result["Value"]
        for dName in datasetDict.keys():
            print dName

    def checkDatasetIntegrity():
        pass
开发者ID:besdiracgrid,项目名称:BESDIRAC,代码行数:104,代码来源:Badger.py


注:本文中的DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient.freezeDataset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。