rucio-clients 34.4.3__tar.gz → 34.6.0__tar.gz
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-clients might be problematic. Click here for more details.
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/PKG-INFO +1 -1
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/bin/rucio +7 -4
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/didclient.py +216 -45
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/diracclient.py +10 -1
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/downloadclient.py +10 -4
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/exportclient.py +3 -1
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/fileclient.py +2 -1
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/importclient.py +3 -1
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/lockclient.py +15 -3
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/rseclient.py +127 -43
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/ruleclient.py +28 -20
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/subscriptionclient.py +39 -26
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/config.py +4 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/constants.py +6 -1
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/logging.py +54 -37
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/schema/generic.py +1 -1
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/utils.py +0 -5
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/rsemanager.py +4 -3
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/vcsversion.py +3 -3
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_abacus_account.py +5 -3
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_abacus_rse.py +5 -3
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_bin_rucio.py +12 -9
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_conveyor.py +44 -20
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_conveyor_submitter.py +35 -15
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_counter.py +24 -8
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_dataset_replicas.py +202 -32
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_did.py +18 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_download.py +10 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_heartbeat.py +23 -3
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_import_export.py +5 -2
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_judge_evaluator.py +3 -1
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_judge_injector.py +7 -1
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_judge_repairer.py +38 -9
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_message.py +11 -10
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_meta_conventions.py +15 -4
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_multi_vo.py +12 -10
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_oauthmanager.py +64 -23
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_oidc.py +19 -11
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_reaper.py +26 -12
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse.py +35 -5
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rule.py +15 -8
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/AUTHORS.rst +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/ChangeLog +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/LICENSE +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/MANIFEST.in +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/README.rst +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/bin/rucio-admin +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/etc/rse-accounts.cfg.template +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/etc/rucio.cfg.atlas.client.template +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/etc/rucio.cfg.template +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/__init__.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/alembicrevision.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/__init__.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/accountclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/accountlimitclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/baseclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/client.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/configclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/credentialclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/lifetimeclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/metaconventionsclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/pingclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/replicaclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/requestclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/scopeclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/touchclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/client/uploadclient.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/__init__.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/cache.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/constraints.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/didtype.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/exception.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/extra.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/pcache.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/plugins.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/policy.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/schema/__init__.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/schema/atlas.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/schema/belleii.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/schema/domatpc.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/schema/escape.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/schema/generic_multi_vo.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/schema/icecube.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/stomp_utils.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/stopwatch.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/test_rucio_server.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/common/types.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/__init__.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/__init__.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/bittorrent.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/cache.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/dummy.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/gfal.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/globus.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/gsiftp.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/http_cache.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/mock.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/ngarc.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/posix.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/protocol.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/rclone.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/rfio.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/srm.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/ssh.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/storm.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/webdav.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/rse/protocols/xrootd.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio/version.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/lib/rucio_clients.egg-info/SOURCES.txt +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/pylintrc +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/pyproject.toml +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/requirements.txt +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/setup.cfg +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/setup.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/setuputil.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_abacus_collection_replica.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_account.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_account_limits.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_api_external_representation.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_archive.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_auditor.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_auditor_hdfs.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_auditor_srmdumps.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_authentication.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_automatix.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_bad_replica.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_bb8.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_belleii.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_boolean.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_clients.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_common_types.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_config.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_credential.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_curl.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_daemons.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_db.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_did_meta_plugins.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_didtype.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_dumper.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_dumper_consistency.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_dumper_data_model.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_dumper_path_parsing.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_filter_engine.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_hermes.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_identity.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_impl_upload_download.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_judge_cleaner.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_lifetime.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_meta_did.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_module_import.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_monitor.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_naming_convention.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_permission.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_pfns.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_ping.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_preparer.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_qos.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_quarantined_replica.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_redirect.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_replica.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_replica_recoverer.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_replica_sorting.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_request.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_root_proxy.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_expression_parser.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_lfn2path.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_protocol_gfal2.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_protocol_gfal2_impl.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_protocol_posix.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_protocol_rclone.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_protocol_rsync.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_protocol_srm.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_protocol_ssh.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_protocol_webdav.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_protocol_xrootd.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rse_selector.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_rucio_server.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_scope.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_subscription.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_throttler.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_tpc.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_trace.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_transfer.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_transfer_plugins.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_undertaker.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_upload.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tests/test_utils.py +0 -0
- {rucio_clients-34.4.3 → rucio_clients-34.6.0}/tools/merge_rucio_configs.py +0 -0
|
@@ -234,6 +234,8 @@ def get_client(args):
|
|
|
234
234
|
'oidc_issuer': args.oidc_issuer,
|
|
235
235
|
'oidc_username': args.oidc_username,
|
|
236
236
|
'oidc_password': args.oidc_password}
|
|
237
|
+
elif auth_type == "x509":
|
|
238
|
+
creds = {'client_cert': args.certificate, "client_key": args.client_key}
|
|
237
239
|
else:
|
|
238
240
|
creds = None
|
|
239
241
|
|
|
@@ -1854,7 +1856,8 @@ def get_parser():
|
|
|
1854
1856
|
+ 'to the keys configured in the /etc/idpsecrets.json auth server configuration file.') # NOQA: W503
|
|
1855
1857
|
|
|
1856
1858
|
# Options for the x509 auth_strategy
|
|
1857
|
-
oparser.add_argument('--certificate', dest='certificate', default=None, help='Client certificate file.')
|
|
1859
|
+
oparser.add_argument('--certificate', dest='certificate', default=None, help='Client certificate file for x509 Authentication.')
|
|
1860
|
+
oparser.add_argument('--client_key', dest='client_key', default=None, help='Client key for x509 Authentication.')
|
|
1858
1861
|
oparser.add_argument('--ca-certificate', dest='ca_certificate', default=None, help='CA certificate to verify peer against (SSL).')
|
|
1859
1862
|
|
|
1860
1863
|
# Ping command
|
|
@@ -1926,7 +1929,7 @@ To list the missing replica of a dataset of a given RSE-expression::
|
|
|
1926
1929
|
list_file_replicas_parser.add_argument('--no-resolve-archives', dest='no_resolve_archives', default=False, action='store_true', help='Do not resolve archives which may contain the files.', required=False)
|
|
1927
1930
|
list_file_replicas_parser.add_argument('--sort', dest='sort', default=None, action='store', help='Replica sort algorithm. Available options: geoip (default), random', required=False)
|
|
1928
1931
|
list_file_replicas_parser.add_argument('--rses', dest='rses', default=None, action='store', help='The RSE filter expression. A comprehensive help about RSE expressions\
|
|
1929
|
-
can be found in ' + Color.BOLD + '
|
|
1932
|
+
can be found in ' + Color.BOLD + 'https://rucio.cern.ch/documentation/started/concepts/rse_expressions' + Color.END)
|
|
1930
1933
|
|
|
1931
1934
|
# The list-dataset-replicas command
|
|
1932
1935
|
list_dataset_replicas_parser = subparsers.add_parser('list-dataset-replicas', help='List the dataset replicas.',
|
|
@@ -2428,13 +2431,13 @@ You can filter by account::
|
|
|
2428
2431
|
list_rses_parser = subparsers.add_parser('list-rses', help='Show the list of all the registered Rucio Storage Elements (RSEs).')
|
|
2429
2432
|
list_rses_parser.set_defaults(function=list_rses)
|
|
2430
2433
|
list_rses_parser.add_argument('--rses', dest='rses', action='store', help='The RSE filter expression. A comprehensive help about RSE expressions \
|
|
2431
|
-
can be found in ' + Color.BOLD + '
|
|
2434
|
+
can be found in ' + Color.BOLD + 'https://rucio.cern.ch/documentation/started/concepts/rse_expressions' + Color.END)
|
|
2432
2435
|
|
|
2433
2436
|
# The list-suspicious-replicas command
|
|
2434
2437
|
list_suspicious_replicas_parser = subparsers.add_parser('list-suspicious-replicas', help='Show the list of all replicas marked "suspicious".')
|
|
2435
2438
|
list_suspicious_replicas_parser.set_defaults(function=list_suspicious_replicas)
|
|
2436
2439
|
list_suspicious_replicas_parser.add_argument('--expression', dest='rse_expression', action='store', help='The RSE filter expression. A comprehensive help about RSE expressions \
|
|
2437
|
-
can be found in ' + Color.BOLD + '
|
|
2440
|
+
can be found in ' + Color.BOLD + 'https://rucio.cern.ch/documentation/started/concepts/rse_expressions' + Color.END)
|
|
2438
2441
|
list_suspicious_replicas_parser.add_argument('--younger_than', '--younger-than', new_option_string='--younger-than', dest='younger_than', action=StoreAndDeprecateWarningAction, help='List files that have been marked suspicious since the date "younger_than", e.g. 2021-11-29T00:00:00.') # NOQA: E501
|
|
2439
2442
|
list_suspicious_replicas_parser.add_argument('--nattempts', dest='nattempts', action='store', help='Minimum number of failed attempts to access a suspicious file.')
|
|
2440
2443
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
from datetime import datetime
|
|
16
16
|
from json import dumps
|
|
17
|
-
from typing import Any, Optional
|
|
17
|
+
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
|
|
18
18
|
from urllib.parse import quote_plus
|
|
19
19
|
|
|
20
20
|
from requests.status_codes import codes
|
|
@@ -23,6 +23,9 @@ from rucio.client.baseclient import BaseClient, choice
|
|
|
23
23
|
from rucio.common.exception import DeprecationError
|
|
24
24
|
from rucio.common.utils import build_url, date_to_str, render_json, render_json_list
|
|
25
25
|
|
|
26
|
+
if TYPE_CHECKING:
|
|
27
|
+
from collections.abc import Iterable, Iterator, Mapping, Sequence
|
|
28
|
+
|
|
26
29
|
|
|
27
30
|
class DIDClient(BaseClient):
|
|
28
31
|
|
|
@@ -31,7 +34,14 @@ class DIDClient(BaseClient):
|
|
|
31
34
|
DIDS_BASEURL = 'dids'
|
|
32
35
|
ARCHIVES_BASEURL = 'archives'
|
|
33
36
|
|
|
34
|
-
def list_dids(
|
|
37
|
+
def list_dids(
|
|
38
|
+
self,
|
|
39
|
+
scope: str,
|
|
40
|
+
filters: "Sequence[dict[str, Any]]",
|
|
41
|
+
did_type: Literal['all', 'collection', 'dataset', 'container', 'file'] = 'collection',
|
|
42
|
+
long: bool = False,
|
|
43
|
+
recursive: bool = False
|
|
44
|
+
) -> "Iterator[dict[str, Any]]":
|
|
35
45
|
"""
|
|
36
46
|
List all data identifiers in a scope which match a given pattern.
|
|
37
47
|
|
|
@@ -78,14 +88,25 @@ class DIDClient(BaseClient):
|
|
|
78
88
|
"""
|
|
79
89
|
raise DeprecationError("Command or function has been deprecated. Please use list_dids instead.")
|
|
80
90
|
|
|
81
|
-
def add_did(
|
|
91
|
+
def add_did(
|
|
92
|
+
self,
|
|
93
|
+
scope: str,
|
|
94
|
+
name: str,
|
|
95
|
+
did_type: Literal['FILE', 'DATASET', 'CONTAINER'],
|
|
96
|
+
statuses: Optional["Mapping[str, Any]"] = None,
|
|
97
|
+
meta: Optional["Mapping[str, Any]"] = None,
|
|
98
|
+
rules: Optional["Sequence[Mapping[str, Any]]"] = None,
|
|
99
|
+
lifetime: Optional[int] = None,
|
|
100
|
+
dids: Optional["Sequence[Mapping[str, Any]]"] = None,
|
|
101
|
+
rse: Optional[str] = None
|
|
102
|
+
) -> bool:
|
|
82
103
|
"""
|
|
83
104
|
Add data identifier for a dataset or container.
|
|
84
105
|
|
|
85
106
|
:param scope: The scope name.
|
|
86
107
|
:param name: The data identifier name.
|
|
87
108
|
:param did_type: The data identifier type (file|dataset|container).
|
|
88
|
-
:param statuses: Dictionary with statuses, e.g.
|
|
109
|
+
:param statuses: Dictionary with statuses, e.g. {'monotonic':True}.
|
|
89
110
|
:param meta: Meta-data associated with the data identifier is represented using key/value pairs in a dictionary.
|
|
90
111
|
:param rules: Replication rules associated with the data identifier. A list of dictionaries, e.g., [{'copies': 2, 'rse_expression': 'TIERS1'}, ].
|
|
91
112
|
:param lifetime: DID's lifetime (in seconds).
|
|
@@ -95,7 +116,7 @@ class DIDClient(BaseClient):
|
|
|
95
116
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name)])
|
|
96
117
|
url = build_url(choice(self.list_hosts), path=path)
|
|
97
118
|
# Build json
|
|
98
|
-
data = {'type': did_type}
|
|
119
|
+
data: dict[str, Any] = {'type': did_type}
|
|
99
120
|
if statuses:
|
|
100
121
|
data['statuses'] = statuses
|
|
101
122
|
if meta:
|
|
@@ -115,7 +136,7 @@ class DIDClient(BaseClient):
|
|
|
115
136
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
116
137
|
raise exc_cls(exc_msg)
|
|
117
138
|
|
|
118
|
-
def add_dids(self, dids):
|
|
139
|
+
def add_dids(self, dids: "Sequence[Mapping[str, Any]]") -> bool:
|
|
119
140
|
"""
|
|
120
141
|
Bulk add datasets/containers.
|
|
121
142
|
"""
|
|
@@ -128,7 +149,17 @@ class DIDClient(BaseClient):
|
|
|
128
149
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
129
150
|
raise exc_cls(exc_msg)
|
|
130
151
|
|
|
131
|
-
def add_dataset(
|
|
152
|
+
def add_dataset(
|
|
153
|
+
self,
|
|
154
|
+
scope: str,
|
|
155
|
+
name: str,
|
|
156
|
+
statuses: Optional["Mapping[str, Any]"] = None,
|
|
157
|
+
meta: Optional["Mapping[str, Any]"] = None,
|
|
158
|
+
rules: Optional["Sequence[Mapping[str, Any]]"] = None,
|
|
159
|
+
lifetime: Optional[int] = None,
|
|
160
|
+
files: Optional["Sequence[Mapping[str, Any]]"] = None,
|
|
161
|
+
rse: Optional[str] = None
|
|
162
|
+
) -> bool:
|
|
132
163
|
"""
|
|
133
164
|
Add data identifier for a dataset.
|
|
134
165
|
|
|
@@ -145,7 +176,7 @@ class DIDClient(BaseClient):
|
|
|
145
176
|
statuses=statuses, meta=meta, rules=rules,
|
|
146
177
|
lifetime=lifetime, dids=files, rse=rse)
|
|
147
178
|
|
|
148
|
-
def add_datasets(self, dsns):
|
|
179
|
+
def add_datasets(self, dsns: "Iterable[dict[str, Any]]") -> bool:
|
|
149
180
|
"""
|
|
150
181
|
Bulk add datasets.
|
|
151
182
|
|
|
@@ -153,7 +184,15 @@ class DIDClient(BaseClient):
|
|
|
153
184
|
"""
|
|
154
185
|
return self.add_dids(dids=[dict(list(dsn.items()) + [('type', 'DATASET')]) for dsn in dsns])
|
|
155
186
|
|
|
156
|
-
def add_container(
|
|
187
|
+
def add_container(
|
|
188
|
+
self,
|
|
189
|
+
scope: str,
|
|
190
|
+
name: str,
|
|
191
|
+
statuses: Optional["Mapping[str, Any]"] = None,
|
|
192
|
+
meta: Optional["Mapping[str, Any]"] = None,
|
|
193
|
+
rules: Optional["Sequence[Mapping[str, Any]]"] = None,
|
|
194
|
+
lifetime: Optional[int] = None
|
|
195
|
+
) -> bool:
|
|
157
196
|
"""
|
|
158
197
|
Add data identifier for a container.
|
|
159
198
|
|
|
@@ -166,15 +205,21 @@ class DIDClient(BaseClient):
|
|
|
166
205
|
"""
|
|
167
206
|
return self.add_did(scope=scope, name=name, did_type='CONTAINER', statuses=statuses, meta=meta, rules=rules, lifetime=lifetime)
|
|
168
207
|
|
|
169
|
-
def add_containers(self, cnts):
|
|
208
|
+
def add_containers(self, cnts: "Sequence[dict[str, Any]]") -> bool:
|
|
170
209
|
"""
|
|
171
210
|
Bulk add containers.
|
|
172
211
|
|
|
173
212
|
:param cnts: A list of containers.
|
|
174
213
|
"""
|
|
175
|
-
return self.add_dids(dids=[dict(list(
|
|
214
|
+
return self.add_dids(dids=[dict(list(cnt.items()) + [('type', 'CONTAINER')]) for cnt in cnts])
|
|
176
215
|
|
|
177
|
-
def attach_dids(
|
|
216
|
+
def attach_dids(
|
|
217
|
+
self,
|
|
218
|
+
scope: str,
|
|
219
|
+
name: str,
|
|
220
|
+
dids: "Sequence[Mapping[str, Any]]",
|
|
221
|
+
rse: Optional[str] = None
|
|
222
|
+
) -> bool:
|
|
178
223
|
"""
|
|
179
224
|
Attach data identifier.
|
|
180
225
|
|
|
@@ -185,7 +230,7 @@ class DIDClient(BaseClient):
|
|
|
185
230
|
"""
|
|
186
231
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'dids'])
|
|
187
232
|
url = build_url(choice(self.list_hosts), path=path)
|
|
188
|
-
data = {'dids': dids}
|
|
233
|
+
data: dict[str, Any] = {'dids': dids}
|
|
189
234
|
if rse:
|
|
190
235
|
data['rse'] = rse
|
|
191
236
|
r = self._send_request(url, type_='POST', data=render_json(**data))
|
|
@@ -195,7 +240,12 @@ class DIDClient(BaseClient):
|
|
|
195
240
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
196
241
|
raise exc_cls(exc_msg)
|
|
197
242
|
|
|
198
|
-
def detach_dids(
|
|
243
|
+
def detach_dids(
|
|
244
|
+
self,
|
|
245
|
+
scope: str,
|
|
246
|
+
name: str,
|
|
247
|
+
dids: Optional["Sequence[Mapping[str, Any]]"] = None
|
|
248
|
+
) -> bool:
|
|
199
249
|
"""
|
|
200
250
|
Detach data identifier
|
|
201
251
|
|
|
@@ -213,7 +263,11 @@ class DIDClient(BaseClient):
|
|
|
213
263
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
214
264
|
raise exc_cls(exc_msg)
|
|
215
265
|
|
|
216
|
-
def attach_dids_to_dids(
|
|
266
|
+
def attach_dids_to_dids(
|
|
267
|
+
self,
|
|
268
|
+
attachments: "Sequence[dict[str, Union[str, Sequence[dict[str, Any]]]]]",
|
|
269
|
+
ignore_duplicate: bool = False
|
|
270
|
+
) -> bool:
|
|
217
271
|
"""
|
|
218
272
|
Add dids to dids.
|
|
219
273
|
|
|
@@ -233,7 +287,11 @@ class DIDClient(BaseClient):
|
|
|
233
287
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
234
288
|
raise exc_cls(exc_msg)
|
|
235
289
|
|
|
236
|
-
def add_files_to_datasets(
|
|
290
|
+
def add_files_to_datasets(
|
|
291
|
+
self,
|
|
292
|
+
attachments: "Sequence[dict[str, Union[str, Sequence[dict[str, Any]]]]]",
|
|
293
|
+
ignore_duplicate: bool = False
|
|
294
|
+
) -> bool:
|
|
237
295
|
"""
|
|
238
296
|
Add files to datasets.
|
|
239
297
|
|
|
@@ -246,7 +304,10 @@ class DIDClient(BaseClient):
|
|
|
246
304
|
return self.attach_dids_to_dids(attachments=attachments,
|
|
247
305
|
ignore_duplicate=ignore_duplicate)
|
|
248
306
|
|
|
249
|
-
def add_datasets_to_containers(
|
|
307
|
+
def add_datasets_to_containers(
|
|
308
|
+
self,
|
|
309
|
+
attachments: "Sequence[dict[str, Union[str, Sequence[dict[str, Any]]]]]"
|
|
310
|
+
) -> bool:
|
|
250
311
|
"""
|
|
251
312
|
Add datasets_to_containers.
|
|
252
313
|
|
|
@@ -257,7 +318,10 @@ class DIDClient(BaseClient):
|
|
|
257
318
|
"""
|
|
258
319
|
return self.attach_dids_to_dids(attachments=attachments)
|
|
259
320
|
|
|
260
|
-
def add_containers_to_containers(
|
|
321
|
+
def add_containers_to_containers(
|
|
322
|
+
self,
|
|
323
|
+
attachments: "Sequence[dict[str, Union[str, Sequence[dict[str, Any]]]]]"
|
|
324
|
+
) -> bool:
|
|
261
325
|
"""
|
|
262
326
|
Add containers_to_containers.
|
|
263
327
|
|
|
@@ -268,7 +332,13 @@ class DIDClient(BaseClient):
|
|
|
268
332
|
"""
|
|
269
333
|
return self.attach_dids_to_dids(attachments=attachments)
|
|
270
334
|
|
|
271
|
-
def add_files_to_dataset(
|
|
335
|
+
def add_files_to_dataset(
|
|
336
|
+
self,
|
|
337
|
+
scope: str,
|
|
338
|
+
name: str,
|
|
339
|
+
files: "Sequence[Mapping[str, Any]]",
|
|
340
|
+
rse: Optional[str] = None
|
|
341
|
+
) -> bool:
|
|
272
342
|
"""
|
|
273
343
|
Add files to datasets.
|
|
274
344
|
|
|
@@ -279,7 +349,12 @@ class DIDClient(BaseClient):
|
|
|
279
349
|
"""
|
|
280
350
|
return self.attach_dids(scope=scope, name=name, dids=files, rse=rse)
|
|
281
351
|
|
|
282
|
-
def add_files_to_archive(
|
|
352
|
+
def add_files_to_archive(
|
|
353
|
+
self,
|
|
354
|
+
scope: str,
|
|
355
|
+
name: str,
|
|
356
|
+
files: "Sequence[Mapping[str, Any]]"
|
|
357
|
+
) -> bool:
|
|
283
358
|
"""
|
|
284
359
|
Add files to archive.
|
|
285
360
|
|
|
@@ -289,7 +364,12 @@ class DIDClient(BaseClient):
|
|
|
289
364
|
"""
|
|
290
365
|
return self.attach_dids(scope=scope, name=name, dids=files)
|
|
291
366
|
|
|
292
|
-
def add_datasets_to_container(
|
|
367
|
+
def add_datasets_to_container(
|
|
368
|
+
self,
|
|
369
|
+
scope: str,
|
|
370
|
+
name: str,
|
|
371
|
+
dsns: "Sequence[Mapping[str, Any]]"
|
|
372
|
+
) -> bool:
|
|
293
373
|
"""
|
|
294
374
|
Add datasets to container.
|
|
295
375
|
|
|
@@ -299,7 +379,12 @@ class DIDClient(BaseClient):
|
|
|
299
379
|
"""
|
|
300
380
|
return self.attach_dids(scope=scope, name=name, dids=dsns)
|
|
301
381
|
|
|
302
|
-
def add_containers_to_container(
|
|
382
|
+
def add_containers_to_container(
|
|
383
|
+
self,
|
|
384
|
+
scope: str,
|
|
385
|
+
name: str,
|
|
386
|
+
cnts: "Sequence[Mapping[str, Any]]"
|
|
387
|
+
) -> bool:
|
|
303
388
|
"""
|
|
304
389
|
Add containers to container.
|
|
305
390
|
|
|
@@ -309,7 +394,11 @@ class DIDClient(BaseClient):
|
|
|
309
394
|
"""
|
|
310
395
|
return self.attach_dids(scope=scope, name=name, dids=cnts)
|
|
311
396
|
|
|
312
|
-
def list_content(
|
|
397
|
+
def list_content(
|
|
398
|
+
self,
|
|
399
|
+
scope: str,
|
|
400
|
+
name: str
|
|
401
|
+
) -> "Iterator[dict[str, Any]]":
|
|
313
402
|
"""
|
|
314
403
|
List data identifier contents.
|
|
315
404
|
|
|
@@ -325,7 +414,11 @@ class DIDClient(BaseClient):
|
|
|
325
414
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
326
415
|
raise exc_cls(exc_msg)
|
|
327
416
|
|
|
328
|
-
def list_content_history(
|
|
417
|
+
def list_content_history(
|
|
418
|
+
self,
|
|
419
|
+
scope: str,
|
|
420
|
+
name: str
|
|
421
|
+
) -> "Iterator[dict[str, Any]]":
|
|
329
422
|
"""
|
|
330
423
|
List data identifier contents history.
|
|
331
424
|
|
|
@@ -341,7 +434,12 @@ class DIDClient(BaseClient):
|
|
|
341
434
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
342
435
|
raise exc_cls(exc_msg)
|
|
343
436
|
|
|
344
|
-
def list_files(
|
|
437
|
+
def list_files(
|
|
438
|
+
self,
|
|
439
|
+
scope: str,
|
|
440
|
+
name: str,
|
|
441
|
+
long: Optional[bool] = None
|
|
442
|
+
) -> "Iterator[dict[str, Any]]":
|
|
345
443
|
"""
|
|
346
444
|
List data identifier file contents.
|
|
347
445
|
|
|
@@ -363,7 +461,7 @@ class DIDClient(BaseClient):
|
|
|
363
461
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
364
462
|
raise exc_cls(exc_msg)
|
|
365
463
|
|
|
366
|
-
def bulk_list_files(self, dids: list[dict[str, Any]]):
|
|
464
|
+
def bulk_list_files(self, dids: list[dict[str, Any]]) -> "Iterator[dict[str, Any]]":
|
|
367
465
|
"""
|
|
368
466
|
List data identifier file contents.
|
|
369
467
|
|
|
@@ -381,7 +479,13 @@ class DIDClient(BaseClient):
|
|
|
381
479
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
382
480
|
raise exc_cls(exc_msg)
|
|
383
481
|
|
|
384
|
-
def get_did(
|
|
482
|
+
def get_did(
|
|
483
|
+
self,
|
|
484
|
+
scope: str,
|
|
485
|
+
name: str,
|
|
486
|
+
dynamic: bool = False,
|
|
487
|
+
dynamic_depth: Optional[str] = None
|
|
488
|
+
) -> dict[str, Any]:
|
|
385
489
|
"""
|
|
386
490
|
Retrieve a single data identifier.
|
|
387
491
|
|
|
@@ -406,7 +510,12 @@ class DIDClient(BaseClient):
|
|
|
406
510
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
407
511
|
raise exc_cls(exc_msg)
|
|
408
512
|
|
|
409
|
-
def get_metadata(
|
|
513
|
+
def get_metadata(
|
|
514
|
+
self,
|
|
515
|
+
scope: str,
|
|
516
|
+
name: str,
|
|
517
|
+
plugin: str = 'DID_COLUMN'
|
|
518
|
+
) -> dict[str, Any]:
|
|
410
519
|
"""
|
|
411
520
|
Get data identifier metadata
|
|
412
521
|
|
|
@@ -426,7 +535,11 @@ class DIDClient(BaseClient):
|
|
|
426
535
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
427
536
|
raise exc_cls(exc_msg)
|
|
428
537
|
|
|
429
|
-
def get_metadata_bulk(
|
|
538
|
+
def get_metadata_bulk(
|
|
539
|
+
self,
|
|
540
|
+
dids: "Sequence[Mapping[str, Any]]",
|
|
541
|
+
inherit: bool = False
|
|
542
|
+
) -> "Iterator[dict[str, Any]]":
|
|
430
543
|
"""
|
|
431
544
|
Bulk get data identifier metadata
|
|
432
545
|
:param inherit: A boolean. If set to true, the metadata of the parent are concatenated.
|
|
@@ -441,7 +554,14 @@ class DIDClient(BaseClient):
|
|
|
441
554
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
442
555
|
raise exc_cls(exc_msg)
|
|
443
556
|
|
|
444
|
-
def set_metadata(
|
|
557
|
+
def set_metadata(
|
|
558
|
+
self,
|
|
559
|
+
scope: str,
|
|
560
|
+
name: str,
|
|
561
|
+
key: str,
|
|
562
|
+
value: Any,
|
|
563
|
+
recursive: bool = False
|
|
564
|
+
) -> bool:
|
|
445
565
|
"""
|
|
446
566
|
Set data identifier metadata
|
|
447
567
|
|
|
@@ -461,14 +581,19 @@ class DIDClient(BaseClient):
|
|
|
461
581
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
462
582
|
raise exc_cls(exc_msg)
|
|
463
583
|
|
|
464
|
-
def set_metadata_bulk(
|
|
584
|
+
def set_metadata_bulk(
|
|
585
|
+
self,
|
|
586
|
+
scope: str,
|
|
587
|
+
name: str,
|
|
588
|
+
meta: "Mapping[str, Any]",
|
|
589
|
+
recursive: bool = False
|
|
590
|
+
) -> bool:
|
|
465
591
|
"""
|
|
466
592
|
Set data identifier metadata in bulk.
|
|
467
593
|
|
|
468
594
|
:param scope: The scope name.
|
|
469
595
|
:param name: The data identifier name.
|
|
470
596
|
:param meta: the metadata key-values.
|
|
471
|
-
:type meta: dict
|
|
472
597
|
:param recursive: Option to propagate the metadata change to content.
|
|
473
598
|
"""
|
|
474
599
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'meta'])
|
|
@@ -481,11 +606,15 @@ class DIDClient(BaseClient):
|
|
|
481
606
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
482
607
|
raise exc_cls(exc_msg)
|
|
483
608
|
|
|
484
|
-
def set_dids_metadata_bulk(
|
|
609
|
+
def set_dids_metadata_bulk(
|
|
610
|
+
self,
|
|
611
|
+
dids: "Sequence[Mapping[str, Any]]",
|
|
612
|
+
recursive: bool = False
|
|
613
|
+
) -> bool:
|
|
485
614
|
"""
|
|
486
615
|
Set metadata to a list of data identifiers.
|
|
487
616
|
|
|
488
|
-
:param dids: A list of dids including metadata, i.e. [
|
|
617
|
+
:param dids: A list of dids including metadata, i.e. [{'scope': scope1, 'name': name1, 'meta': {key1: value1, key2: value2}] .
|
|
489
618
|
:param recursive: Option to propagate the metadata update to content.
|
|
490
619
|
"""
|
|
491
620
|
path = '/'.join([self.DIDS_BASEURL, 'bulkdidsmeta'])
|
|
@@ -498,7 +627,12 @@ class DIDClient(BaseClient):
|
|
|
498
627
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
499
628
|
raise exc_cls(exc_msg)
|
|
500
629
|
|
|
501
|
-
def set_status(
|
|
630
|
+
def set_status(
|
|
631
|
+
self,
|
|
632
|
+
scope: str,
|
|
633
|
+
name: str,
|
|
634
|
+
**kwargs
|
|
635
|
+
) -> bool:
|
|
502
636
|
"""
|
|
503
637
|
Set data identifier status
|
|
504
638
|
|
|
@@ -516,7 +650,11 @@ class DIDClient(BaseClient):
|
|
|
516
650
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
517
651
|
raise exc_cls(exc_msg)
|
|
518
652
|
|
|
519
|
-
def close(
|
|
653
|
+
def close(
|
|
654
|
+
self,
|
|
655
|
+
scope: str,
|
|
656
|
+
name: str
|
|
657
|
+
) -> bool:
|
|
520
658
|
"""
|
|
521
659
|
close dataset/container
|
|
522
660
|
|
|
@@ -525,7 +663,12 @@ class DIDClient(BaseClient):
|
|
|
525
663
|
"""
|
|
526
664
|
return self.set_status(scope=scope, name=name, open=False)
|
|
527
665
|
|
|
528
|
-
def delete_metadata(
|
|
666
|
+
def delete_metadata(
|
|
667
|
+
self,
|
|
668
|
+
scope: str,
|
|
669
|
+
name: str,
|
|
670
|
+
key: str
|
|
671
|
+
) -> bool:
|
|
529
672
|
"""
|
|
530
673
|
Delete data identifier metadata
|
|
531
674
|
|
|
@@ -543,7 +686,11 @@ class DIDClient(BaseClient):
|
|
|
543
686
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
544
687
|
raise exc_cls(exc_msg)
|
|
545
688
|
|
|
546
|
-
def list_did_rules(
|
|
689
|
+
def list_did_rules(
|
|
690
|
+
self,
|
|
691
|
+
scope: str,
|
|
692
|
+
name: str
|
|
693
|
+
) -> "Iterator[dict[str, Any]]":
|
|
547
694
|
"""
|
|
548
695
|
List the associated rules of a data identifier.
|
|
549
696
|
|
|
@@ -560,7 +707,11 @@ class DIDClient(BaseClient):
|
|
|
560
707
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
561
708
|
raise exc_cls(exc_msg)
|
|
562
709
|
|
|
563
|
-
def list_associated_rules_for_file(
|
|
710
|
+
def list_associated_rules_for_file(
|
|
711
|
+
self,
|
|
712
|
+
scope: str,
|
|
713
|
+
name: str
|
|
714
|
+
) -> "Iterator[dict[str, Any]]":
|
|
564
715
|
"""
|
|
565
716
|
List the associated rules a file is affected from..
|
|
566
717
|
|
|
@@ -577,7 +728,7 @@ class DIDClient(BaseClient):
|
|
|
577
728
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
578
729
|
raise exc_cls(exc_msg)
|
|
579
730
|
|
|
580
|
-
def get_dataset_by_guid(self, guid):
|
|
731
|
+
def get_dataset_by_guid(self, guid: str) -> "Iterator[dict[str, Any]]":
|
|
581
732
|
"""
|
|
582
733
|
Get the parent datasets for a given GUID.
|
|
583
734
|
:param guid: The GUID.
|
|
@@ -594,7 +745,12 @@ class DIDClient(BaseClient):
|
|
|
594
745
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
595
746
|
raise exc_cls(exc_msg)
|
|
596
747
|
|
|
597
|
-
def scope_list(
|
|
748
|
+
def scope_list(
|
|
749
|
+
self,
|
|
750
|
+
scope: str,
|
|
751
|
+
name: Optional[str] = None,
|
|
752
|
+
recursive: bool = False
|
|
753
|
+
) -> "Iterator[dict[str, Any]]":
|
|
598
754
|
"""
|
|
599
755
|
List data identifiers in a scope.
|
|
600
756
|
|
|
@@ -618,7 +774,11 @@ class DIDClient(BaseClient):
|
|
|
618
774
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
619
775
|
raise exc_cls(exc_msg)
|
|
620
776
|
|
|
621
|
-
def list_parent_dids(
|
|
777
|
+
def list_parent_dids(
|
|
778
|
+
self,
|
|
779
|
+
scope: str,
|
|
780
|
+
name: str
|
|
781
|
+
) -> "Iterator[dict[str, Any]]":
|
|
622
782
|
"""
|
|
623
783
|
List parent dataset/containers of a did.
|
|
624
784
|
|
|
@@ -636,7 +796,14 @@ class DIDClient(BaseClient):
|
|
|
636
796
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
637
797
|
raise exc_cls(exc_msg)
|
|
638
798
|
|
|
639
|
-
def create_did_sample(
|
|
799
|
+
def create_did_sample(
|
|
800
|
+
self,
|
|
801
|
+
input_scope: str,
|
|
802
|
+
input_name: str,
|
|
803
|
+
output_scope: str,
|
|
804
|
+
output_name: str,
|
|
805
|
+
nbfiles: int
|
|
806
|
+
) -> bool:
|
|
640
807
|
"""
|
|
641
808
|
Create a sample from an input collection.
|
|
642
809
|
|
|
@@ -663,7 +830,7 @@ class DIDClient(BaseClient):
|
|
|
663
830
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
664
831
|
raise exc_cls(exc_msg)
|
|
665
832
|
|
|
666
|
-
def resurrect(self, dids):
|
|
833
|
+
def resurrect(self, dids: "Sequence[Mapping[str, Any]]") -> bool:
|
|
667
834
|
"""
|
|
668
835
|
Resurrect a list of dids.
|
|
669
836
|
|
|
@@ -678,7 +845,11 @@ class DIDClient(BaseClient):
|
|
|
678
845
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
679
846
|
raise exc_cls(exc_msg)
|
|
680
847
|
|
|
681
|
-
def list_archive_content(
|
|
848
|
+
def list_archive_content(
|
|
849
|
+
self,
|
|
850
|
+
scope: str,
|
|
851
|
+
name: str
|
|
852
|
+
) -> "Iterator[dict[str, Any]]":
|
|
682
853
|
"""
|
|
683
854
|
List archive contents.
|
|
684
855
|
|
|
@@ -13,12 +13,16 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from json import dumps
|
|
16
|
+
from typing import TYPE_CHECKING, Any, Literal, Optional
|
|
16
17
|
|
|
17
18
|
from requests.status_codes import codes
|
|
18
19
|
|
|
19
20
|
from rucio.client.baseclient import BaseClient, choice
|
|
20
21
|
from rucio.common.utils import build_url
|
|
21
22
|
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from collections.abc import Iterable, Mapping
|
|
25
|
+
|
|
22
26
|
|
|
23
27
|
class DiracClient(BaseClient):
|
|
24
28
|
|
|
@@ -26,7 +30,12 @@ class DiracClient(BaseClient):
|
|
|
26
30
|
|
|
27
31
|
DIRAC_BASEURL = 'dirac'
|
|
28
32
|
|
|
29
|
-
def add_files(
|
|
33
|
+
def add_files(
|
|
34
|
+
self,
|
|
35
|
+
lfns: "Iterable[Mapping[str, Any]]",
|
|
36
|
+
ignore_availability: bool = False,
|
|
37
|
+
parents_metadata: Optional["Mapping[str, Mapping[str, Any]]"] = None
|
|
38
|
+
) -> Literal[True]:
|
|
30
39
|
"""
|
|
31
40
|
Bulk add files :
|
|
32
41
|
- Create the file and replica.
|
|
@@ -128,13 +128,19 @@ class DownloadClient:
|
|
|
128
128
|
:param logger: Optional: logging.Logger object. If None, default logger will be used.
|
|
129
129
|
"""
|
|
130
130
|
self.check_pcache = check_pcache
|
|
131
|
-
if
|
|
131
|
+
if logger is None:
|
|
132
132
|
self.logger = logging.log
|
|
133
133
|
else:
|
|
134
|
-
|
|
134
|
+
if hasattr(logger, "debug"):
|
|
135
|
+
self.logger = logger.log
|
|
136
|
+
else:
|
|
137
|
+
self.logger = logger
|
|
138
|
+
|
|
135
139
|
self.tracing = tracing
|
|
140
|
+
|
|
136
141
|
if not self.tracing:
|
|
137
|
-
logger(logging.DEBUG, 'Tracing is turned off.')
|
|
142
|
+
self.logger(logging.DEBUG, 'Tracing is turned off.')
|
|
143
|
+
|
|
138
144
|
self.is_human_readable = True
|
|
139
145
|
self.client = client if client else Client()
|
|
140
146
|
# if token should be used, use only JWT tokens
|
|
@@ -152,7 +158,7 @@ class DownloadClient:
|
|
|
152
158
|
break
|
|
153
159
|
if self.is_admin:
|
|
154
160
|
self.is_tape_excluded = False
|
|
155
|
-
logger(logging.DEBUG, 'Admin mode enabled')
|
|
161
|
+
self.logger(logging.DEBUG, 'Admin mode enabled')
|
|
156
162
|
|
|
157
163
|
self.trace_tpl = {}
|
|
158
164
|
self.trace_tpl['hostname'] = self.client_location['fqdn']
|