rucio 37.4.0__py3-none-any.whl → 37.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rucio might be problematic. Click here for more details.
- rucio/cli/bin_legacy/rucio.py +1 -1
- rucio/cli/bin_legacy/rucio_admin.py +1 -1
- rucio/cli/did.py +2 -2
- rucio/cli/rse.py +2 -3
- rucio/cli/subscription.py +1 -1
- rucio/client/baseclient.py +5 -1
- rucio/client/didclient.py +16 -16
- rucio/client/downloadclient.py +15 -15
- rucio/client/lockclient.py +3 -3
- rucio/client/replicaclient.py +2 -2
- rucio/client/requestclient.py +6 -5
- rucio/client/touchclient.py +1 -1
- rucio/client/uploadclient.py +725 -181
- rucio/common/config.py +1 -2
- rucio/common/constants.py +16 -17
- rucio/common/didtype.py +2 -2
- rucio/common/dumper/__init__.py +1 -1
- rucio/common/pcache.py +20 -25
- rucio/common/plugins.py +10 -17
- rucio/common/schema/__init__.py +7 -5
- rucio/common/utils.py +19 -3
- rucio/core/authentication.py +1 -1
- rucio/core/credential.py +1 -1
- rucio/core/did.py +54 -54
- rucio/core/did_meta_plugins/__init__.py +10 -10
- rucio/core/did_meta_plugins/did_column_meta.py +9 -9
- rucio/core/did_meta_plugins/did_meta_plugin_interface.py +3 -3
- rucio/core/did_meta_plugins/elasticsearch_meta.py +7 -7
- rucio/core/did_meta_plugins/json_meta.py +2 -2
- rucio/core/did_meta_plugins/mongo_meta.py +9 -9
- rucio/core/did_meta_plugins/postgres_meta.py +7 -7
- rucio/core/dirac.py +1 -1
- rucio/core/lifetime_exception.py +2 -2
- rucio/core/lock.py +7 -7
- rucio/core/meta_conventions.py +2 -2
- rucio/core/monitor.py +1 -1
- rucio/core/naming_convention.py +1 -1
- rucio/core/nongrid_trace.py +2 -2
- rucio/core/oidc.py +2 -2
- rucio/core/permission/__init__.py +7 -5
- rucio/core/permission/generic.py +5 -2
- rucio/core/permission/generic_multi_vo.py +2 -2
- rucio/core/replica.py +18 -18
- rucio/core/request.py +2 -2
- rucio/core/rule.py +30 -30
- rucio/core/rule_grouping.py +2 -3
- rucio/core/scope.py +1 -1
- rucio/core/trace.py +2 -2
- rucio/core/transfer.py +4 -5
- rucio/daemons/auditor/__init__.py +1 -1
- rucio/daemons/badreplicas/minos.py +9 -3
- rucio/daemons/badreplicas/minos_temporary_expiration.py +5 -2
- rucio/daemons/badreplicas/necromancer.py +9 -3
- rucio/daemons/bb8/common.py +1 -1
- rucio/daemons/bb8/nuclei_background_rebalance.py +1 -1
- rucio/daemons/bb8/t2_background_rebalance.py +1 -1
- rucio/daemons/cache/consumer.py +1 -1
- rucio/daemons/conveyor/finisher.py +13 -4
- rucio/daemons/conveyor/poller.py +5 -2
- rucio/daemons/conveyor/receiver.py +1 -1
- rucio/daemons/conveyor/throttler.py +2 -1
- rucio/daemons/follower/follower.py +1 -1
- rucio/daemons/hermes/hermes.py +2 -2
- rucio/daemons/judge/cleaner.py +2 -2
- rucio/daemons/judge/evaluator.py +7 -7
- rucio/daemons/judge/injector.py +2 -2
- rucio/daemons/judge/repairer.py +2 -2
- rucio/daemons/replicarecoverer/suspicious_replica_recoverer.py +1 -1
- rucio/daemons/storage/consistency/actions.py +3 -3
- rucio/daemons/transmogrifier/transmogrifier.py +1 -1
- rucio/daemons/undertaker/undertaker.py +6 -6
- rucio/db/sqla/constants.py +4 -3
- rucio/db/sqla/migrate_repo/versions/13d4f70c66a9_introduce_transfer_limits.py +1 -1
- rucio/db/sqla/migrate_repo/versions/3082b8cef557_add_naming_convention_table_and_closed_.py +1 -1
- rucio/db/sqla/migrate_repo/versions/4df2c5ddabc0_remove_temporary_dids.py +1 -1
- rucio/db/sqla/migrate_repo/versions/c129ccdb2d5_add_lumiblocknr_to_dids.py +1 -1
- rucio/db/sqla/models.py +2 -2
- rucio/db/sqla/session.py +7 -7
- rucio/gateway/account.py +65 -90
- rucio/gateway/did.py +26 -26
- rucio/gateway/dirac.py +1 -1
- rucio/gateway/lifetime_exception.py +1 -1
- rucio/gateway/replica.py +2 -2
- rucio/gateway/request.py +13 -12
- rucio/rse/protocols/ngarc.py +2 -2
- rucio/rse/protocols/srm.py +1 -1
- rucio/rse/protocols/webdav.py +8 -1
- rucio/rse/rsemanager.py +2 -2
- rucio/tests/common.py +4 -4
- rucio/vcsversion.py +3 -3
- rucio/web/rest/flaskapi/v1/accountlimits.py +22 -22
- rucio/web/rest/flaskapi/v1/accounts.py +177 -177
- rucio/web/rest/flaskapi/v1/archives.py +10 -10
- rucio/web/rest/flaskapi/v1/auth.py +106 -106
- rucio/web/rest/flaskapi/v1/common.py +1 -1
- rucio/web/rest/flaskapi/v1/config.py +37 -37
- rucio/web/rest/flaskapi/v1/credentials.py +25 -25
- rucio/web/rest/flaskapi/v1/dids.py +391 -391
- rucio/web/rest/flaskapi/v1/dirac.py +8 -8
- rucio/web/rest/flaskapi/v1/export.py +6 -6
- rucio/web/rest/flaskapi/v1/heartbeats.py +14 -14
- rucio/web/rest/flaskapi/v1/identities.py +25 -25
- rucio/web/rest/flaskapi/v1/import.py +19 -19
- rucio/web/rest/flaskapi/v1/lifetime_exceptions.py +54 -54
- rucio/web/rest/flaskapi/v1/locks.py +62 -62
- rucio/web/rest/flaskapi/v1/main.py +1 -0
- rucio/web/rest/flaskapi/v1/meta_conventions.py +29 -29
- rucio/web/rest/flaskapi/v1/nongrid_traces.py +4 -4
- rucio/web/rest/flaskapi/v1/ping.py +4 -4
- rucio/web/rest/flaskapi/v1/redirect.py +16 -16
- rucio/web/rest/flaskapi/v1/replicas.py +282 -282
- rucio/web/rest/flaskapi/v1/requests.py +274 -270
- rucio/web/rest/flaskapi/v1/rses.py +427 -427
- rucio/web/rest/flaskapi/v1/rules.py +129 -129
- rucio/web/rest/flaskapi/v1/scopes.py +21 -21
- rucio/web/rest/flaskapi/v1/subscriptions.py +120 -120
- rucio/web/rest/flaskapi/v1/traces.py +18 -18
- rucio/web/rest/flaskapi/v1/vos.py +32 -32
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/requirements.server.txt +1 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-account +8 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-rse +8 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-auditor +1 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-throttler +7 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-follower +1 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-judge-cleaner +9 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-necromancer +7 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-replica-recoverer +31 -9
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-undertaker +8 -2
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/METADATA +1 -1
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/RECORD +179 -179
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/WHEEL +1 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/alembic.ini.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio.cfg.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/tools/bootstrap.py +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/tools/reset_database.py +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-collection-replica +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-admin +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-atropos +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-automatix +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-bb8 +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-cache-client +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-cache-consumer +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-finisher +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-poller +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-preparer +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-receiver +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-stager +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-submitter +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-dark-reaper +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-dumper +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-hermes +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-judge-evaluator +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-judge-injector +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-judge-repairer +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-kronos +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-minos +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-oauth-manager +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-reaper +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-rse-decommissioner +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-storage-consistency-actions +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-transmogrifier +0 -0
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/licenses/AUTHORS.rst +0 -0
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/licenses/LICENSE +0 -0
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/top_level.txt +0 -0
rucio/core/did.py
CHANGED
|
@@ -163,7 +163,7 @@ def add_dids(
|
|
|
163
163
|
"""
|
|
164
164
|
Bulk add data identifiers.
|
|
165
165
|
|
|
166
|
-
:param dids: A list of
|
|
166
|
+
:param dids: A list of DIDs.
|
|
167
167
|
:param account: The account owner.
|
|
168
168
|
:param session: The database session in use.
|
|
169
169
|
"""
|
|
@@ -375,7 +375,7 @@ def __add_files_to_archive(
|
|
|
375
375
|
session: "Session"
|
|
376
376
|
) -> None:
|
|
377
377
|
"""
|
|
378
|
-
Add files to archive.
|
|
378
|
+
Add files to the archive.
|
|
379
379
|
|
|
380
380
|
:param parent_did: the DataIdentifier object of the parent did
|
|
381
381
|
:param files: archive content.
|
|
@@ -809,11 +809,11 @@ def delete_dids(
|
|
|
809
809
|
"""
|
|
810
810
|
Delete data identifiers
|
|
811
811
|
|
|
812
|
-
:param dids: The list of
|
|
812
|
+
:param dids: The list of DIDs to delete.
|
|
813
813
|
:param account: The account.
|
|
814
814
|
:param expire_rules: Expire large rules instead of deleting them right away. This should only be used in Undertaker mode, as it can be that
|
|
815
|
-
the method returns normally, but a
|
|
816
|
-
expired
|
|
815
|
+
the method returns normally, but a DID was not deleted; This trusts in the fact that the undertaker will retry an
|
|
816
|
+
expired DID.
|
|
817
817
|
:param session: The database session in use.
|
|
818
818
|
:param logger: Optional decorated logger that can be passed from the calling daemons or servers.
|
|
819
819
|
"""
|
|
@@ -879,7 +879,7 @@ def delete_dids(
|
|
|
879
879
|
)
|
|
880
880
|
session.execute(stmt, values)
|
|
881
881
|
|
|
882
|
-
# Delete rules on
|
|
882
|
+
# Delete rules on DID
|
|
883
883
|
skip_deletion = False # Skip deletion in case of expiration of a rule
|
|
884
884
|
with METRICS.timer('delete_dids.rules'):
|
|
885
885
|
stmt = select(
|
|
@@ -899,7 +899,7 @@ def delete_dids(
|
|
|
899
899
|
for (rule_id, scope, name, rse_expression, locks_ok_cnt, locks_replicating_cnt, locks_stuck_cnt) in session.execute(stmt):
|
|
900
900
|
logger(logging.DEBUG, 'Removing rule %s for did %s:%s on RSE-Expression %s' % (str(rule_id), scope, name, rse_expression))
|
|
901
901
|
|
|
902
|
-
# Propagate purge_replicas from
|
|
902
|
+
# Propagate purge_replicas from DID to rules
|
|
903
903
|
if (scope, name) in not_purge_replicas:
|
|
904
904
|
purge_replicas = False
|
|
905
905
|
else:
|
|
@@ -907,7 +907,7 @@ def delete_dids(
|
|
|
907
907
|
if expire_rules and locks_ok_cnt + locks_replicating_cnt + locks_stuck_cnt > int(config_get_int('undertaker', 'expire_rules_locks_size', default=10000, session=session)):
|
|
908
908
|
# Expire the rule (soft=True)
|
|
909
909
|
rucio.core.rule.delete_rule(rule_id=rule_id, purge_replicas=purge_replicas, soft=True, delete_parent=True, nowait=True, session=session)
|
|
910
|
-
# Update expiration of
|
|
910
|
+
# Update expiration of DID
|
|
911
911
|
set_metadata(scope=scope, name=name, key='lifetime', value=3600 * 24, session=session)
|
|
912
912
|
skip_deletion = True
|
|
913
913
|
else:
|
|
@@ -916,7 +916,7 @@ def delete_dids(
|
|
|
916
916
|
if skip_deletion:
|
|
917
917
|
return
|
|
918
918
|
|
|
919
|
-
# Detach from parent
|
|
919
|
+
# Detach from parent DIDs:
|
|
920
920
|
existing_parent_dids = False
|
|
921
921
|
with METRICS.timer('delete_dids.parent_content'):
|
|
922
922
|
stmt = select(
|
|
@@ -931,7 +931,7 @@ def delete_dids(
|
|
|
931
931
|
existing_parent_dids = True
|
|
932
932
|
detach_dids(scope=parent_did.scope, name=parent_did.name, dids=[{'scope': parent_did.child_scope, 'name': parent_did.child_name}], session=session)
|
|
933
933
|
|
|
934
|
-
# Remove generic
|
|
934
|
+
# Remove generic DID metadata
|
|
935
935
|
must_delete_did_meta = True
|
|
936
936
|
if session.bind.dialect.name == 'oracle':
|
|
937
937
|
oracle_version = int(session.connection().connection.version.split('.')[0])
|
|
@@ -1036,7 +1036,7 @@ def delete_dids(
|
|
|
1036
1036
|
)
|
|
1037
1037
|
session.execute(stmt)
|
|
1038
1038
|
|
|
1039
|
-
# Set Epoch tombstone for the files replicas inside the
|
|
1039
|
+
# Set Epoch tombstone for the files replicas inside the DID
|
|
1040
1040
|
if config_get_bool('undertaker', 'purge_all_replicas', default=False, session=session):
|
|
1041
1041
|
with METRICS.timer('delete_dids.file_content'):
|
|
1042
1042
|
stmt = update(
|
|
@@ -1093,7 +1093,7 @@ def delete_dids(
|
|
|
1093
1093
|
|
|
1094
1094
|
# remove data identifier
|
|
1095
1095
|
if existing_parent_dids:
|
|
1096
|
-
# Exit method early to give Judge time to remove locks (Otherwise, due to foreign keys,
|
|
1096
|
+
# Exit method early to give Judge time to remove locks (Otherwise, due to foreign keys, DID removal does not work
|
|
1097
1097
|
logger(logging.DEBUG, 'Leaving delete_dids early for Judge-Evaluator checks')
|
|
1098
1098
|
return
|
|
1099
1099
|
|
|
@@ -1195,7 +1195,7 @@ def detach_dids(
|
|
|
1195
1195
|
:param dids: The content.
|
|
1196
1196
|
:param session: The database session in use.
|
|
1197
1197
|
"""
|
|
1198
|
-
# Row Lock the parent
|
|
1198
|
+
# Row Lock the parent DID
|
|
1199
1199
|
stmt = select(
|
|
1200
1200
|
models.DataIdentifier
|
|
1201
1201
|
).where(
|
|
@@ -1215,7 +1215,7 @@ def detach_dids(
|
|
|
1215
1215
|
except NoResultFound:
|
|
1216
1216
|
raise exception.DataIdentifierNotFound(f"Data identifier '{scope}:{name}' not found")
|
|
1217
1217
|
|
|
1218
|
-
# TODO: should judge target
|
|
1218
|
+
# TODO: should judge target DID's status: open, monotonic, close.
|
|
1219
1219
|
stmt = select(
|
|
1220
1220
|
models.DataIdentifierAssociation
|
|
1221
1221
|
).where(
|
|
@@ -1374,7 +1374,7 @@ def set_new_dids(
|
|
|
1374
1374
|
"""
|
|
1375
1375
|
Set/reset the flag new
|
|
1376
1376
|
|
|
1377
|
-
:param dids: A list of
|
|
1377
|
+
:param dids: A list of DIDs
|
|
1378
1378
|
:param new_flag: A boolean to flag new DIDs.
|
|
1379
1379
|
:param session: The database session in use.
|
|
1380
1380
|
"""
|
|
@@ -1436,7 +1436,7 @@ def list_content(
|
|
|
1436
1436
|
yield {'scope': tmp_did.child_scope, 'name': tmp_did.child_name, 'type': tmp_did.child_type,
|
|
1437
1437
|
'bytes': tmp_did.bytes, 'adler32': tmp_did.adler32, 'md5': tmp_did.md5}
|
|
1438
1438
|
if not children_found:
|
|
1439
|
-
# Raise exception if the
|
|
1439
|
+
# Raise exception if the DID doesn't exist
|
|
1440
1440
|
__get_did(scope=scope, name=name, session=session)
|
|
1441
1441
|
|
|
1442
1442
|
|
|
@@ -1480,13 +1480,13 @@ def list_parent_dids(
|
|
|
1480
1480
|
session: "Session"
|
|
1481
1481
|
) -> "Iterator[dict[str, Any]]":
|
|
1482
1482
|
"""
|
|
1483
|
-
List parent datasets and containers of a
|
|
1483
|
+
List parent datasets and containers of a DID.
|
|
1484
1484
|
|
|
1485
1485
|
:param scope: The scope.
|
|
1486
1486
|
:param name: The name.
|
|
1487
1487
|
:param order_by: List of parameters to order the query by. Possible values: ['scope', 'name', 'did_type', 'created_at'].
|
|
1488
1488
|
:param session: The database session.
|
|
1489
|
-
:returns: List of
|
|
1489
|
+
:returns: List of DIDs.
|
|
1490
1490
|
:rtype: Generator.
|
|
1491
1491
|
"""
|
|
1492
1492
|
|
|
@@ -1519,12 +1519,12 @@ def list_all_parent_dids(
|
|
|
1519
1519
|
session: "Session"
|
|
1520
1520
|
) -> "Iterator[dict[str, Any]]":
|
|
1521
1521
|
"""
|
|
1522
|
-
List all parent datasets and containers of a
|
|
1522
|
+
List all parent datasets and containers of a DID, no matter on what level.
|
|
1523
1523
|
|
|
1524
1524
|
:param scope: The scope.
|
|
1525
1525
|
:param name: The name.
|
|
1526
1526
|
:param session: The database session.
|
|
1527
|
-
:returns: List of
|
|
1527
|
+
:returns: List of DIDs.
|
|
1528
1528
|
:rtype: Generator.
|
|
1529
1529
|
"""
|
|
1530
1530
|
|
|
@@ -1548,8 +1548,8 @@ def list_child_dids_stmt(
|
|
|
1548
1548
|
did_type: DIDType,
|
|
1549
1549
|
) -> "Select[tuple[InternalScope, str]]":
|
|
1550
1550
|
"""
|
|
1551
|
-
Build and returns a query which recursively lists children
|
|
1552
|
-
for the
|
|
1551
|
+
Build and returns a query which recursively lists children DIDs of type `did_type`
|
|
1552
|
+
for the DIDs given as input in a scope/name (temporary) table.
|
|
1553
1553
|
|
|
1554
1554
|
did_type defines the desired type of DIDs in the result. If set to DIDType.Dataset,
|
|
1555
1555
|
will only resolve containers and return datasets. If set to DIDType.File, will
|
|
@@ -1605,7 +1605,7 @@ def list_one_did_childs_stmt(
|
|
|
1605
1605
|
did_type: DIDType,
|
|
1606
1606
|
) -> "Select[tuple[InternalScope, str]]":
|
|
1607
1607
|
"""
|
|
1608
|
-
Returns the sqlalchemy query for recursively fetching the child
|
|
1608
|
+
Returns the sqlalchemy query for recursively fetching the child DIDs of type
|
|
1609
1609
|
'did_type' for the input did.
|
|
1610
1610
|
|
|
1611
1611
|
did_type defines the desired type of DIDs in the result. If set to DIDType.Dataset,
|
|
@@ -1667,7 +1667,7 @@ def list_child_datasets(
|
|
|
1667
1667
|
:param scope: The scope.
|
|
1668
1668
|
:param name: The name.
|
|
1669
1669
|
:param session: The database session
|
|
1670
|
-
:returns: List of
|
|
1670
|
+
:returns: List of DIDs
|
|
1671
1671
|
:rtype: Generator
|
|
1672
1672
|
"""
|
|
1673
1673
|
stmt = list_one_did_childs_stmt(scope, name, did_type=DIDType.DATASET)
|
|
@@ -1939,7 +1939,7 @@ def get_did(scope: "InternalScope", name: str, dynamic_depth: "Optional[DIDType]
|
|
|
1939
1939
|
:param scope: The scope name.
|
|
1940
1940
|
:param name: The data identifier name.
|
|
1941
1941
|
:param dynamic_depth: the DID type to use as source for estimation of this DIDs length/bytes.
|
|
1942
|
-
If set to None, or to a value which doesn't make sense (ex: requesting depth = CONTAINER for a
|
|
1942
|
+
If set to None, or to a value which doesn't make sense (ex: requesting depth = CONTAINER for a DID of type DATASET)
|
|
1943
1943
|
will not compute the size dynamically.
|
|
1944
1944
|
:param session: The database session in use.
|
|
1945
1945
|
"""
|
|
@@ -2017,7 +2017,7 @@ def set_dids_metadata_bulk(
|
|
|
2017
2017
|
"""
|
|
2018
2018
|
Add metadata to a list of data identifiers.
|
|
2019
2019
|
|
|
2020
|
-
:param dids: A list of
|
|
2020
|
+
:param dids: A list of DIDs including metadata.
|
|
2021
2021
|
:param recursive: Option to propagate the metadata change to content.
|
|
2022
2022
|
:param session: The database session in use.
|
|
2023
2023
|
"""
|
|
@@ -2043,7 +2043,7 @@ def get_metadata(
|
|
|
2043
2043
|
:param session: The database session in use.
|
|
2044
2044
|
|
|
2045
2045
|
|
|
2046
|
-
:returns: List of HARDCODED metadata for
|
|
2046
|
+
:returns: List of HARDCODED metadata for DID.
|
|
2047
2047
|
"""
|
|
2048
2048
|
return did_meta_plugins.get_metadata(scope, name, plugin=plugin, session=session)
|
|
2049
2049
|
|
|
@@ -2055,11 +2055,11 @@ def list_parent_dids_bulk(
|
|
|
2055
2055
|
session: "Session"
|
|
2056
2056
|
) -> "Iterator[dict[str, Any]]":
|
|
2057
2057
|
"""
|
|
2058
|
-
List parent datasets and containers of a
|
|
2058
|
+
List parent datasets and containers of a DID.
|
|
2059
2059
|
|
|
2060
|
-
:param dids: A list of
|
|
2060
|
+
:param dids: A list of DIDs.
|
|
2061
2061
|
:param session: The database session in use.
|
|
2062
|
-
:returns: List of
|
|
2062
|
+
:returns: List of DIDs.
|
|
2063
2063
|
:rtype: Generator.
|
|
2064
2064
|
"""
|
|
2065
2065
|
condition = []
|
|
@@ -2093,8 +2093,8 @@ def get_metadata_bulk(
|
|
|
2093
2093
|
session: "Session"
|
|
2094
2094
|
) -> "Iterator[dict[str, Any]]":
|
|
2095
2095
|
"""
|
|
2096
|
-
Get metadata for a list of
|
|
2097
|
-
:param dids: A list of
|
|
2096
|
+
Get metadata for a list of DIDs
|
|
2097
|
+
:param dids: A list of DIDs.
|
|
2098
2098
|
:param inherit: A boolean. If set to true, the metadata of the parent are concatenated.
|
|
2099
2099
|
:param plugin: A string. The metadata plugin to use or 'ALL' for all.
|
|
2100
2100
|
:param session: The database session in use.
|
|
@@ -2172,8 +2172,8 @@ def delete_metadata(
|
|
|
2172
2172
|
"""
|
|
2173
2173
|
Delete a key from the metadata column
|
|
2174
2174
|
|
|
2175
|
-
:param scope: the scope of
|
|
2176
|
-
:param name: the name of the
|
|
2175
|
+
:param scope: the scope of DID
|
|
2176
|
+
:param name: the name of the DID
|
|
2177
2177
|
:param key: the key to be deleted
|
|
2178
2178
|
"""
|
|
2179
2179
|
did_meta_plugins.delete_metadata(scope, name, key, session=session)
|
|
@@ -2312,7 +2312,7 @@ def list_dids(
|
|
|
2312
2312
|
|
|
2313
2313
|
:param scope: the scope name.
|
|
2314
2314
|
:param filters: dictionary of attributes by which the results should be filtered.
|
|
2315
|
-
:param did_type: the type of the
|
|
2315
|
+
:param did_type: the type of the DID: all(container, dataset, file), collection(dataset or container), dataset, container, file.
|
|
2316
2316
|
:param ignore_case: ignore case distinctions.
|
|
2317
2317
|
:param limit: limit number.
|
|
2318
2318
|
:param offset: offset number.
|
|
@@ -2332,7 +2332,7 @@ def get_did_atime(
|
|
|
2332
2332
|
session: "Session"
|
|
2333
2333
|
) -> datetime:
|
|
2334
2334
|
"""
|
|
2335
|
-
Get the accessed_at timestamp for a
|
|
2335
|
+
Get the accessed_at timestamp for a DID. Just for testing.
|
|
2336
2336
|
:param scope: the scope name.
|
|
2337
2337
|
:param name: The data identifier name.
|
|
2338
2338
|
:param session: Database session to use.
|
|
@@ -2356,7 +2356,7 @@ def get_did_access_cnt(
|
|
|
2356
2356
|
session: "Session"
|
|
2357
2357
|
) -> int:
|
|
2358
2358
|
"""
|
|
2359
|
-
Get the access_cnt for a
|
|
2359
|
+
Get the access_cnt for a DID. Just for testing.
|
|
2360
2360
|
:param scope: the scope name.
|
|
2361
2361
|
:param name: The data identifier name.
|
|
2362
2362
|
:param session: Database session to use.
|
|
@@ -2383,7 +2383,7 @@ def get_dataset_by_guid(
|
|
|
2383
2383
|
:param guid: The GUID.
|
|
2384
2384
|
:param session: Database session to use.
|
|
2385
2385
|
|
|
2386
|
-
:returns: A
|
|
2386
|
+
:returns: A DID.
|
|
2387
2387
|
"""
|
|
2388
2388
|
stmt = select(
|
|
2389
2389
|
models.DataIdentifier
|
|
@@ -2422,9 +2422,9 @@ def touch_dids(
|
|
|
2422
2422
|
session: "Session"
|
|
2423
2423
|
) -> bool:
|
|
2424
2424
|
"""
|
|
2425
|
-
Update the accessed_at timestamp and the access_cnt of the given
|
|
2425
|
+
Update the accessed_at timestamp and the access_cnt of the given DIDs.
|
|
2426
2426
|
|
|
2427
|
-
:param replicas: the list of
|
|
2427
|
+
:param replicas: the list of DIDs.
|
|
2428
2428
|
:param session: The database session in use.
|
|
2429
2429
|
|
|
2430
2430
|
:returns: True, if successful, False otherwise.
|
|
@@ -2489,11 +2489,11 @@ def __resolve_bytes_length_events_did(
|
|
|
2489
2489
|
*, session: "Session",
|
|
2490
2490
|
) -> tuple[int, int, int]:
|
|
2491
2491
|
"""
|
|
2492
|
-
Resolve bytes, length and events of a
|
|
2492
|
+
Resolve bytes, length and events of a DID
|
|
2493
2493
|
|
|
2494
2494
|
:did: the DID ORM object for which we perform the resolution
|
|
2495
2495
|
:param dynamic_depth: the DID type to use as source for estimation of this DIDs length/bytes.
|
|
2496
|
-
If set to None, or to a value which doesn't make sense (ex: requesting depth = DATASET for a
|
|
2496
|
+
If set to None, or to a value which doesn't make sense (ex: requesting depth = DATASET for a DID of type FILE)
|
|
2497
2497
|
will not compute the size dynamically.
|
|
2498
2498
|
:param session: The database session in use.
|
|
2499
2499
|
"""
|
|
@@ -2554,7 +2554,7 @@ def resurrect(dids: "Iterable[Mapping[str, Any]]", *, session: "Session") -> Non
|
|
|
2554
2554
|
"""
|
|
2555
2555
|
Resurrect data identifiers.
|
|
2556
2556
|
|
|
2557
|
-
:param dids: The list of
|
|
2557
|
+
:param dids: The list of DIDs to resurrect.
|
|
2558
2558
|
:param session: The database session in use.
|
|
2559
2559
|
"""
|
|
2560
2560
|
for did in dids:
|
|
@@ -2651,7 +2651,7 @@ def add_did_to_followed(
|
|
|
2651
2651
|
session: "Session"
|
|
2652
2652
|
) -> None:
|
|
2653
2653
|
"""
|
|
2654
|
-
Mark a
|
|
2654
|
+
Mark a DID as followed by the given account
|
|
2655
2655
|
|
|
2656
2656
|
:param scope: The scope name.
|
|
2657
2657
|
:param name: The data identifier name.
|
|
@@ -2672,13 +2672,13 @@ def add_dids_to_followed(
|
|
|
2672
2672
|
"""
|
|
2673
2673
|
Bulk mark datasets as followed
|
|
2674
2674
|
|
|
2675
|
-
:param dids: A list of
|
|
2675
|
+
:param dids: A list of DIDs.
|
|
2676
2676
|
:param account: The account owner.
|
|
2677
2677
|
:param session: The database session in use.
|
|
2678
2678
|
"""
|
|
2679
2679
|
try:
|
|
2680
2680
|
for did in dids:
|
|
2681
|
-
# Get the
|
|
2681
|
+
# Get the DID details corresponding to the scope and name passed.
|
|
2682
2682
|
stmt = select(
|
|
2683
2683
|
models.DataIdentifier
|
|
2684
2684
|
).where(
|
|
@@ -2705,7 +2705,7 @@ def get_users_following_did(
|
|
|
2705
2705
|
session: "Session"
|
|
2706
2706
|
) -> "Iterator[dict[str, InternalAccount]]":
|
|
2707
2707
|
"""
|
|
2708
|
-
Return list of users following a
|
|
2708
|
+
Return list of users following a DID
|
|
2709
2709
|
|
|
2710
2710
|
:param scope: The scope name.
|
|
2711
2711
|
:param name: The data identifier name.
|
|
@@ -2735,7 +2735,7 @@ def remove_did_from_followed(
|
|
|
2735
2735
|
session: "Session"
|
|
2736
2736
|
) -> None:
|
|
2737
2737
|
"""
|
|
2738
|
-
Mark a
|
|
2738
|
+
Mark a DID as not followed
|
|
2739
2739
|
|
|
2740
2740
|
:param scope: The scope name.
|
|
2741
2741
|
:param name: The data identifier name.
|
|
@@ -2756,7 +2756,7 @@ def remove_dids_from_followed(
|
|
|
2756
2756
|
"""
|
|
2757
2757
|
Bulk mark datasets as not followed
|
|
2758
2758
|
|
|
2759
|
-
:param dids: A list of
|
|
2759
|
+
:param dids: A list of DIDs.
|
|
2760
2760
|
:param account: The account owner.
|
|
2761
2761
|
:param session: The database session in use.
|
|
2762
2762
|
"""
|
|
@@ -2786,11 +2786,11 @@ def trigger_event(
|
|
|
2786
2786
|
session: "Session"
|
|
2787
2787
|
) -> None:
|
|
2788
2788
|
"""
|
|
2789
|
-
Records changes occurring in the
|
|
2789
|
+
Records changes occurring in the DID to the FollowEvent table
|
|
2790
2790
|
|
|
2791
2791
|
:param scope: The scope name.
|
|
2792
2792
|
:param name: The data identifier name.
|
|
2793
|
-
:param event_type: The type of event affecting the
|
|
2793
|
+
:param event_type: The type of event affecting the DID.
|
|
2794
2794
|
:param payload: Any message to be stored along with the event.
|
|
2795
2795
|
:param session: The database session in use.
|
|
2796
2796
|
"""
|
|
@@ -2887,10 +2887,10 @@ def insert_content_history(
|
|
|
2887
2887
|
session: "Session"
|
|
2888
2888
|
) -> None:
|
|
2889
2889
|
"""
|
|
2890
|
-
Insert into content history a list of
|
|
2890
|
+
Insert into content history a list of DID
|
|
2891
2891
|
|
|
2892
2892
|
:param filter_: Content clause of the files to archive
|
|
2893
|
-
:param did_created_at: Creation date of the
|
|
2893
|
+
:param did_created_at: Creation date of the DID
|
|
2894
2894
|
:param session: The database session in use.
|
|
2895
2895
|
"""
|
|
2896
2896
|
new_did_created_at = did_created_at
|
|
@@ -2940,7 +2940,7 @@ def insert_deleted_dids(filter_: "ColumnExpressionArgument[bool]", *, session: "
|
|
|
2940
2940
|
"""
|
|
2941
2941
|
Insert into deleted_dids a list of did
|
|
2942
2942
|
|
|
2943
|
-
:param filter_: The database filter to retrieve
|
|
2943
|
+
:param filter_: The database filter to retrieve DIDs for archival
|
|
2944
2944
|
:param session: The database session in use.
|
|
2945
2945
|
"""
|
|
2946
2946
|
stmt = select(
|
|
@@ -76,16 +76,16 @@ RESTRICTED_CHARACTERS = {
|
|
|
76
76
|
@read_session
|
|
77
77
|
def get_metadata(scope, name, plugin="DID_COLUMN", *, session: "Session"):
|
|
78
78
|
"""
|
|
79
|
-
Gets the metadata for a given
|
|
79
|
+
Gets the metadata for a given DID from a specified plugin.
|
|
80
80
|
|
|
81
81
|
If [plugin] is set to "all", metadata from all available metadata plugins will be returned,
|
|
82
82
|
else [plugin] can be used to only return the metadata using a specific plugin.
|
|
83
83
|
|
|
84
|
-
:param scope: The scope of the
|
|
84
|
+
:param scope: The scope of the DID.
|
|
85
85
|
:param name: The data identifier name.
|
|
86
86
|
:param plugin: (optional) Filter specific metadata plugins.
|
|
87
87
|
:param session: (optional) The database session in use.
|
|
88
|
-
:returns: Dictionary containing metadata for
|
|
88
|
+
:returns: Dictionary containing metadata for DID.
|
|
89
89
|
:raises: UnsupportedMetadataPlugin: If the specified plugin is not enabled/available
|
|
90
90
|
"""
|
|
91
91
|
if plugin.lower() == "all":
|
|
@@ -104,9 +104,9 @@ def get_metadata(scope, name, plugin="DID_COLUMN", *, session: "Session"):
|
|
|
104
104
|
@transactional_session
|
|
105
105
|
def set_metadata(scope, name, key, value, recursive=False, *, session: "Session"):
|
|
106
106
|
"""
|
|
107
|
-
Sets metadata for a given
|
|
107
|
+
Sets metadata for a given DID.
|
|
108
108
|
|
|
109
|
-
:param scope: The scope of the
|
|
109
|
+
:param scope: The scope of the DID.
|
|
110
110
|
:param name: The data identifier name.
|
|
111
111
|
:param key: Metadata key.
|
|
112
112
|
:param value: Metadata value.
|
|
@@ -138,7 +138,7 @@ def set_metadata(scope, name, key, value, recursive=False, *, session: "Session"
|
|
|
138
138
|
@transactional_session
|
|
139
139
|
def set_metadata_bulk(scope, name, meta, recursive=False, *, session: "Session"):
|
|
140
140
|
"""
|
|
141
|
-
Bulk sets metadata for a given
|
|
141
|
+
Bulk sets metadata for a given DID.
|
|
142
142
|
|
|
143
143
|
:param scope: The scope name.
|
|
144
144
|
:param name: The data identifier name.
|
|
@@ -188,8 +188,8 @@ def delete_metadata(scope, name, key, *, session: "Session"):
|
|
|
188
188
|
"""
|
|
189
189
|
Deletes metadata stored for a given key.
|
|
190
190
|
|
|
191
|
-
:param scope: The scope of the
|
|
192
|
-
:param name: The name of the
|
|
191
|
+
:param scope: The scope of the DID.
|
|
192
|
+
:param name: The name of the DID.
|
|
193
193
|
:param key: Key of the metadata.
|
|
194
194
|
"""
|
|
195
195
|
for metadata_plugin in METADATA_PLUGIN_MODULES:
|
|
@@ -207,7 +207,7 @@ def list_dids(scope=None, filters=None, did_type='collection', ignore_case=False
|
|
|
207
207
|
|
|
208
208
|
:param scope: the scope name.
|
|
209
209
|
:param filters: dictionary of attributes by which the results should be filtered.
|
|
210
|
-
:param did_type: the type of the
|
|
210
|
+
:param did_type: the type of the DID: all(container, dataset, file), collection(dataset or container), dataset, container, file.
|
|
211
211
|
:param ignore_case: ignore case distinctions.
|
|
212
212
|
:param limit: limit number.
|
|
213
213
|
:param offset: offset number.
|
|
@@ -215,7 +215,7 @@ def list_dids(scope=None, filters=None, did_type='collection', ignore_case=False
|
|
|
215
215
|
:param recursive: Recursively list DIDs content.
|
|
216
216
|
:param ignore_dids: List of DIDs to refrain from yielding.
|
|
217
217
|
:param session: The database session in use.
|
|
218
|
-
:returns: List of
|
|
218
|
+
:returns: List of DIDs satisfying metadata criteria.
|
|
219
219
|
:raises: InvalidMetadata
|
|
220
220
|
"""
|
|
221
221
|
# backwards compatibility for filters as single {}.
|
|
@@ -37,7 +37,7 @@ if TYPE_CHECKING:
|
|
|
37
37
|
|
|
38
38
|
class DidColumnMeta(DidMetaPlugin):
|
|
39
39
|
"""
|
|
40
|
-
A metadata plugin to interact with the base
|
|
40
|
+
A metadata plugin to interact with the base DID table metadata.
|
|
41
41
|
"""
|
|
42
42
|
def __init__(self):
|
|
43
43
|
super(DidColumnMeta, self).__init__()
|
|
@@ -78,7 +78,7 @@ class DidColumnMeta(DidMetaPlugin):
|
|
|
78
78
|
except TypeError as error:
|
|
79
79
|
raise exception.InvalidValueForKey(error)
|
|
80
80
|
if not rowcount:
|
|
81
|
-
# check for
|
|
81
|
+
# check for DID presence
|
|
82
82
|
raise exception.UnsupportedOperation('%s for %s:%s cannot be updated' % (key, scope, name))
|
|
83
83
|
elif key == 'lifetime':
|
|
84
84
|
try:
|
|
@@ -89,12 +89,12 @@ class DidColumnMeta(DidMetaPlugin):
|
|
|
89
89
|
except TypeError as error:
|
|
90
90
|
raise exception.InvalidValueForKey(error)
|
|
91
91
|
if not rowcount:
|
|
92
|
-
# check for
|
|
92
|
+
# check for DID presence
|
|
93
93
|
raise exception.UnsupportedOperation('%s for %s:%s cannot be updated' % (key, scope, name))
|
|
94
94
|
elif key in ['guid', 'events']:
|
|
95
95
|
rowcount = did_query.filter_by(did_type=DIDType.FILE).update({key: value}, synchronize_session=False)
|
|
96
96
|
if not rowcount:
|
|
97
|
-
# check for
|
|
97
|
+
# check for DID presence
|
|
98
98
|
raise exception.UnsupportedOperation('%s for %s:%s cannot be updated' % (key, scope, name))
|
|
99
99
|
|
|
100
100
|
session.query(models.DataIdentifierAssociation).filter_by(child_scope=scope, child_name=name, child_type=DIDType.FILE).update({key: value}, synchronize_session=False)
|
|
@@ -105,7 +105,7 @@ class DidColumnMeta(DidMetaPlugin):
|
|
|
105
105
|
elif key == 'adler32':
|
|
106
106
|
rowcount = did_query.filter_by(did_type=DIDType.FILE).update({key: value}, synchronize_session=False)
|
|
107
107
|
if not rowcount:
|
|
108
|
-
# check for
|
|
108
|
+
# check for DID presence
|
|
109
109
|
raise exception.UnsupportedOperation('%s for %s:%s cannot be updated' % (key, scope, name))
|
|
110
110
|
|
|
111
111
|
session.query(models.DataIdentifierAssociation).filter_by(child_scope=scope, child_name=name, child_type=DIDType.FILE).update({key: value}, synchronize_session=False)
|
|
@@ -114,7 +114,7 @@ class DidColumnMeta(DidMetaPlugin):
|
|
|
114
114
|
elif key == 'bytes':
|
|
115
115
|
rowcount = did_query.filter_by(did_type=DIDType.FILE).update({key: value}, synchronize_session=False)
|
|
116
116
|
if not rowcount:
|
|
117
|
-
# check for
|
|
117
|
+
# check for DID presence
|
|
118
118
|
raise exception.UnsupportedOperation('%s for %s:%s cannot be updated' % (key, scope, name))
|
|
119
119
|
|
|
120
120
|
session.query(models.DataIdentifierAssociation).filter_by(child_scope=scope, child_name=name, child_type=DIDType.FILE).update({key: value}, synchronize_session=False)
|
|
@@ -176,7 +176,7 @@ class DidColumnMeta(DidMetaPlugin):
|
|
|
176
176
|
|
|
177
177
|
:param scope: the scope name.
|
|
178
178
|
:param filters: dictionary of attributes by which the results should be filtered.
|
|
179
|
-
:param did_type: the type of the
|
|
179
|
+
:param did_type: the type of the DID: all(container, dataset, file), collection(dataset or container), dataset, container, file.
|
|
180
180
|
:param ignore_case: ignore case distinctions.
|
|
181
181
|
:param limit: limit number.
|
|
182
182
|
:param offset: offset number.
|
|
@@ -281,8 +281,8 @@ class DidColumnMeta(DidMetaPlugin):
|
|
|
281
281
|
"""
|
|
282
282
|
Deletes the metadata stored for the given key.
|
|
283
283
|
|
|
284
|
-
:param scope: The scope of the
|
|
285
|
-
:param name: The name of the
|
|
284
|
+
:param scope: The scope of the DID.
|
|
285
|
+
:param name: The name of the DID.
|
|
286
286
|
:param key: Key of the metadata.
|
|
287
287
|
"""
|
|
288
288
|
raise NotImplementedError('The DidColumnMeta plugin does not currently support deleting metadata.')
|
|
@@ -113,8 +113,8 @@ class DidMetaPlugin(metaclass=ABCMeta):
|
|
|
113
113
|
"""
|
|
114
114
|
Deletes the metadata stored for the given key.
|
|
115
115
|
|
|
116
|
-
:param scope: The scope of the
|
|
117
|
-
:param name: The name of the
|
|
116
|
+
:param scope: The scope of the DID.
|
|
117
|
+
:param name: The name of the DID.
|
|
118
118
|
:param key: Key of the metadata.
|
|
119
119
|
:param session: The database session in use.
|
|
120
120
|
"""
|
|
@@ -139,7 +139,7 @@ class DidMetaPlugin(metaclass=ABCMeta):
|
|
|
139
139
|
|
|
140
140
|
:param scope: the scope name.
|
|
141
141
|
:param filters: dictionary of attributes by which the results should be filtered.
|
|
142
|
-
:param did_type: the type of the
|
|
142
|
+
:param did_type: the type of the DID: all(container, dataset, file), collection(dataset or container), dataset, container, file.
|
|
143
143
|
:param ignore_case: ignore case distinctions.
|
|
144
144
|
:param limit: limit number.
|
|
145
145
|
:param offset: offset number.
|
|
@@ -109,7 +109,7 @@ class ElasticDidMeta(DidMetaPlugin):
|
|
|
109
109
|
:param scope: The scope name
|
|
110
110
|
:param name: The data identifier name
|
|
111
111
|
:param session: The database session in use
|
|
112
|
-
:returns: The metadata for the
|
|
112
|
+
:returns: The metadata for the DID
|
|
113
113
|
:raises DataIdentifierNotFound: If the DID metadata is not found.
|
|
114
114
|
:raises RucioException: If another error occurs during the process.
|
|
115
115
|
"""
|
|
@@ -136,8 +136,8 @@ class ElasticDidMeta(DidMetaPlugin):
|
|
|
136
136
|
"""
|
|
137
137
|
Set single metadata key.
|
|
138
138
|
|
|
139
|
-
:param scope: the scope of
|
|
140
|
-
:param name: the name of the
|
|
139
|
+
:param scope: the scope of DID
|
|
140
|
+
:param name: the name of the DID
|
|
141
141
|
:param key: the key to be added
|
|
142
142
|
:param value: the value of the key to be added
|
|
143
143
|
:param recursive: recurse into DIDs (not supported)
|
|
@@ -159,8 +159,8 @@ class ElasticDidMeta(DidMetaPlugin):
|
|
|
159
159
|
"""
|
|
160
160
|
Bulk set metadata keys.
|
|
161
161
|
|
|
162
|
-
:param scope: the scope of
|
|
163
|
-
:param name: the name of the
|
|
162
|
+
:param scope: the scope of DID
|
|
163
|
+
:param name: the name of the DID
|
|
164
164
|
:param meta: dictionary of metadata keypairs to be added
|
|
165
165
|
:param recursive: recurse into DIDs (not supported)
|
|
166
166
|
:param session: The database session in use
|
|
@@ -201,8 +201,8 @@ class ElasticDidMeta(DidMetaPlugin):
|
|
|
201
201
|
"""
|
|
202
202
|
Delete a key from metadata.
|
|
203
203
|
|
|
204
|
-
:param scope: the scope of
|
|
205
|
-
:param name: the name of the
|
|
204
|
+
:param scope: the scope of DID
|
|
205
|
+
:param name: the name of the DID
|
|
206
206
|
:param key: the key to be deleted
|
|
207
207
|
:raises DataIdentifierNotFound: If the DID is not found.
|
|
208
208
|
:raises RucioException: If an error occurs while setting the metadata.
|
|
@@ -122,8 +122,8 @@ class JSONDidMeta(DidMetaPlugin):
|
|
|
122
122
|
"""
|
|
123
123
|
Delete a key from the metadata column
|
|
124
124
|
|
|
125
|
-
:param scope: the scope of
|
|
126
|
-
:param name: the name of the
|
|
125
|
+
:param scope: the scope of DID
|
|
126
|
+
:param name: the name of the DID
|
|
127
127
|
:param key: the key to be deleted
|
|
128
128
|
:param session: The database session in use.
|
|
129
129
|
"""
|
|
@@ -93,9 +93,9 @@ class MongoDidMeta(DidMetaPlugin):
|
|
|
93
93
|
:param scope: The scope name
|
|
94
94
|
:param name: The data identifier name
|
|
95
95
|
:param session: The database session in use
|
|
96
|
-
:returns: The metadata for the
|
|
96
|
+
:returns: The metadata for the DID
|
|
97
97
|
"""
|
|
98
|
-
# get first document with this
|
|
98
|
+
# get first document with this DID == _id
|
|
99
99
|
doc = self.col.find_one({
|
|
100
100
|
"_id": "{}:{}".format(scope.internal, name)
|
|
101
101
|
})
|
|
@@ -113,8 +113,8 @@ class MongoDidMeta(DidMetaPlugin):
|
|
|
113
113
|
"""
|
|
114
114
|
Set single metadata key.
|
|
115
115
|
|
|
116
|
-
:param scope: the scope of
|
|
117
|
-
:param name: the name of the
|
|
116
|
+
:param scope: the scope of DID
|
|
117
|
+
:param name: the name of the DID
|
|
118
118
|
:param key: the key to be added
|
|
119
119
|
:param value: the value of the key to be added
|
|
120
120
|
:param recursive: recurse into DIDs (not supported)
|
|
@@ -126,8 +126,8 @@ class MongoDidMeta(DidMetaPlugin):
|
|
|
126
126
|
"""
|
|
127
127
|
Bulk set metadata keys.
|
|
128
128
|
|
|
129
|
-
:param scope: the scope of
|
|
130
|
-
:param name: the name of the
|
|
129
|
+
:param scope: the scope of DID
|
|
130
|
+
:param name: the name of the DID
|
|
131
131
|
:param metadata: dictionary of metadata keypairs to be added
|
|
132
132
|
:param recursive: recurse into DIDs (not supported)
|
|
133
133
|
:param session: The database session in use
|
|
@@ -137,7 +137,7 @@ class MongoDidMeta(DidMetaPlugin):
|
|
|
137
137
|
if key in metadata:
|
|
138
138
|
metadata.pop(key)
|
|
139
139
|
|
|
140
|
-
# set first document with
|
|
140
|
+
# set first document with DID == _id
|
|
141
141
|
self.col.update_one(
|
|
142
142
|
{
|
|
143
143
|
"_id": "{}:{}".format(scope.internal, name)
|
|
@@ -157,8 +157,8 @@ class MongoDidMeta(DidMetaPlugin):
|
|
|
157
157
|
"""
|
|
158
158
|
Delete a key from metadata.
|
|
159
159
|
|
|
160
|
-
:param scope: the scope of
|
|
161
|
-
:param name: the name of the
|
|
160
|
+
:param scope: the scope of DID
|
|
161
|
+
:param name: the name of the DID
|
|
162
162
|
:param key: the key to be deleted
|
|
163
163
|
"""
|
|
164
164
|
meta = {key: ""}
|