rucio 35.7.0__py3-none-any.whl → 37.0.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/alembicrevision.py +1 -1
- rucio/{daemons/c3po/collectors → cli}/__init__.py +1 -0
- rucio/cli/account.py +216 -0
- rucio-35.7.0.data/scripts/rucio → rucio/cli/bin_legacy/rucio.py +769 -486
- rucio-35.7.0.data/scripts/rucio-admin → rucio/cli/bin_legacy/rucio_admin.py +476 -423
- rucio/cli/command.py +272 -0
- rucio/cli/config.py +72 -0
- rucio/cli/did.py +191 -0
- rucio/cli/download.py +128 -0
- rucio/cli/lifetime_exception.py +33 -0
- rucio/cli/replica.py +162 -0
- rucio/cli/rse.py +293 -0
- rucio/cli/rule.py +158 -0
- rucio/cli/scope.py +40 -0
- rucio/cli/subscription.py +73 -0
- rucio/cli/upload.py +60 -0
- rucio/cli/utils.py +226 -0
- rucio/client/accountclient.py +0 -1
- rucio/client/baseclient.py +33 -24
- rucio/client/client.py +45 -1
- rucio/client/didclient.py +5 -3
- rucio/client/downloadclient.py +6 -8
- rucio/client/replicaclient.py +0 -2
- rucio/client/richclient.py +317 -0
- rucio/client/rseclient.py +4 -4
- rucio/client/uploadclient.py +26 -12
- rucio/common/bittorrent.py +234 -0
- rucio/common/cache.py +66 -29
- rucio/common/checksum.py +168 -0
- rucio/common/client.py +122 -0
- rucio/common/config.py +22 -35
- rucio/common/constants.py +61 -3
- rucio/common/didtype.py +72 -24
- rucio/common/dumper/__init__.py +45 -38
- rucio/common/dumper/consistency.py +75 -30
- rucio/common/dumper/data_models.py +63 -19
- rucio/common/dumper/path_parsing.py +19 -8
- rucio/common/exception.py +65 -8
- rucio/common/extra.py +5 -10
- rucio/common/logging.py +13 -13
- rucio/common/pcache.py +8 -7
- rucio/common/plugins.py +59 -27
- rucio/common/policy.py +12 -3
- rucio/common/schema/__init__.py +84 -34
- rucio/common/schema/generic.py +0 -17
- rucio/common/schema/generic_multi_vo.py +0 -17
- rucio/common/test_rucio_server.py +12 -6
- rucio/common/types.py +132 -52
- rucio/common/utils.py +93 -643
- rucio/core/account_limit.py +14 -12
- rucio/core/authentication.py +2 -2
- rucio/core/config.py +23 -42
- rucio/core/credential.py +14 -15
- rucio/core/did.py +5 -1
- rucio/core/did_meta_plugins/elasticsearch_meta.py +407 -0
- rucio/core/did_meta_plugins/filter_engine.py +62 -3
- rucio/core/did_meta_plugins/json_meta.py +2 -2
- rucio/core/did_meta_plugins/mongo_meta.py +43 -30
- rucio/core/did_meta_plugins/postgres_meta.py +75 -39
- rucio/core/identity.py +6 -5
- rucio/core/importer.py +4 -3
- rucio/core/lifetime_exception.py +2 -2
- rucio/core/lock.py +8 -7
- rucio/core/message.py +6 -0
- rucio/core/monitor.py +30 -29
- rucio/core/naming_convention.py +2 -2
- rucio/core/nongrid_trace.py +2 -2
- rucio/core/oidc.py +11 -9
- rucio/core/permission/__init__.py +79 -37
- rucio/core/permission/generic.py +1 -7
- rucio/core/permission/generic_multi_vo.py +1 -7
- rucio/core/quarantined_replica.py +4 -3
- rucio/core/replica.py +464 -139
- rucio/core/replica_sorter.py +55 -59
- rucio/core/request.py +34 -32
- rucio/core/rse.py +301 -97
- rucio/core/rse_counter.py +1 -2
- rucio/core/rse_expression_parser.py +7 -7
- rucio/core/rse_selector.py +9 -7
- rucio/core/rule.py +41 -40
- rucio/core/rule_grouping.py +42 -40
- rucio/core/scope.py +5 -4
- rucio/core/subscription.py +26 -28
- rucio/core/topology.py +11 -11
- rucio/core/trace.py +2 -2
- rucio/core/transfer.py +29 -15
- rucio/core/volatile_replica.py +4 -3
- rucio/daemons/atropos/atropos.py +1 -1
- rucio/daemons/auditor/__init__.py +2 -2
- rucio/daemons/auditor/srmdumps.py +6 -6
- rucio/daemons/automatix/automatix.py +32 -21
- rucio/daemons/badreplicas/necromancer.py +2 -2
- rucio/daemons/bb8/nuclei_background_rebalance.py +1 -1
- rucio/daemons/bb8/t2_background_rebalance.py +1 -1
- rucio/daemons/common.py +15 -25
- rucio/daemons/conveyor/finisher.py +2 -2
- rucio/daemons/conveyor/poller.py +18 -28
- rucio/daemons/conveyor/receiver.py +2 -2
- rucio/daemons/conveyor/stager.py +1 -0
- rucio/daemons/conveyor/submitter.py +3 -3
- rucio/daemons/hermes/hermes.py +91 -30
- rucio/daemons/judge/evaluator.py +2 -2
- rucio/daemons/oauthmanager/oauthmanager.py +3 -3
- rucio/daemons/reaper/dark_reaper.py +7 -3
- rucio/daemons/reaper/reaper.py +12 -16
- rucio/daemons/rsedecommissioner/config.py +1 -1
- rucio/daemons/rsedecommissioner/profiles/generic.py +5 -4
- rucio/daemons/rsedecommissioner/profiles/types.py +7 -6
- rucio/daemons/rsedecommissioner/rse_decommissioner.py +1 -1
- rucio/daemons/storage/consistency/actions.py +8 -6
- rucio/daemons/tracer/kronos.py +4 -4
- rucio/db/sqla/constants.py +5 -0
- rucio/db/sqla/migrate_repo/versions/1677d4d803c8_split_rse_availability_into_multiple.py +4 -4
- rucio/db/sqla/migrate_repo/versions/30d5206e9cad_increase_oauthrequest_redirect_msg_.py +37 -0
- rucio/db/sqla/models.py +157 -154
- rucio/db/sqla/session.py +58 -27
- rucio/db/sqla/types.py +2 -2
- rucio/db/sqla/util.py +2 -2
- rucio/gateway/account.py +18 -12
- rucio/gateway/account_limit.py +137 -60
- rucio/gateway/authentication.py +18 -12
- rucio/gateway/config.py +30 -20
- rucio/gateway/credential.py +9 -10
- rucio/gateway/did.py +70 -53
- rucio/gateway/dirac.py +6 -4
- rucio/gateway/exporter.py +3 -2
- rucio/gateway/heartbeat.py +6 -4
- rucio/gateway/identity.py +36 -51
- rucio/gateway/importer.py +3 -2
- rucio/gateway/lifetime_exception.py +3 -2
- rucio/gateway/meta_conventions.py +17 -6
- rucio/gateway/permission.py +4 -1
- rucio/gateway/quarantined_replica.py +3 -2
- rucio/gateway/replica.py +31 -22
- rucio/gateway/request.py +27 -18
- rucio/gateway/rse.py +69 -37
- rucio/gateway/rule.py +46 -26
- rucio/gateway/scope.py +3 -2
- rucio/gateway/subscription.py +14 -11
- rucio/gateway/vo.py +12 -8
- rucio/rse/__init__.py +3 -3
- rucio/rse/protocols/bittorrent.py +11 -1
- rucio/rse/protocols/cache.py +0 -11
- rucio/rse/protocols/dummy.py +0 -11
- rucio/rse/protocols/gfal.py +14 -9
- rucio/rse/protocols/globus.py +1 -1
- rucio/rse/protocols/http_cache.py +1 -1
- rucio/rse/protocols/posix.py +2 -2
- rucio/rse/protocols/protocol.py +84 -317
- rucio/rse/protocols/rclone.py +2 -1
- rucio/rse/protocols/rfio.py +10 -1
- rucio/rse/protocols/ssh.py +2 -1
- rucio/rse/protocols/storm.py +2 -13
- rucio/rse/protocols/webdav.py +74 -30
- rucio/rse/protocols/xrootd.py +2 -1
- rucio/rse/rsemanager.py +170 -53
- rucio/rse/translation.py +260 -0
- rucio/tests/common.py +23 -13
- rucio/tests/common_server.py +26 -9
- rucio/transfertool/bittorrent.py +15 -14
- rucio/transfertool/bittorrent_driver.py +5 -7
- rucio/transfertool/bittorrent_driver_qbittorrent.py +9 -8
- rucio/transfertool/fts3.py +20 -16
- rucio/transfertool/mock.py +2 -3
- rucio/vcsversion.py +4 -4
- rucio/version.py +7 -0
- rucio/web/rest/flaskapi/v1/accounts.py +17 -3
- rucio/web/rest/flaskapi/v1/auth.py +5 -5
- rucio/web/rest/flaskapi/v1/credentials.py +3 -2
- rucio/web/rest/flaskapi/v1/dids.py +21 -15
- rucio/web/rest/flaskapi/v1/identities.py +33 -9
- rucio/web/rest/flaskapi/v1/redirect.py +5 -4
- rucio/web/rest/flaskapi/v1/replicas.py +12 -8
- rucio/web/rest/flaskapi/v1/rses.py +15 -4
- rucio/web/rest/flaskapi/v1/traces.py +56 -19
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/alembic.ini.template +1 -1
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/alembic_offline.ini.template +1 -1
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +3 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rucio.cfg.template +3 -19
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +1 -18
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/requirements.server.txt +97 -68
- rucio-37.0.0.data/scripts/rucio +133 -0
- rucio-37.0.0.data/scripts/rucio-admin +97 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-atropos +2 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-auditor +2 -1
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-automatix +2 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-cache-client +17 -10
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-receiver +1 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-kronos +1 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-minos +2 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-minos-temporary-expiration +2 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-necromancer +2 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-reaper +6 -6
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-transmogrifier +2 -2
- rucio-37.0.0.dist-info/METADATA +92 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/RECORD +237 -243
- {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/licenses/AUTHORS.rst +3 -0
- rucio/common/schema/atlas.py +0 -413
- rucio/common/schema/belleii.py +0 -408
- rucio/common/schema/domatpc.py +0 -401
- rucio/common/schema/escape.py +0 -426
- rucio/common/schema/icecube.py +0 -406
- rucio/core/permission/atlas.py +0 -1348
- rucio/core/permission/belleii.py +0 -1077
- rucio/core/permission/escape.py +0 -1078
- rucio/daemons/c3po/algorithms/__init__.py +0 -13
- rucio/daemons/c3po/algorithms/simple.py +0 -134
- rucio/daemons/c3po/algorithms/t2_free_space.py +0 -128
- rucio/daemons/c3po/algorithms/t2_free_space_only_pop.py +0 -130
- rucio/daemons/c3po/algorithms/t2_free_space_only_pop_with_network.py +0 -294
- rucio/daemons/c3po/c3po.py +0 -371
- rucio/daemons/c3po/collectors/agis.py +0 -108
- rucio/daemons/c3po/collectors/free_space.py +0 -81
- rucio/daemons/c3po/collectors/jedi_did.py +0 -57
- rucio/daemons/c3po/collectors/mock_did.py +0 -51
- rucio/daemons/c3po/collectors/network_metrics.py +0 -71
- rucio/daemons/c3po/collectors/workload.py +0 -112
- rucio/daemons/c3po/utils/__init__.py +0 -13
- rucio/daemons/c3po/utils/dataset_cache.py +0 -50
- rucio/daemons/c3po/utils/expiring_dataset_cache.py +0 -56
- rucio/daemons/c3po/utils/expiring_list.py +0 -62
- rucio/daemons/c3po/utils/popularity.py +0 -85
- rucio/daemons/c3po/utils/timeseries.py +0 -89
- rucio/rse/protocols/gsiftp.py +0 -92
- rucio-35.7.0.data/scripts/rucio-c3po +0 -85
- rucio-35.7.0.dist-info/METADATA +0 -72
- /rucio/{daemons/c3po → cli/bin_legacy}/__init__.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/tools/bootstrap.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/tools/reset_database.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-abacus-account +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-abacus-collection-replica +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-abacus-rse +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-bb8 +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-cache-consumer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-finisher +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-poller +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-preparer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-stager +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-submitter +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-throttler +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-dark-reaper +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-dumper +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-follower +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-hermes +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-cleaner +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-evaluator +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-injector +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-repairer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-oauth-manager +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-replica-recoverer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-rse-decommissioner +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-storage-consistency-actions +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-undertaker +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/WHEEL +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/licenses/LICENSE +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/top_level.txt +0 -0
rucio/common/schema/domatpc.py
DELETED
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
# Copyright European Organization for Nuclear Research (CERN) since 2012
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from jsonschema import ValidationError, validate
|
|
16
|
-
|
|
17
|
-
from rucio.common.exception import InvalidObject
|
|
18
|
-
|
|
19
|
-
ACCOUNT_LENGTH = 25
|
|
20
|
-
|
|
21
|
-
ACCOUNT = {"description": "Account name",
|
|
22
|
-
"type": "string",
|
|
23
|
-
"maxLength": ACCOUNT_LENGTH,
|
|
24
|
-
"pattern": "^[a-z0-9-_]+$"}
|
|
25
|
-
|
|
26
|
-
ACCOUNTS = {"description": "Array of accounts",
|
|
27
|
-
"type": "array",
|
|
28
|
-
"items": ACCOUNT,
|
|
29
|
-
"minItems": 0,
|
|
30
|
-
"maxItems": 1000}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
ACCOUNT_TYPE = {"description": "Account type",
|
|
34
|
-
"type": "string",
|
|
35
|
-
"enum": ["USER", "GROUP", "SERVICE"]}
|
|
36
|
-
|
|
37
|
-
ACTIVITY = {"description": "Activity name",
|
|
38
|
-
"type": "string",
|
|
39
|
-
"enum": ["Functional Test XrootD", "Functional Test WebDAV", "Stress Test"]}
|
|
40
|
-
|
|
41
|
-
SCOPE_LENGTH = 25
|
|
42
|
-
|
|
43
|
-
SCOPE = {"description": "Scope name",
|
|
44
|
-
"type": "string",
|
|
45
|
-
"maxLength": SCOPE_LENGTH,
|
|
46
|
-
"pattern": "^[a-zA-Z_\\-.0-9]+$"}
|
|
47
|
-
|
|
48
|
-
R_SCOPE = {"description": "Scope name",
|
|
49
|
-
"type": "string",
|
|
50
|
-
"pattern": "\\w"}
|
|
51
|
-
|
|
52
|
-
NAME_LENGTH = 250
|
|
53
|
-
|
|
54
|
-
NAME = {"description": "Data Identifier name",
|
|
55
|
-
"type": "string",
|
|
56
|
-
"maxLength": NAME_LENGTH,
|
|
57
|
-
"pattern": "^[A-Za-z0-9][A-Za-z0-9\\.\\-\\_]*$"}
|
|
58
|
-
|
|
59
|
-
R_NAME = {"description": "Data Identifier name",
|
|
60
|
-
"type": "string",
|
|
61
|
-
"pattern": "\\w"}
|
|
62
|
-
|
|
63
|
-
LOCKED = {"description": "Rule locked status",
|
|
64
|
-
"type": ["boolean", "null"]}
|
|
65
|
-
|
|
66
|
-
ASK_APPROVAL = {"description": "Rule approval request",
|
|
67
|
-
"type": ["boolean", "null"]}
|
|
68
|
-
|
|
69
|
-
ASYNCHRONOUS = {"description": "Asynchronous rule creation",
|
|
70
|
-
"type": ["boolean", "null"]}
|
|
71
|
-
|
|
72
|
-
DELAY_INJECTION = {"description": "Time (in seconds) to wait before starting applying the rule. Implies asynchronous rule creation.",
|
|
73
|
-
"type": ["integer", "null"]}
|
|
74
|
-
|
|
75
|
-
PURGE_REPLICAS = {"description": "Rule purge replica status",
|
|
76
|
-
"type": "boolean"}
|
|
77
|
-
|
|
78
|
-
IGNORE_AVAILABILITY = {"description": "Rule ignore availability status",
|
|
79
|
-
"type": "boolean"}
|
|
80
|
-
|
|
81
|
-
RSE = {"description": "RSE name",
|
|
82
|
-
"type": "string",
|
|
83
|
-
"pattern": "^([A-Z0-9]+([_-][A-Z0-9]+)*)$"}
|
|
84
|
-
|
|
85
|
-
RSE_ATTRIBUTE = {"description": "RSE attribute",
|
|
86
|
-
"type": "string",
|
|
87
|
-
"pattern": r'([A-Za-z0-9\._-]+[=<>][A-Za-z0-9_-]+)'}
|
|
88
|
-
|
|
89
|
-
DEFAULT_RSE_ATTRIBUTE = {"description": "Default RSE attribute",
|
|
90
|
-
"type": "string",
|
|
91
|
-
"pattern": r'([A-Z0-9]+([_-][A-Z0-9]+)*)'}
|
|
92
|
-
|
|
93
|
-
REPLICA_STATE = {"description": "Replica state",
|
|
94
|
-
"type": "string",
|
|
95
|
-
"enum": ["AVAILABLE", "UNAVAILABLE", "COPYING", "BEING_DELETED", "BAD", "SOURCE", "A", "U", "C", "B", "D", "S"]}
|
|
96
|
-
|
|
97
|
-
DATE = {"description": "Date",
|
|
98
|
-
"type": "string",
|
|
99
|
-
"pattern": r'((Mon)|(Tue)|(Wed)|(Thu)|(Fri)|(Sat)|(Sun))[,]\s\d{2}\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s(0\d|1\d|2[0-3])(\:)(0\d|1\d|2\d|3\d|4\d|5\d)(\:)(0\d|1\d|2\d|3\d|4\d|5\d)\s(UTC)'}
|
|
100
|
-
|
|
101
|
-
DID_TYPE = {"description": "DID type",
|
|
102
|
-
"type": "string",
|
|
103
|
-
"enum": ["DATASET", "CONTAINER", "FILE", "F"]}
|
|
104
|
-
|
|
105
|
-
GROUPING = {"description": "Rule grouping",
|
|
106
|
-
"type": ["string", "null"],
|
|
107
|
-
"enum": ["DATASET", "NONE", "ALL", None]}
|
|
108
|
-
|
|
109
|
-
NOTIFY = {"description": "Rule notification setting",
|
|
110
|
-
"type": ["string", "null"],
|
|
111
|
-
"enum": ["Y", "C", "N", "P", None]}
|
|
112
|
-
|
|
113
|
-
COMMENT = {"description": "Rule comment",
|
|
114
|
-
"type": ["string", "null"],
|
|
115
|
-
"maxLength": 250}
|
|
116
|
-
|
|
117
|
-
METADATA = {"description": "Rule wfms metadata",
|
|
118
|
-
"type": ["string", "null"],
|
|
119
|
-
"maxLength": 3999}
|
|
120
|
-
|
|
121
|
-
BYTES = {"description": "Size in bytes",
|
|
122
|
-
"type": "integer"}
|
|
123
|
-
|
|
124
|
-
ADLER32 = {"description": "adler32",
|
|
125
|
-
"type": "string",
|
|
126
|
-
"pattern": "^[a-fA-F\\d]{8}$"}
|
|
127
|
-
|
|
128
|
-
WEIGHT = {"description": "Rule weight",
|
|
129
|
-
"type": ["string", "null"]}
|
|
130
|
-
|
|
131
|
-
MD5 = {"description": "md5",
|
|
132
|
-
"type": "string",
|
|
133
|
-
"pattern": "^[a-fA-F\\d]{32}$"}
|
|
134
|
-
|
|
135
|
-
UUID = {"description": "Universally Unique Identifier (UUID)",
|
|
136
|
-
"type": "string",
|
|
137
|
-
"pattern": '^(\\{){0,1}[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}(\\}){0,1}$'}
|
|
138
|
-
|
|
139
|
-
META = {"description": "Data Identifier(DID) metadata",
|
|
140
|
-
"type": "object",
|
|
141
|
-
"properties": {"guid": UUID},
|
|
142
|
-
"additionalProperties": True}
|
|
143
|
-
|
|
144
|
-
PFN = {"description": "Physical File Name", "type": "string"}
|
|
145
|
-
|
|
146
|
-
COPIES = {"description": "Number of replica copies", "type": "integer"}
|
|
147
|
-
|
|
148
|
-
RSE_EXPRESSION = {"description": "RSE expression", "type": "string"}
|
|
149
|
-
|
|
150
|
-
SOURCE_REPLICA_EXPRESSION = {"description": "RSE expression", "type": ["string", "null"]}
|
|
151
|
-
|
|
152
|
-
LIFETIME = {"description": "Lifetime", "type": "number"}
|
|
153
|
-
|
|
154
|
-
RULE_LIFETIME = {"description": "Rule lifetime", "type": ["number", "null"]}
|
|
155
|
-
|
|
156
|
-
SUBSCRIPTION_ID = {"description": "Rule Subscription id", "type": ["string", "null"]}
|
|
157
|
-
|
|
158
|
-
PRIORITY = {"description": "Priority of the transfers",
|
|
159
|
-
"type": "integer"}
|
|
160
|
-
|
|
161
|
-
SPLIT_CONTAINER = {"description": "Rule split container mode",
|
|
162
|
-
"type": ["boolean", "null"]}
|
|
163
|
-
|
|
164
|
-
RULE = {"description": "Replication rule",
|
|
165
|
-
"type": "object",
|
|
166
|
-
"properties": {"dids": {"type": "array"},
|
|
167
|
-
"account": ACCOUNT,
|
|
168
|
-
"copies": COPIES,
|
|
169
|
-
"rse_expression": RSE_EXPRESSION,
|
|
170
|
-
"grouping": GROUPING,
|
|
171
|
-
"weight": WEIGHT,
|
|
172
|
-
"lifetime": RULE_LIFETIME,
|
|
173
|
-
"locked": LOCKED,
|
|
174
|
-
"subscription_id": SUBSCRIPTION_ID,
|
|
175
|
-
"source_replica_expression": SOURCE_REPLICA_EXPRESSION,
|
|
176
|
-
"activity": ACTIVITY,
|
|
177
|
-
"notify": NOTIFY,
|
|
178
|
-
"purge_replicas": PURGE_REPLICAS,
|
|
179
|
-
"ignore_availability": IGNORE_AVAILABILITY,
|
|
180
|
-
"comment": COMMENT,
|
|
181
|
-
"ask_approval": ASK_APPROVAL,
|
|
182
|
-
"asynchronous": ASYNCHRONOUS,
|
|
183
|
-
"delay_injection": DELAY_INJECTION,
|
|
184
|
-
"priority": PRIORITY,
|
|
185
|
-
'split_container': SPLIT_CONTAINER,
|
|
186
|
-
'meta': METADATA},
|
|
187
|
-
"required": ["dids", "copies", "rse_expression"],
|
|
188
|
-
"additionalProperties": False}
|
|
189
|
-
|
|
190
|
-
RULES = {"description": "Array of replication rules",
|
|
191
|
-
"type": "array",
|
|
192
|
-
"items": RULE,
|
|
193
|
-
"minItems": 1,
|
|
194
|
-
"maxItems": 1000}
|
|
195
|
-
|
|
196
|
-
COLLECTION_TYPE = {"description": "Dataset or container type",
|
|
197
|
-
"type": "string",
|
|
198
|
-
"enum": ["DATASET", "CONTAINER"]}
|
|
199
|
-
|
|
200
|
-
COLLECTION = {"description": "Dataset or container",
|
|
201
|
-
"type": "object",
|
|
202
|
-
"properties": {"scope": SCOPE,
|
|
203
|
-
"name": NAME,
|
|
204
|
-
"type": COLLECTION_TYPE,
|
|
205
|
-
"meta": META,
|
|
206
|
-
"rules": RULES},
|
|
207
|
-
"required": ["scope", "name", "type"],
|
|
208
|
-
"additionalProperties": False}
|
|
209
|
-
|
|
210
|
-
COLLECTIONS = {"description": "Array of datasets or containers",
|
|
211
|
-
"type": "array",
|
|
212
|
-
"items": COLLECTION,
|
|
213
|
-
"minItems": 1,
|
|
214
|
-
"maxItems": 1000}
|
|
215
|
-
|
|
216
|
-
DID = {"description": "Data Identifier(DID)",
|
|
217
|
-
"type": "object",
|
|
218
|
-
"properties": {"scope": SCOPE,
|
|
219
|
-
"name": NAME,
|
|
220
|
-
"type": DID_TYPE,
|
|
221
|
-
"meta": META,
|
|
222
|
-
"rules": RULES,
|
|
223
|
-
"bytes": BYTES,
|
|
224
|
-
"adler32": ADLER32,
|
|
225
|
-
"md5": MD5,
|
|
226
|
-
"state": REPLICA_STATE,
|
|
227
|
-
"pfn": PFN},
|
|
228
|
-
"required": ["scope", "name"],
|
|
229
|
-
"additionalProperties": False}
|
|
230
|
-
|
|
231
|
-
DID_FILTERS = {"description": "Array to filter DIDs by metadata",
|
|
232
|
-
"type": "array",
|
|
233
|
-
"additionalProperties": True}
|
|
234
|
-
|
|
235
|
-
R_DID = {"description": "Data Identifier(DID)",
|
|
236
|
-
"type": "object",
|
|
237
|
-
"properties": {"scope": R_SCOPE,
|
|
238
|
-
"name": R_NAME,
|
|
239
|
-
"type": DID_TYPE,
|
|
240
|
-
"meta": META,
|
|
241
|
-
"rules": RULES,
|
|
242
|
-
"bytes": BYTES,
|
|
243
|
-
"adler32": ADLER32,
|
|
244
|
-
"md5": MD5,
|
|
245
|
-
"state": REPLICA_STATE,
|
|
246
|
-
"pfn": PFN},
|
|
247
|
-
"required": ["scope", "name"],
|
|
248
|
-
"additionalProperties": False}
|
|
249
|
-
|
|
250
|
-
DIDS = {"description": "Array of Data Identifiers(DIDs)",
|
|
251
|
-
"type": "array",
|
|
252
|
-
"items": DID,
|
|
253
|
-
"minItems": 1,
|
|
254
|
-
"maxItems": 1000}
|
|
255
|
-
|
|
256
|
-
R_DIDS = {"description": "Array of Data Identifiers(DIDs)",
|
|
257
|
-
"type": "array",
|
|
258
|
-
"items": R_DID,
|
|
259
|
-
"minItems": 1,
|
|
260
|
-
"maxItems": 1000}
|
|
261
|
-
|
|
262
|
-
ATTACHMENT = {"description": "Attachement",
|
|
263
|
-
"type": "object",
|
|
264
|
-
"properties": {"scope": SCOPE,
|
|
265
|
-
"name": NAME,
|
|
266
|
-
"rse": {"description": "RSE name",
|
|
267
|
-
"type": ["string", "null"],
|
|
268
|
-
"pattern": "^([A-Z0-9]+([_-][A-Z0-9]+)*)$"},
|
|
269
|
-
"dids": DIDS},
|
|
270
|
-
"required": ["dids"],
|
|
271
|
-
"additionalProperties": False}
|
|
272
|
-
|
|
273
|
-
ATTACHMENTS = {"description": "Array of attachments",
|
|
274
|
-
"type": "array",
|
|
275
|
-
"items": ATTACHMENT,
|
|
276
|
-
"minItems": 1,
|
|
277
|
-
"maxItems": 1000}
|
|
278
|
-
|
|
279
|
-
SUBSCRIPTION_FILTER = {"type": "object",
|
|
280
|
-
"properties": {"datatype": {"type": "array"},
|
|
281
|
-
"prod_step": {"type": "array"},
|
|
282
|
-
"stream_name": {"type": "array"},
|
|
283
|
-
"project": {"type": "array"},
|
|
284
|
-
"scope": {"type": "array"},
|
|
285
|
-
"pattern": {"type": "string"},
|
|
286
|
-
"excluded_pattern": {"type": "string"},
|
|
287
|
-
"group": {"type": "string"},
|
|
288
|
-
"provenance": {"type": "string"},
|
|
289
|
-
"account": ACCOUNTS,
|
|
290
|
-
"grouping": {"type": "string"},
|
|
291
|
-
"split_rule": {"type": "boolean"}}}
|
|
292
|
-
|
|
293
|
-
ADD_REPLICA_FILE = {"description": "add replica file",
|
|
294
|
-
"type": "object",
|
|
295
|
-
"properties": {"scope": SCOPE,
|
|
296
|
-
"name": NAME,
|
|
297
|
-
"bytes": BYTES,
|
|
298
|
-
"adler32": ADLER32},
|
|
299
|
-
"required": ["scope", "name", "bytes", "adler32"]}
|
|
300
|
-
|
|
301
|
-
ADD_REPLICA_FILES = {"description": "add replica files",
|
|
302
|
-
"type": "array",
|
|
303
|
-
"items": ADD_REPLICA_FILE,
|
|
304
|
-
"minItems": 1,
|
|
305
|
-
"maxItems": 1000}
|
|
306
|
-
|
|
307
|
-
CACHE_ADD_REPLICAS = {"description": "rucio cache add replicas",
|
|
308
|
-
"type": "object",
|
|
309
|
-
"properties": {"files": ADD_REPLICA_FILES,
|
|
310
|
-
"rse": RSE,
|
|
311
|
-
"lifetime": LIFETIME,
|
|
312
|
-
"operation": {"enum": ["add_replicas"]}},
|
|
313
|
-
"required": ['files', 'rse', 'lifetime', 'operation']}
|
|
314
|
-
|
|
315
|
-
DELETE_REPLICA_FILE = {"description": "delete replica file",
|
|
316
|
-
"type": "object",
|
|
317
|
-
"properties": {"scope": SCOPE,
|
|
318
|
-
"name": NAME},
|
|
319
|
-
"required": ["scope", "name"]}
|
|
320
|
-
|
|
321
|
-
DELETE_REPLICA_FILES = {"description": "delete replica files",
|
|
322
|
-
"type": "array",
|
|
323
|
-
"items": DELETE_REPLICA_FILE,
|
|
324
|
-
"minItems": 1,
|
|
325
|
-
"maxItems": 1000}
|
|
326
|
-
|
|
327
|
-
CACHE_DELETE_REPLICAS = {"description": "rucio cache delete replicas",
|
|
328
|
-
"type": "object",
|
|
329
|
-
"properties": {"files": DELETE_REPLICA_FILES,
|
|
330
|
-
"rse": RSE,
|
|
331
|
-
"operation": {"enum": ["delete_replicas"]}},
|
|
332
|
-
"required": ['files', 'rse', 'operation']}
|
|
333
|
-
|
|
334
|
-
MESSAGE_OPERATION = {"type": "object",
|
|
335
|
-
"properties": {'operation': {"enum": ["add_replicas", "delete_replicas"]}}}
|
|
336
|
-
|
|
337
|
-
ACCOUNT_ATTRIBUTE = {"description": "Account attribute",
|
|
338
|
-
"type": "string",
|
|
339
|
-
"pattern": r'^[a-zA-Z0-9-_\\/\\.]{1,30}$'}
|
|
340
|
-
|
|
341
|
-
SCOPE_NAME_REGEXP = '/(.*)/(.*)'
|
|
342
|
-
|
|
343
|
-
DISTANCE = {"description": "RSE distance",
|
|
344
|
-
"type": "object",
|
|
345
|
-
"properties": {
|
|
346
|
-
"src_rse_id": {"type": "string"},
|
|
347
|
-
"dest_rse_id": {"type": "string"},
|
|
348
|
-
"ranking": {"type": "integer"}
|
|
349
|
-
},
|
|
350
|
-
"required": ["src_rse_id", "dest_rse_id", "ranking"],
|
|
351
|
-
"additionalProperties": True}
|
|
352
|
-
|
|
353
|
-
IMPORT = {"description": "import data into rucio.",
|
|
354
|
-
"type": "object",
|
|
355
|
-
"properties": {
|
|
356
|
-
"rses": {
|
|
357
|
-
"type": "object"
|
|
358
|
-
},
|
|
359
|
-
"distances": {
|
|
360
|
-
"type": "object"
|
|
361
|
-
}
|
|
362
|
-
}}
|
|
363
|
-
|
|
364
|
-
SCHEMAS = {'account': ACCOUNT,
|
|
365
|
-
'account_type': ACCOUNT_TYPE,
|
|
366
|
-
'activity': ACTIVITY,
|
|
367
|
-
'name': NAME,
|
|
368
|
-
'r_name': R_NAME,
|
|
369
|
-
'rse': RSE,
|
|
370
|
-
'rse_attribute': RSE_ATTRIBUTE,
|
|
371
|
-
'scope': SCOPE,
|
|
372
|
-
'r_scope': R_SCOPE,
|
|
373
|
-
'did': DID,
|
|
374
|
-
'did_filters': DID_FILTERS,
|
|
375
|
-
'r_did': R_DID,
|
|
376
|
-
'dids': DIDS,
|
|
377
|
-
'rule': RULE,
|
|
378
|
-
'r_dids': R_DIDS,
|
|
379
|
-
'collection': COLLECTION,
|
|
380
|
-
'collections': COLLECTIONS,
|
|
381
|
-
'attachment': ATTACHMENT,
|
|
382
|
-
'attachments': ATTACHMENTS,
|
|
383
|
-
'subscription_filter': SUBSCRIPTION_FILTER,
|
|
384
|
-
'cache_add_replicas': CACHE_ADD_REPLICAS,
|
|
385
|
-
'cache_delete_replicas': CACHE_DELETE_REPLICAS,
|
|
386
|
-
'account_attribute': ACCOUNT_ATTRIBUTE,
|
|
387
|
-
'import': IMPORT}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
def validate_schema(name, obj):
|
|
391
|
-
"""
|
|
392
|
-
Validate object against json schema
|
|
393
|
-
|
|
394
|
-
:param name: The json schema name.
|
|
395
|
-
:param obj: The object to validate.
|
|
396
|
-
"""
|
|
397
|
-
try:
|
|
398
|
-
if obj:
|
|
399
|
-
validate(obj, SCHEMAS.get(name, {}))
|
|
400
|
-
except ValidationError as error: # NOQA, pylint: disable=W0612
|
|
401
|
-
raise InvalidObject(f'Problem validating {name}: {error}')
|