rucio-clients 34.4.1__tar.gz → 34.4.3__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.1 → rucio_clients-34.4.3}/PKG-INFO +1 -1
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/accountclient.py +43 -21
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/accountlimitclient.py +36 -6
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/baseclient.py +18 -9
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/configclient.py +18 -3
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/credentialclient.py +8 -1
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/downloadclient.py +1 -1
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/lifetimeclient.py +20 -2
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/requestclient.py +34 -16
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/scopeclient.py +7 -3
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/touchclient.py +7 -1
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/uploadclient.py +3 -2
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/pcache.py +114 -91
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/types.py +61 -15
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/utils.py +140 -95
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/vcsversion.py +3 -3
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/pyproject.toml +1 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_transfer_plugins.py +22 -4
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/AUTHORS.rst +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/ChangeLog +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/LICENSE +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/MANIFEST.in +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/README.rst +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/bin/rucio +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/bin/rucio-admin +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/etc/rse-accounts.cfg.template +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/etc/rucio.cfg.atlas.client.template +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/etc/rucio.cfg.template +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/__init__.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/alembicrevision.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/__init__.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/client.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/didclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/diracclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/exportclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/fileclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/importclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/lockclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/metaconventionsclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/pingclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/replicaclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/rseclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/ruleclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/client/subscriptionclient.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/__init__.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/cache.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/config.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/constants.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/constraints.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/didtype.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/exception.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/extra.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/logging.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/plugins.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/policy.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/schema/__init__.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/schema/atlas.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/schema/belleii.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/schema/domatpc.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/schema/escape.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/schema/generic.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/schema/generic_multi_vo.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/schema/icecube.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/stomp_utils.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/stopwatch.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/common/test_rucio_server.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/__init__.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/__init__.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/bittorrent.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/cache.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/dummy.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/gfal.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/globus.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/gsiftp.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/http_cache.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/mock.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/ngarc.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/posix.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/protocol.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/rclone.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/rfio.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/srm.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/ssh.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/storm.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/webdav.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/protocols/xrootd.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/rse/rsemanager.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio/version.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/lib/rucio_clients.egg-info/SOURCES.txt +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/pylintrc +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/requirements.txt +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/setup.cfg +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/setup.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/setuputil.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_abacus_account.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_abacus_collection_replica.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_abacus_rse.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_account.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_account_limits.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_api_external_representation.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_archive.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_auditor.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_auditor_hdfs.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_auditor_srmdumps.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_authentication.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_automatix.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_bad_replica.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_bb8.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_belleii.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_bin_rucio.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_boolean.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_clients.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_common_types.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_config.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_conveyor.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_conveyor_submitter.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_counter.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_credential.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_curl.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_daemons.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_dataset_replicas.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_db.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_did.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_did_meta_plugins.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_didtype.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_download.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_dumper.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_dumper_consistency.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_dumper_data_model.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_dumper_path_parsing.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_filter_engine.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_heartbeat.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_hermes.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_identity.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_impl_upload_download.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_import_export.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_judge_cleaner.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_judge_evaluator.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_judge_injector.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_judge_repairer.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_lifetime.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_message.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_meta_conventions.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_meta_did.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_module_import.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_monitor.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_multi_vo.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_naming_convention.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_oauthmanager.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_oidc.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_permission.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_pfns.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_ping.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_preparer.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_qos.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_quarantined_replica.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_reaper.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_redirect.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_replica.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_replica_recoverer.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_replica_sorting.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_request.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_root_proxy.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_expression_parser.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_lfn2path.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_protocol_gfal2.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_protocol_gfal2_impl.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_protocol_posix.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_protocol_rclone.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_protocol_rsync.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_protocol_srm.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_protocol_ssh.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_protocol_webdav.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_protocol_xrootd.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rse_selector.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rucio_server.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_rule.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_scope.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_subscription.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_throttler.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_tpc.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_trace.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_transfer.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_undertaker.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_upload.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tests/test_utils.py +0 -0
- {rucio_clients-34.4.1 → rucio_clients-34.4.3}/tools/merge_rucio_configs.py +0 -0
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from json import dumps
|
|
16
|
+
from typing import TYPE_CHECKING, Any, Optional
|
|
16
17
|
from urllib.parse import quote_plus
|
|
17
18
|
|
|
18
19
|
from requests.status_codes import codes
|
|
@@ -20,6 +21,9 @@ from requests.status_codes import codes
|
|
|
20
21
|
from rucio.client.baseclient import BaseClient, choice
|
|
21
22
|
from rucio.common.utils import build_url
|
|
22
23
|
|
|
24
|
+
if TYPE_CHECKING:
|
|
25
|
+
from collections.abc import Iterator
|
|
26
|
+
|
|
23
27
|
|
|
24
28
|
class AccountClient(BaseClient):
|
|
25
29
|
|
|
@@ -27,7 +31,7 @@ class AccountClient(BaseClient):
|
|
|
27
31
|
|
|
28
32
|
ACCOUNTS_BASEURL = 'accounts'
|
|
29
33
|
|
|
30
|
-
def add_account(self, account, type_, email):
|
|
34
|
+
def add_account(self, account: str, type_: str, email: str) -> bool:
|
|
31
35
|
"""
|
|
32
36
|
Sends the request to create a new account.
|
|
33
37
|
|
|
@@ -49,7 +53,7 @@ class AccountClient(BaseClient):
|
|
|
49
53
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
50
54
|
raise exc_cls(exc_msg)
|
|
51
55
|
|
|
52
|
-
def delete_account(self, account):
|
|
56
|
+
def delete_account(self, account: str) -> bool:
|
|
53
57
|
"""
|
|
54
58
|
Sends the request to disable an account.
|
|
55
59
|
|
|
@@ -68,7 +72,7 @@ class AccountClient(BaseClient):
|
|
|
68
72
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
69
73
|
raise exc_cls(exc_msg)
|
|
70
74
|
|
|
71
|
-
def get_account(self, account):
|
|
75
|
+
def get_account(self, account: str) -> Optional[dict[str, Any]]:
|
|
72
76
|
"""
|
|
73
77
|
Sends the request to get information about a given account.
|
|
74
78
|
|
|
@@ -87,7 +91,7 @@ class AccountClient(BaseClient):
|
|
|
87
91
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
88
92
|
raise exc_cls(exc_msg)
|
|
89
93
|
|
|
90
|
-
def update_account(self, account, key, value):
|
|
94
|
+
def update_account(self, account: str, key: str, value: Any) -> bool:
|
|
91
95
|
""" Update a property of an account.
|
|
92
96
|
|
|
93
97
|
:param account: Name of the account.
|
|
@@ -106,7 +110,12 @@ class AccountClient(BaseClient):
|
|
|
106
110
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
107
111
|
raise exc_cls(exc_msg)
|
|
108
112
|
|
|
109
|
-
def list_accounts(
|
|
113
|
+
def list_accounts(
|
|
114
|
+
self,
|
|
115
|
+
account_type: Optional[str] = None,
|
|
116
|
+
identity: Optional[str] = None,
|
|
117
|
+
filters: Optional[dict[str, Any]] = None
|
|
118
|
+
) -> "Iterator[dict[str, Any]]":
|
|
110
119
|
"""
|
|
111
120
|
Sends the request to list all rucio accounts.
|
|
112
121
|
|
|
@@ -137,7 +146,7 @@ class AccountClient(BaseClient):
|
|
|
137
146
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
138
147
|
raise exc_cls(exc_msg)
|
|
139
148
|
|
|
140
|
-
def whoami(self):
|
|
149
|
+
def whoami(self) -> Optional[dict[str, Any]]:
|
|
141
150
|
"""
|
|
142
151
|
Get information about account whose token is used
|
|
143
152
|
|
|
@@ -146,7 +155,15 @@ class AccountClient(BaseClient):
|
|
|
146
155
|
"""
|
|
147
156
|
return self.get_account('whoami')
|
|
148
157
|
|
|
149
|
-
def add_identity(
|
|
158
|
+
def add_identity(
|
|
159
|
+
self,
|
|
160
|
+
account: str,
|
|
161
|
+
identity: str,
|
|
162
|
+
authtype: str,
|
|
163
|
+
email: str,
|
|
164
|
+
default: bool = False,
|
|
165
|
+
password: Optional[str] = None
|
|
166
|
+
) -> bool:
|
|
150
167
|
"""
|
|
151
168
|
Adds a membership association between identity and account.
|
|
152
169
|
|
|
@@ -171,7 +188,12 @@ class AccountClient(BaseClient):
|
|
|
171
188
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
172
189
|
raise exc_cls(exc_msg)
|
|
173
190
|
|
|
174
|
-
def del_identity(
|
|
191
|
+
def del_identity(
|
|
192
|
+
self,
|
|
193
|
+
account: str,
|
|
194
|
+
identity: str,
|
|
195
|
+
authtype: str
|
|
196
|
+
) -> bool:
|
|
175
197
|
"""
|
|
176
198
|
Delete an identity's membership association with an account.
|
|
177
199
|
|
|
@@ -194,7 +216,7 @@ class AccountClient(BaseClient):
|
|
|
194
216
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
195
217
|
raise exc_cls(exc_msg)
|
|
196
218
|
|
|
197
|
-
def list_identities(self, account):
|
|
219
|
+
def list_identities(self, account: str) -> "Iterator[dict[str, Any]]":
|
|
198
220
|
"""
|
|
199
221
|
List all identities on an account.
|
|
200
222
|
|
|
@@ -210,7 +232,7 @@ class AccountClient(BaseClient):
|
|
|
210
232
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
211
233
|
raise exc_cls(exc_msg)
|
|
212
234
|
|
|
213
|
-
def list_account_rules(self, account):
|
|
235
|
+
def list_account_rules(self, account: str) -> "Iterator[dict[str, Any]]":
|
|
214
236
|
"""
|
|
215
237
|
List the associated rules of an account.
|
|
216
238
|
|
|
@@ -226,7 +248,7 @@ class AccountClient(BaseClient):
|
|
|
226
248
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
227
249
|
raise exc_cls(exc_msg)
|
|
228
250
|
|
|
229
|
-
def get_account_limits(self, account, rse_expression, locality):
|
|
251
|
+
def get_account_limits(self, account: str, rse_expression: str, locality: str) -> dict[str, Any]:
|
|
230
252
|
"""
|
|
231
253
|
Return the correct account limits for the given locality.
|
|
232
254
|
|
|
@@ -243,7 +265,7 @@ class AccountClient(BaseClient):
|
|
|
243
265
|
from rucio.common.exception import UnsupportedOperation
|
|
244
266
|
raise UnsupportedOperation('The provided locality (%s) for the account limit was invalid' % locality)
|
|
245
267
|
|
|
246
|
-
def get_global_account_limit(self, account, rse_expression):
|
|
268
|
+
def get_global_account_limit(self, account: str, rse_expression: str) -> dict[str, Any]:
|
|
247
269
|
"""
|
|
248
270
|
List the account limit for the specific RSE expression.
|
|
249
271
|
|
|
@@ -259,7 +281,7 @@ class AccountClient(BaseClient):
|
|
|
259
281
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
260
282
|
raise exc_cls(exc_msg)
|
|
261
283
|
|
|
262
|
-
def get_global_account_limits(self, account):
|
|
284
|
+
def get_global_account_limits(self, account: str) -> dict[str, Any]:
|
|
263
285
|
"""
|
|
264
286
|
List all RSE expression limits of this account.
|
|
265
287
|
|
|
@@ -274,7 +296,7 @@ class AccountClient(BaseClient):
|
|
|
274
296
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
275
297
|
raise exc_cls(exc_msg)
|
|
276
298
|
|
|
277
|
-
def get_local_account_limits(self, account):
|
|
299
|
+
def get_local_account_limits(self, account: str) -> dict[str, Any]:
|
|
278
300
|
"""
|
|
279
301
|
List the account rse limits of this account.
|
|
280
302
|
|
|
@@ -289,7 +311,7 @@ class AccountClient(BaseClient):
|
|
|
289
311
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
290
312
|
raise exc_cls(exc_msg)
|
|
291
313
|
|
|
292
|
-
def get_local_account_limit(self, account, rse):
|
|
314
|
+
def get_local_account_limit(self, account: str, rse: str) -> dict[str, Any]:
|
|
293
315
|
"""
|
|
294
316
|
List the account rse limits of this account for the specific rse.
|
|
295
317
|
|
|
@@ -305,7 +327,7 @@ class AccountClient(BaseClient):
|
|
|
305
327
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
306
328
|
raise exc_cls(exc_msg)
|
|
307
329
|
|
|
308
|
-
def get_local_account_usage(self, account, rse=None):
|
|
330
|
+
def get_local_account_usage(self, account: str, rse: Optional[str] = None) -> "Iterator[dict[str, Any]]":
|
|
309
331
|
"""
|
|
310
332
|
List the account usage for one or all rses of this account.
|
|
311
333
|
|
|
@@ -324,7 +346,7 @@ class AccountClient(BaseClient):
|
|
|
324
346
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
325
347
|
raise exc_cls(exc_msg)
|
|
326
348
|
|
|
327
|
-
def get_global_account_usage(self, account, rse_expression=None):
|
|
349
|
+
def get_global_account_usage(self, account: str, rse_expression: Optional[str] = None) -> "Iterator[dict[str, Any]]":
|
|
328
350
|
"""
|
|
329
351
|
List the account usage for one or all RSE expressions of this account.
|
|
330
352
|
|
|
@@ -343,7 +365,7 @@ class AccountClient(BaseClient):
|
|
|
343
365
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
344
366
|
raise exc_cls(exc_msg)
|
|
345
367
|
|
|
346
|
-
def get_account_usage_history(self, account, rse):
|
|
368
|
+
def get_account_usage_history(self, account: str, rse: str) -> dict[str, Any]:
|
|
347
369
|
"""
|
|
348
370
|
List the account usage history of this account on rse.
|
|
349
371
|
|
|
@@ -359,7 +381,7 @@ class AccountClient(BaseClient):
|
|
|
359
381
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
360
382
|
raise exc_cls(exc_msg)
|
|
361
383
|
|
|
362
|
-
def list_account_attributes(self, account):
|
|
384
|
+
def list_account_attributes(self, account: str) -> "Iterator[dict[dict[str, Any], Any]]":
|
|
363
385
|
"""
|
|
364
386
|
List the attributes for an account.
|
|
365
387
|
|
|
@@ -374,7 +396,7 @@ class AccountClient(BaseClient):
|
|
|
374
396
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
375
397
|
raise exc_cls(exc_msg)
|
|
376
398
|
|
|
377
|
-
def add_account_attribute(self, account, key, value):
|
|
399
|
+
def add_account_attribute(self, account: str, key: str, value: Any) -> bool:
|
|
378
400
|
"""
|
|
379
401
|
Adds an attribute to an account.
|
|
380
402
|
|
|
@@ -393,7 +415,7 @@ class AccountClient(BaseClient):
|
|
|
393
415
|
exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
|
|
394
416
|
raise exc_cls(exc_msg)
|
|
395
417
|
|
|
396
|
-
def delete_account_attribute(self, account, key):
|
|
418
|
+
def delete_account_attribute(self, account: str, key: str) -> bool:
|
|
397
419
|
"""
|
|
398
420
|
Delete an attribute for an account.
|
|
399
421
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from json import dumps
|
|
16
|
+
from typing import Literal
|
|
16
17
|
from urllib.parse import quote_plus
|
|
17
18
|
|
|
18
19
|
from requests.status_codes import codes
|
|
@@ -27,7 +28,13 @@ class AccountLimitClient(BaseClient):
|
|
|
27
28
|
|
|
28
29
|
ACCOUNTLIMIT_BASEURL = 'accountlimits'
|
|
29
30
|
|
|
30
|
-
def set_account_limit(
|
|
31
|
+
def set_account_limit(
|
|
32
|
+
self,
|
|
33
|
+
account: str,
|
|
34
|
+
rse: str,
|
|
35
|
+
bytes_: int,
|
|
36
|
+
locality: Literal['local', 'global']
|
|
37
|
+
) -> bool:
|
|
31
38
|
"""
|
|
32
39
|
Sets an account limit for a given limit scope.
|
|
33
40
|
|
|
@@ -46,7 +53,12 @@ class AccountLimitClient(BaseClient):
|
|
|
46
53
|
from rucio.common.exception import UnsupportedOperation
|
|
47
54
|
raise UnsupportedOperation('The provided scope (%s) for the account limit was invalid' % locality)
|
|
48
55
|
|
|
49
|
-
def delete_account_limit(
|
|
56
|
+
def delete_account_limit(
|
|
57
|
+
self,
|
|
58
|
+
account: str,
|
|
59
|
+
rse: str,
|
|
60
|
+
locality: Literal['local', 'global']
|
|
61
|
+
) -> bool:
|
|
50
62
|
"""
|
|
51
63
|
Deletes an account limit for a given limit scope.
|
|
52
64
|
|
|
@@ -64,7 +76,12 @@ class AccountLimitClient(BaseClient):
|
|
|
64
76
|
from rucio.common.exception import UnsupportedOperation
|
|
65
77
|
raise UnsupportedOperation('The provided scope (%s) for the account limit was invalid' % locality)
|
|
66
78
|
|
|
67
|
-
def set_local_account_limit(
|
|
79
|
+
def set_local_account_limit(
|
|
80
|
+
self,
|
|
81
|
+
account: str,
|
|
82
|
+
rse: str,
|
|
83
|
+
bytes_: int
|
|
84
|
+
) -> bool:
|
|
68
85
|
"""
|
|
69
86
|
Sends the request to set an account limit for an account.
|
|
70
87
|
|
|
@@ -86,7 +103,11 @@ class AccountLimitClient(BaseClient):
|
|
|
86
103
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
87
104
|
raise exc_cls(exc_msg)
|
|
88
105
|
|
|
89
|
-
def delete_local_account_limit(
|
|
106
|
+
def delete_local_account_limit(
|
|
107
|
+
self,
|
|
108
|
+
account: str,
|
|
109
|
+
rse: str
|
|
110
|
+
) -> bool:
|
|
90
111
|
"""
|
|
91
112
|
Sends the request to remove an account limit.
|
|
92
113
|
|
|
@@ -108,7 +129,12 @@ class AccountLimitClient(BaseClient):
|
|
|
108
129
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
109
130
|
raise exc_cls(exc_msg)
|
|
110
131
|
|
|
111
|
-
def set_global_account_limit(
|
|
132
|
+
def set_global_account_limit(
|
|
133
|
+
self,
|
|
134
|
+
account: str,
|
|
135
|
+
rse_expression: str,
|
|
136
|
+
bytes_: int
|
|
137
|
+
) -> bool:
|
|
112
138
|
"""
|
|
113
139
|
Sends the request to set a global account limit for an account.
|
|
114
140
|
|
|
@@ -130,7 +156,11 @@ class AccountLimitClient(BaseClient):
|
|
|
130
156
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
131
157
|
raise exc_cls(exc_msg)
|
|
132
158
|
|
|
133
|
-
def delete_global_account_limit(
|
|
159
|
+
def delete_global_account_limit(
|
|
160
|
+
self,
|
|
161
|
+
account: str,
|
|
162
|
+
rse_expression: str
|
|
163
|
+
) -> bool:
|
|
134
164
|
"""
|
|
135
165
|
Sends the request to remove a global account limit.
|
|
136
166
|
|
|
@@ -107,8 +107,6 @@ class BaseClient:
|
|
|
107
107
|
:param logger: Logger object to use. If None, use the default LOG created by the module
|
|
108
108
|
"""
|
|
109
109
|
|
|
110
|
-
self.host = rucio_host
|
|
111
|
-
self.auth_host = auth_host
|
|
112
110
|
self.logger = logger
|
|
113
111
|
self.session = Session()
|
|
114
112
|
self.user_agent = "%s/%s" % (user_agent, version.version_string()) # e.g. "rucio-clients/0.2.13"
|
|
@@ -117,9 +115,17 @@ class BaseClient:
|
|
|
117
115
|
if self.script_id == '': # Python interpreter used
|
|
118
116
|
self.script_id = 'python'
|
|
119
117
|
try:
|
|
120
|
-
if
|
|
118
|
+
if rucio_host is not None:
|
|
119
|
+
self.host = rucio_host
|
|
120
|
+
else:
|
|
121
121
|
self.host = config_get('client', 'rucio_host')
|
|
122
|
-
|
|
122
|
+
except (NoOptionError, NoSectionError) as error:
|
|
123
|
+
raise MissingClientParameter('Section client and Option \'%s\' cannot be found in config file' % error.args[0])
|
|
124
|
+
|
|
125
|
+
try:
|
|
126
|
+
if auth_host is not None:
|
|
127
|
+
self.auth_host = auth_host
|
|
128
|
+
else:
|
|
123
129
|
self.auth_host = config_get('client', 'auth_host')
|
|
124
130
|
except (NoOptionError, NoSectionError) as error:
|
|
125
131
|
raise MissingClientParameter('Section client and Option \'%s\' cannot be found in config file' % error.args[0])
|
|
@@ -318,9 +324,12 @@ class BaseClient:
|
|
|
318
324
|
|
|
319
325
|
:return: A rucio exception class and an error string.
|
|
320
326
|
"""
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
327
|
+
if data is not None:
|
|
328
|
+
try:
|
|
329
|
+
data = parse_response(data)
|
|
330
|
+
except ValueError:
|
|
331
|
+
data = {}
|
|
332
|
+
else:
|
|
324
333
|
data = {}
|
|
325
334
|
|
|
326
335
|
exc_cls = 'RucioException'
|
|
@@ -879,8 +888,8 @@ class BaseClient:
|
|
|
879
888
|
return False
|
|
880
889
|
|
|
881
890
|
try:
|
|
882
|
-
|
|
883
|
-
|
|
891
|
+
with open(self.token_file, 'r') as token_file_handler:
|
|
892
|
+
self.auth_token = token_file_handler.readline()
|
|
884
893
|
self.headers['X-Rucio-Auth-Token'] = self.auth_token
|
|
885
894
|
except OSError as error:
|
|
886
895
|
print("I/O error({0}): {1}".format(error.errno, error.strerror))
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from json import dumps
|
|
16
|
+
from typing import Any, Optional
|
|
16
17
|
|
|
17
18
|
from requests.status_codes import codes
|
|
18
19
|
|
|
@@ -26,7 +27,11 @@ class ConfigClient(BaseClient):
|
|
|
26
27
|
|
|
27
28
|
CONFIG_BASEURL = 'config'
|
|
28
29
|
|
|
29
|
-
def get_config(
|
|
30
|
+
def get_config(
|
|
31
|
+
self,
|
|
32
|
+
section: Optional[str] = None,
|
|
33
|
+
option: Optional[str] = None
|
|
34
|
+
) -> dict[str, Any]:
|
|
30
35
|
"""
|
|
31
36
|
Sends the request to get the matching configuration.
|
|
32
37
|
|
|
@@ -53,7 +58,13 @@ class ConfigClient(BaseClient):
|
|
|
53
58
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
54
59
|
raise exc_cls(exc_msg)
|
|
55
60
|
|
|
56
|
-
def set_config_option(
|
|
61
|
+
def set_config_option(
|
|
62
|
+
self,
|
|
63
|
+
section: str,
|
|
64
|
+
option: str,
|
|
65
|
+
value: Any,
|
|
66
|
+
use_body_for_params: bool = True
|
|
67
|
+
) -> bool:
|
|
57
68
|
"""
|
|
58
69
|
Sends the request to create or set an option within a section. Missing sections will be created.
|
|
59
70
|
|
|
@@ -90,7 +101,11 @@ class ConfigClient(BaseClient):
|
|
|
90
101
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
91
102
|
raise exc_cls(exc_msg)
|
|
92
103
|
|
|
93
|
-
def delete_config_option(
|
|
104
|
+
def delete_config_option(
|
|
105
|
+
self,
|
|
106
|
+
section: str,
|
|
107
|
+
option: str
|
|
108
|
+
) -> bool:
|
|
94
109
|
"""
|
|
95
110
|
Sends the request to remove an option from a section
|
|
96
111
|
|
|
@@ -23,7 +23,14 @@ class CredentialClient(BaseClient):
|
|
|
23
23
|
|
|
24
24
|
CREDENTIAL_BASEURL = 'credentials'
|
|
25
25
|
|
|
26
|
-
def get_signed_url(
|
|
26
|
+
def get_signed_url(
|
|
27
|
+
self,
|
|
28
|
+
rse: str,
|
|
29
|
+
service: str,
|
|
30
|
+
operation: str,
|
|
31
|
+
url: str,
|
|
32
|
+
lifetime: int = 3600
|
|
33
|
+
) -> str:
|
|
27
34
|
"""
|
|
28
35
|
Return a signed version of the given URL for the given operation.
|
|
29
36
|
|
|
@@ -1231,7 +1231,7 @@ class DownloadClient:
|
|
|
1231
1231
|
resolve_parents=True,
|
|
1232
1232
|
nrandom=nrandom,
|
|
1233
1233
|
metalink=True)
|
|
1234
|
-
file_items = parse_replicas_from_string(metalink_str)
|
|
1234
|
+
file_items = parse_replicas_from_string(metalink_str) # type: ignore
|
|
1235
1235
|
for file in file_items:
|
|
1236
1236
|
if impl:
|
|
1237
1237
|
file['impl'] = impl
|
|
@@ -13,12 +13,19 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from json import loads
|
|
16
|
+
from typing import TYPE_CHECKING, Any, 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, render_json
|
|
21
22
|
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from collections.abc import Iterator, Sequence
|
|
25
|
+
from datetime import datetime
|
|
26
|
+
|
|
27
|
+
from rucio.db.sqla.constants import LifetimeExceptionsState
|
|
28
|
+
|
|
22
29
|
|
|
23
30
|
class LifetimeClient(BaseClient):
|
|
24
31
|
|
|
@@ -26,7 +33,11 @@ class LifetimeClient(BaseClient):
|
|
|
26
33
|
|
|
27
34
|
LIFETIME_BASEURL = 'lifetime_exceptions'
|
|
28
35
|
|
|
29
|
-
def list_exceptions(
|
|
36
|
+
def list_exceptions(
|
|
37
|
+
self,
|
|
38
|
+
exception_id: Optional[str] = None,
|
|
39
|
+
states: Optional['Sequence[LifetimeExceptionsState]'] = None
|
|
40
|
+
) -> 'Iterator[dict[str, Any]]':
|
|
30
41
|
"""
|
|
31
42
|
List exceptions to Lifetime Model.
|
|
32
43
|
|
|
@@ -50,7 +61,14 @@ class LifetimeClient(BaseClient):
|
|
|
50
61
|
exc_cls, exc_msg = self._get_exception(headers=result.headers, status_code=result.status_code)
|
|
51
62
|
raise exc_cls(exc_msg)
|
|
52
63
|
|
|
53
|
-
def add_exception(
|
|
64
|
+
def add_exception(
|
|
65
|
+
self,
|
|
66
|
+
dids: list[dict[str, Any]],
|
|
67
|
+
account: str,
|
|
68
|
+
pattern: str,
|
|
69
|
+
comments: str,
|
|
70
|
+
expires_at: 'datetime'
|
|
71
|
+
) -> dict[str, Any]:
|
|
54
72
|
"""
|
|
55
73
|
Add exceptions to Lifetime Model.
|
|
56
74
|
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
from typing import TYPE_CHECKING, Any, Optional
|
|
15
16
|
from urllib.parse import quote_plus
|
|
16
17
|
|
|
17
18
|
from requests.status_codes import codes
|
|
@@ -19,16 +20,23 @@ from requests.status_codes import codes
|
|
|
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 Iterator, Sequence
|
|
25
|
+
|
|
22
26
|
|
|
23
27
|
class RequestClient(BaseClient):
|
|
24
28
|
|
|
25
29
|
REQUEST_BASEURL = 'requests'
|
|
26
30
|
|
|
27
|
-
def list_requests(
|
|
31
|
+
def list_requests(
|
|
32
|
+
self,
|
|
33
|
+
src_rse: str,
|
|
34
|
+
dst_rse: str,
|
|
35
|
+
request_states: 'Sequence[str]'
|
|
36
|
+
) -> 'Iterator[dict[str, Any]]':
|
|
28
37
|
"""Return latest request details
|
|
29
38
|
|
|
30
39
|
:return: request information
|
|
31
|
-
:rtype: dict
|
|
32
40
|
"""
|
|
33
41
|
path = '/'.join([self.REQUEST_BASEURL, 'list']) + '?' + '&'.join(['src_rse={}'.format(src_rse), 'dst_rse={}'.format(
|
|
34
42
|
dst_rse), 'request_states={}'.format(request_states)])
|
|
@@ -41,11 +49,17 @@ class RequestClient(BaseClient):
|
|
|
41
49
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
42
50
|
raise exc_cls(exc_msg)
|
|
43
51
|
|
|
44
|
-
def list_requests_history(
|
|
52
|
+
def list_requests_history(
|
|
53
|
+
self,
|
|
54
|
+
src_rse: str,
|
|
55
|
+
dst_rse: str,
|
|
56
|
+
request_states: 'Sequence[str]',
|
|
57
|
+
offset: int = 0,
|
|
58
|
+
limit: int = 100
|
|
59
|
+
) -> 'Iterator[dict[str, Any]]':
|
|
45
60
|
"""Return historical request details
|
|
46
61
|
|
|
47
62
|
:return: request information
|
|
48
|
-
:rtype: dict
|
|
49
63
|
"""
|
|
50
64
|
path = '/'.join([self.REQUEST_BASEURL, 'history', 'list']) + '?' + '&'.join(['src_rse={}'.format(src_rse), 'dst_rse={}'.format(
|
|
51
65
|
dst_rse), 'request_states={}'.format(request_states), 'offset={}'.format(offset), 'limit={}'.format(limit)])
|
|
@@ -58,21 +72,23 @@ class RequestClient(BaseClient):
|
|
|
58
72
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
59
73
|
raise exc_cls(exc_msg)
|
|
60
74
|
|
|
61
|
-
def list_request_by_did(
|
|
75
|
+
def list_request_by_did(
|
|
76
|
+
self,
|
|
77
|
+
name: str,
|
|
78
|
+
rse: str,
|
|
79
|
+
scope: Optional[str] = None
|
|
80
|
+
) -> 'Iterator[dict[str, Any]]':
|
|
62
81
|
"""Return latest request details for a DID
|
|
63
82
|
|
|
64
83
|
:param name: DID
|
|
65
|
-
:type name: str
|
|
66
84
|
:param rse: Destination RSE name
|
|
67
|
-
:type rse: str
|
|
68
85
|
:param scope: rucio scope, defaults to None
|
|
69
|
-
:param scope: str, optional
|
|
70
86
|
:raises exc_cls: from BaseClient._get_exception
|
|
71
87
|
:return: request information
|
|
72
|
-
:rtype: dict
|
|
73
88
|
"""
|
|
74
89
|
|
|
75
|
-
|
|
90
|
+
if scope is not None:
|
|
91
|
+
path = '/'.join([self.REQUEST_BASEURL, quote_plus(scope), quote_plus(name), rse])
|
|
76
92
|
url = build_url(choice(self.list_hosts), path=path)
|
|
77
93
|
r = self._send_request(url, type_='GET')
|
|
78
94
|
|
|
@@ -82,21 +98,23 @@ class RequestClient(BaseClient):
|
|
|
82
98
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
83
99
|
raise exc_cls(exc_msg)
|
|
84
100
|
|
|
85
|
-
def list_request_history_by_did(
|
|
101
|
+
def list_request_history_by_did(
|
|
102
|
+
self,
|
|
103
|
+
name: str,
|
|
104
|
+
rse: str,
|
|
105
|
+
scope: Optional[str] = None
|
|
106
|
+
) -> 'Iterator[dict[str, Any]]':
|
|
86
107
|
"""Return latest request details for a DID
|
|
87
108
|
|
|
88
109
|
:param name: DID
|
|
89
|
-
:type name: str
|
|
90
110
|
:param rse: Destination RSE name
|
|
91
|
-
:type rse: str
|
|
92
111
|
:param scope: rucio scope, defaults to None
|
|
93
|
-
:param scope: str, optional
|
|
94
112
|
:raises exc_cls: from BaseClient._get_exception
|
|
95
113
|
:return: request information
|
|
96
|
-
:rtype: dict
|
|
97
114
|
"""
|
|
98
115
|
|
|
99
|
-
|
|
116
|
+
if scope is not None:
|
|
117
|
+
path = '/'.join([self.REQUEST_BASEURL, 'history', quote_plus(scope), quote_plus(name), rse])
|
|
100
118
|
url = build_url(choice(self.list_hosts), path=path)
|
|
101
119
|
r = self._send_request(url, type_='GET')
|
|
102
120
|
|
|
@@ -27,7 +27,11 @@ class ScopeClient(BaseClient):
|
|
|
27
27
|
|
|
28
28
|
SCOPE_BASEURL = 'accounts'
|
|
29
29
|
|
|
30
|
-
def add_scope(
|
|
30
|
+
def add_scope(
|
|
31
|
+
self,
|
|
32
|
+
account: str,
|
|
33
|
+
scope: str
|
|
34
|
+
) -> bool:
|
|
31
35
|
"""
|
|
32
36
|
Sends the request to add a new scope.
|
|
33
37
|
|
|
@@ -47,7 +51,7 @@ class ScopeClient(BaseClient):
|
|
|
47
51
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
48
52
|
raise exc_cls(exc_msg)
|
|
49
53
|
|
|
50
|
-
def list_scopes(self):
|
|
54
|
+
def list_scopes(self) -> list[str]:
|
|
51
55
|
"""
|
|
52
56
|
Sends the request to list all scopes.
|
|
53
57
|
|
|
@@ -64,7 +68,7 @@ class ScopeClient(BaseClient):
|
|
|
64
68
|
exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
|
|
65
69
|
raise exc_cls(exc_msg)
|
|
66
70
|
|
|
67
|
-
def list_scopes_for_account(self, account):
|
|
71
|
+
def list_scopes_for_account(self, account: str) -> list[str]:
|
|
68
72
|
"""
|
|
69
73
|
Sends the request to list all scopes for a rucio account.
|
|
70
74
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from json import dumps
|
|
16
|
+
from typing import Optional
|
|
16
17
|
|
|
17
18
|
from requests import post
|
|
18
19
|
|
|
@@ -30,7 +31,12 @@ class TouchClient(BaseClient):
|
|
|
30
31
|
DIDS_BASEURL = 'dids'
|
|
31
32
|
TRACES_BASEURL = 'traces'
|
|
32
33
|
|
|
33
|
-
def touch(
|
|
34
|
+
def touch(
|
|
35
|
+
self,
|
|
36
|
+
scope: str,
|
|
37
|
+
name: str,
|
|
38
|
+
rse: Optional[str] = None
|
|
39
|
+
) -> None:
|
|
34
40
|
"""
|
|
35
41
|
Sends a touch trace for a given file or dataset.
|
|
36
42
|
|
|
@@ -629,8 +629,9 @@ class UploadClient:
|
|
|
629
629
|
# Auth. mostly for object stores
|
|
630
630
|
if sign_service:
|
|
631
631
|
protocol_read = self._create_protocol(rse_settings, 'read', domain=domain, impl=impl)
|
|
632
|
-
|
|
633
|
-
|
|
632
|
+
if pfn is not None:
|
|
633
|
+
signed_read_pfn = self.client.get_signed_url(rse_settings['rse'], sign_service, 'read', pfn)
|
|
634
|
+
pfn = self.client.get_signed_url(rse_settings['rse'], sign_service, 'write', pfn)
|
|
634
635
|
|
|
635
636
|
# Create a name of tmp file if renaming operation is supported
|
|
636
637
|
pfn_tmp = '%s.rucio.upload' % pfn if protocol_write.renaming else pfn
|