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.

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