本文整理汇总了Python中DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient.removeDataset方法的典型用法代码示例。如果您正苦于以下问题:Python FileCatalogClient.removeDataset方法的具体用法?Python FileCatalogClient.removeDataset怎么用?Python FileCatalogClient.removeDataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient
的用法示例。
在下文中一共展示了FileCatalogClient.removeDataset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from DIRAC.Resources.Catalog.FileCatalogClient import FileCatalogClient [as 别名]
# 或者: from DIRAC.Resources.Catalog.FileCatalogClient.FileCatalogClient import removeDataset [as 别名]
#.........这里部分代码省略.........
return S_ERROR()
else:
print "Added dataset %s with conditions %s" % (datasetName, conditions)
return S_OK()
def getDatasetDescription(self, datasetName):
"""Return a string containing a description of metadata with which
the given dataset was defined.
Example usage:
>>> result = badger.getDatasetDescription('psipp_661_data_all_exp2')
"""
result = self.client.getDatasetParameters(datasetName)
if not result["OK"]:
print "ERROR: failed to get status of dataset:", result["Message"]
else:
parDict = result["Value"]
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