Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong specification for ‘Create a new replication rule’ #6515

Closed
dchristidis opened this issue Feb 27, 2024 · 0 comments
Closed

Wrong specification for ‘Create a new replication rule’ #6515

dchristidis opened this issue Feb 27, 2024 · 0 comments

Comments

@dchristidis
Copy link
Contributor

Description

The Client API has:

def add_replication_rule(
self,
dids: list[str],

The specification for the REST API is:

dids:
description: The list of data identifiers.
type: array
items:
type: string

Yes the Rucio CLI uses a dictionary:

rucio/bin/rucio

Lines 1171 to 1175 in 666faa5

for did in args.dids:
scope, name = get_scope(did, client)
dids.append({'scope': scope, 'name': name})
try:
rule_ids = client.add_replication_rule(dids=dids,

And the internal API and core layers expect it as such:

for d in dids:
d['scope'] = InternalScope(d['scope'], vo=vo)

for elem in dids:
# 3. Get the did
with METRICS.timer('add_rule.get_did'):
try:
did = session.query(models.DataIdentifier).filter(models.DataIdentifier.scope == elem['scope'],
models.DataIdentifier.name == elem['name']).one()

Steps to reproduce

  1. Try to use add_replication_rule from the Client API where the dids parameter is a list of strs.

Rucio Version

No response

Additional Information

No response

GooseNight added a commit to GooseNight/rucioFork that referenced this issue Apr 12, 2024
…ucio#6515

This commit replaces the wrong specification for dids for 'Create a new
replication rule', it was previously specified as a list of strings. It is now
specified as a list of dictionaries containing two properties scope and name.
GooseNight added a commit to GooseNight/rucioFork that referenced this issue Apr 16, 2024
…ucio#6515

This commit replaces the wrong specification for dids for 'Create a new
replication rule', it was previously specified as a list of strings. It is now
specified as a list of dictionaries containing two properties scope and name.
GooseNight added a commit to GooseNight/rucioFork that referenced this issue Apr 16, 2024
…ucio#6515

This commit replaces the wrong specification for dids for 'Create a new
replication rule', it was previously specified as a list of strings. It is now
specified as a list of dictionaries containing two properties scope and name.
bari12 pushed a commit that referenced this issue Apr 17, 2024
…6515

This commit replaces the wrong specification for dids for 'Create a new
replication rule', it was previously specified as a list of strings. It is now
specified as a list of dictionaries containing two properties scope and name.
@bari12 bari12 added this to the 34.2.1 / 34.3.0 milestone Apr 17, 2024
@bari12 bari12 closed this as completed Apr 17, 2024
bari12 pushed a commit that referenced this issue Apr 17, 2024
…6515

This commit replaces the wrong specification for dids for 'Create a new
replication rule', it was previously specified as a list of strings. It is now
specified as a list of dictionaries containing two properties scope and name.
@bari12 bari12 added the Rules label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants