Skip to content

Commit

Permalink
Add moveReplicationRule wrapper around corresponding Rucio API
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Nov 20, 2024
1 parent 8df48fd commit 0b40374
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/python/WMCore/Services/Rucio/Rucio.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,27 @@ def closeBlockContainer(self, name, scope='cms'):
self.logger.error("Exception closing container/block: %s. Error: %s", name, str(ex))
return response

def moveReplicationRule(self, ruleId, rseExpression, scope='cms', **kwargs):
"""
Perform move operation for provided rule id and rse expression
:param ruleId" rule id
:param rseExpression: rse expression
:param scope: rucio scope, default cms
:param kwargs: positional arguments for rucio API
:return: None
"""
try:
self.cli.move_replication_rule(dids, copies, rseExpression, **kwargs)
except RuleNotFound as ex:
msg = "RuleNotFound move DID replication rule. Error: %s" % str(ex)
raise WMRucioException(msg)
except RuleReplaceFailed as ex:
msg = "RuleReplaceFailed move DID replication rule. Error: %s" % str(ex)
raise WMRucioException(msg)
except Exception as ex:
msg = "Unsupported exception from Rucio API. Error: %s" % str(ex)
raise WMRucioException(msg)

def createReplicationRule(self, names, rseExpression, scope='cms', copies=1, **kwargs):
"""
_createReplicationRule_
Expand Down

0 comments on commit 0b40374

Please sign in to comment.