rucio-clients 32.8.6__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-clients might be problematic. Click here for more details.

Files changed (88) hide show
  1. rucio/__init__.py +18 -0
  2. rucio/alembicrevision.py +16 -0
  3. rucio/client/__init__.py +16 -0
  4. rucio/client/accountclient.py +413 -0
  5. rucio/client/accountlimitclient.py +155 -0
  6. rucio/client/baseclient.py +929 -0
  7. rucio/client/client.py +77 -0
  8. rucio/client/configclient.py +113 -0
  9. rucio/client/credentialclient.py +54 -0
  10. rucio/client/didclient.py +691 -0
  11. rucio/client/diracclient.py +48 -0
  12. rucio/client/downloadclient.py +1674 -0
  13. rucio/client/exportclient.py +44 -0
  14. rucio/client/fileclient.py +51 -0
  15. rucio/client/importclient.py +42 -0
  16. rucio/client/lifetimeclient.py +74 -0
  17. rucio/client/lockclient.py +99 -0
  18. rucio/client/metaclient.py +137 -0
  19. rucio/client/pingclient.py +45 -0
  20. rucio/client/replicaclient.py +444 -0
  21. rucio/client/requestclient.py +109 -0
  22. rucio/client/rseclient.py +664 -0
  23. rucio/client/ruleclient.py +287 -0
  24. rucio/client/scopeclient.py +88 -0
  25. rucio/client/subscriptionclient.py +161 -0
  26. rucio/client/touchclient.py +78 -0
  27. rucio/client/uploadclient.py +871 -0
  28. rucio/common/__init__.py +14 -0
  29. rucio/common/cache.py +74 -0
  30. rucio/common/config.py +796 -0
  31. rucio/common/constants.py +92 -0
  32. rucio/common/constraints.py +18 -0
  33. rucio/common/didtype.py +187 -0
  34. rucio/common/exception.py +1092 -0
  35. rucio/common/extra.py +37 -0
  36. rucio/common/logging.py +404 -0
  37. rucio/common/pcache.py +1387 -0
  38. rucio/common/policy.py +84 -0
  39. rucio/common/schema/__init__.py +143 -0
  40. rucio/common/schema/atlas.py +411 -0
  41. rucio/common/schema/belleii.py +406 -0
  42. rucio/common/schema/cms.py +478 -0
  43. rucio/common/schema/domatpc.py +399 -0
  44. rucio/common/schema/escape.py +424 -0
  45. rucio/common/schema/generic.py +431 -0
  46. rucio/common/schema/generic_multi_vo.py +410 -0
  47. rucio/common/schema/icecube.py +404 -0
  48. rucio/common/schema/lsst.py +423 -0
  49. rucio/common/stomp_utils.py +160 -0
  50. rucio/common/stopwatch.py +56 -0
  51. rucio/common/test_rucio_server.py +148 -0
  52. rucio/common/types.py +158 -0
  53. rucio/common/utils.py +1946 -0
  54. rucio/rse/__init__.py +97 -0
  55. rucio/rse/protocols/__init__.py +14 -0
  56. rucio/rse/protocols/cache.py +123 -0
  57. rucio/rse/protocols/dummy.py +112 -0
  58. rucio/rse/protocols/gfal.py +701 -0
  59. rucio/rse/protocols/globus.py +243 -0
  60. rucio/rse/protocols/gsiftp.py +93 -0
  61. rucio/rse/protocols/http_cache.py +83 -0
  62. rucio/rse/protocols/mock.py +124 -0
  63. rucio/rse/protocols/ngarc.py +210 -0
  64. rucio/rse/protocols/posix.py +251 -0
  65. rucio/rse/protocols/protocol.py +530 -0
  66. rucio/rse/protocols/rclone.py +365 -0
  67. rucio/rse/protocols/rfio.py +137 -0
  68. rucio/rse/protocols/srm.py +339 -0
  69. rucio/rse/protocols/ssh.py +414 -0
  70. rucio/rse/protocols/storm.py +207 -0
  71. rucio/rse/protocols/webdav.py +547 -0
  72. rucio/rse/protocols/xrootd.py +295 -0
  73. rucio/rse/rsemanager.py +752 -0
  74. rucio/vcsversion.py +11 -0
  75. rucio/version.py +46 -0
  76. rucio_clients-32.8.6.data/data/etc/rse-accounts.cfg.template +25 -0
  77. rucio_clients-32.8.6.data/data/etc/rucio.cfg.atlas.client.template +42 -0
  78. rucio_clients-32.8.6.data/data/etc/rucio.cfg.template +257 -0
  79. rucio_clients-32.8.6.data/data/requirements.txt +55 -0
  80. rucio_clients-32.8.6.data/data/rucio_client/merge_rucio_configs.py +147 -0
  81. rucio_clients-32.8.6.data/scripts/rucio +2540 -0
  82. rucio_clients-32.8.6.data/scripts/rucio-admin +2434 -0
  83. rucio_clients-32.8.6.dist-info/METADATA +50 -0
  84. rucio_clients-32.8.6.dist-info/RECORD +88 -0
  85. rucio_clients-32.8.6.dist-info/WHEEL +5 -0
  86. rucio_clients-32.8.6.dist-info/licenses/AUTHORS.rst +94 -0
  87. rucio_clients-32.8.6.dist-info/licenses/LICENSE +201 -0
  88. rucio_clients-32.8.6.dist-info/top_level.txt +1 -0
@@ -0,0 +1,399 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright European Organization for Nuclear Research (CERN) since 2012
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from jsonschema import validate, ValidationError
17
+
18
+ from rucio.common.exception import InvalidObject
19
+
20
+ ACCOUNT_LENGTH = 25
21
+
22
+ ACCOUNT = {"description": "Account name",
23
+ "type": "string",
24
+ "pattern": "^[a-z0-9-_]{1,%s}$" % ACCOUNT_LENGTH}
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
+ "pattern": "^[a-zA-Z_\\-.0-9]{1,%s}$" % SCOPE_LENGTH}
46
+
47
+ R_SCOPE = {"description": "Scope name",
48
+ "type": "string",
49
+ "pattern": "\\w"}
50
+
51
+ NAME_LENGTH = 250
52
+
53
+ NAME = {"description": "Data Identifier name",
54
+ "type": "string",
55
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9\\.\\-\\_]{1,%s}$" % NAME_LENGTH}
56
+
57
+ R_NAME = {"description": "Data Identifier name",
58
+ "type": "string",
59
+ "pattern": "\\w"}
60
+
61
+ LOCKED = {"description": "Rule locked status",
62
+ "type": ["boolean", "null"]}
63
+
64
+ ASK_APPROVAL = {"description": "Rule approval request",
65
+ "type": ["boolean", "null"]}
66
+
67
+ ASYNCHRONOUS = {"description": "Asynchronous rule creation",
68
+ "type": ["boolean", "null"]}
69
+
70
+ DELAY_INJECTION = {"description": "Time (in seconds) to wait before starting applying the rule. Implies asynchronous rule creation.",
71
+ "type": ["integer", "null"]}
72
+
73
+ PURGE_REPLICAS = {"description": "Rule purge replica status",
74
+ "type": "boolean"}
75
+
76
+ IGNORE_AVAILABILITY = {"description": "Rule ignore availability status",
77
+ "type": "boolean"}
78
+
79
+ RSE = {"description": "RSE name",
80
+ "type": "string",
81
+ "pattern": "^([A-Z0-9]+([_-][A-Z0-9]+)*)$"}
82
+
83
+ RSE_ATTRIBUTE = {"description": "RSE attribute",
84
+ "type": "string",
85
+ "pattern": r'([A-Za-z0-9\._-]+[=<>][A-Za-z0-9_-]+)'}
86
+
87
+ DEFAULT_RSE_ATTRIBUTE = {"description": "Default RSE attribute",
88
+ "type": "string",
89
+ "pattern": r'([A-Z0-9]+([_-][A-Z0-9]+)*)'}
90
+
91
+ REPLICA_STATE = {"description": "Replica state",
92
+ "type": "string",
93
+ "enum": ["AVAILABLE", "UNAVAILABLE", "COPYING", "BEING_DELETED", "BAD", "SOURCE", "A", "U", "C", "B", "D", "S"]}
94
+
95
+ DATE = {"description": "Date",
96
+ "type": "string",
97
+ "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)'}
98
+
99
+ DID_TYPE = {"description": "DID type",
100
+ "type": "string",
101
+ "enum": ["DATASET", "CONTAINER", "FILE", "F"]}
102
+
103
+ GROUPING = {"description": "Rule grouping",
104
+ "type": ["string", "null"],
105
+ "enum": ["DATASET", "NONE", "ALL", None]}
106
+
107
+ NOTIFY = {"description": "Rule notification setting",
108
+ "type": ["string", "null"],
109
+ "enum": ["Y", "C", "N", "P", None]}
110
+
111
+ COMMENT = {"description": "Rule comment",
112
+ "type": ["string", "null"],
113
+ "maxLength": 250}
114
+
115
+ METADATA = {"description": "Rule wfms metadata",
116
+ "type": ["string", "null"],
117
+ "maxLength": 3999}
118
+
119
+ BYTES = {"description": "Size in bytes",
120
+ "type": "integer"}
121
+
122
+ ADLER32 = {"description": "adler32",
123
+ "type": "string",
124
+ "pattern": "^[a-fA-F\\d]{8}$"}
125
+
126
+ WEIGHT = {"description": "Rule weight",
127
+ "type": ["string", "null"]}
128
+
129
+ MD5 = {"description": "md5",
130
+ "type": "string",
131
+ "pattern": "^[a-fA-F\\d]{32}$"}
132
+
133
+ UUID = {"description": "Universally Unique Identifier (UUID)",
134
+ "type": "string",
135
+ "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}$'}
136
+
137
+ META = {"description": "Data Identifier(DID) metadata",
138
+ "type": "object",
139
+ "properties": {"guid": UUID},
140
+ "additionalProperties": True}
141
+
142
+ PFN = {"description": "Physical File Name", "type": "string"}
143
+
144
+ COPIES = {"description": "Number of replica copies", "type": "integer"}
145
+
146
+ RSE_EXPRESSION = {"description": "RSE expression", "type": "string"}
147
+
148
+ SOURCE_REPLICA_EXPRESSION = {"description": "RSE expression", "type": ["string", "null"]}
149
+
150
+ LIFETIME = {"description": "Lifetime", "type": "number"}
151
+
152
+ RULE_LIFETIME = {"description": "Rule lifetime", "type": ["number", "null"]}
153
+
154
+ SUBSCRIPTION_ID = {"description": "Rule Subscription id", "type": ["string", "null"]}
155
+
156
+ PRIORITY = {"description": "Priority of the transfers",
157
+ "type": "integer"}
158
+
159
+ SPLIT_CONTAINER = {"description": "Rule split container mode",
160
+ "type": ["boolean", "null"]}
161
+
162
+ RULE = {"description": "Replication rule",
163
+ "type": "object",
164
+ "properties": {"dids": {"type": "array"},
165
+ "account": ACCOUNT,
166
+ "copies": COPIES,
167
+ "rse_expression": RSE_EXPRESSION,
168
+ "grouping": GROUPING,
169
+ "weight": WEIGHT,
170
+ "lifetime": RULE_LIFETIME,
171
+ "locked": LOCKED,
172
+ "subscription_id": SUBSCRIPTION_ID,
173
+ "source_replica_expression": SOURCE_REPLICA_EXPRESSION,
174
+ "activity": ACTIVITY,
175
+ "notify": NOTIFY,
176
+ "purge_replicas": PURGE_REPLICAS,
177
+ "ignore_availability": IGNORE_AVAILABILITY,
178
+ "comment": COMMENT,
179
+ "ask_approval": ASK_APPROVAL,
180
+ "asynchronous": ASYNCHRONOUS,
181
+ "delay_injection": DELAY_INJECTION,
182
+ "priority": PRIORITY,
183
+ 'split_container': SPLIT_CONTAINER,
184
+ 'meta': METADATA},
185
+ "required": ["dids", "copies", "rse_expression"],
186
+ "additionalProperties": False}
187
+
188
+ RULES = {"description": "Array of replication rules",
189
+ "type": "array",
190
+ "items": RULE,
191
+ "minItems": 1,
192
+ "maxItems": 1000}
193
+
194
+ COLLECTION_TYPE = {"description": "Dataset or container type",
195
+ "type": "string",
196
+ "enum": ["DATASET", "CONTAINER"]}
197
+
198
+ COLLECTION = {"description": "Dataset or container",
199
+ "type": "object",
200
+ "properties": {"scope": SCOPE,
201
+ "name": NAME,
202
+ "type": COLLECTION_TYPE,
203
+ "meta": META,
204
+ "rules": RULES},
205
+ "required": ["scope", "name", "type"],
206
+ "additionalProperties": False}
207
+
208
+ COLLECTIONS = {"description": "Array of datasets or containers",
209
+ "type": "array",
210
+ "items": COLLECTION,
211
+ "minItems": 1,
212
+ "maxItems": 1000}
213
+
214
+ DID = {"description": "Data Identifier(DID)",
215
+ "type": "object",
216
+ "properties": {"scope": SCOPE,
217
+ "name": NAME,
218
+ "type": DID_TYPE,
219
+ "meta": META,
220
+ "rules": RULES,
221
+ "bytes": BYTES,
222
+ "adler32": ADLER32,
223
+ "md5": MD5,
224
+ "state": REPLICA_STATE,
225
+ "pfn": PFN},
226
+ "required": ["scope", "name"],
227
+ "additionalProperties": False}
228
+
229
+ DID_FILTERS = {"description": "Array to filter DIDs by metadata",
230
+ "type": "array",
231
+ "additionalProperties": True}
232
+
233
+ R_DID = {"description": "Data Identifier(DID)",
234
+ "type": "object",
235
+ "properties": {"scope": R_SCOPE,
236
+ "name": R_NAME,
237
+ "type": DID_TYPE,
238
+ "meta": META,
239
+ "rules": RULES,
240
+ "bytes": BYTES,
241
+ "adler32": ADLER32,
242
+ "md5": MD5,
243
+ "state": REPLICA_STATE,
244
+ "pfn": PFN},
245
+ "required": ["scope", "name"],
246
+ "additionalProperties": False}
247
+
248
+ DIDS = {"description": "Array of Data Identifiers(DIDs)",
249
+ "type": "array",
250
+ "items": DID,
251
+ "minItems": 1,
252
+ "maxItems": 1000}
253
+
254
+ R_DIDS = {"description": "Array of Data Identifiers(DIDs)",
255
+ "type": "array",
256
+ "items": R_DID,
257
+ "minItems": 1,
258
+ "maxItems": 1000}
259
+
260
+ ATTACHMENT = {"description": "Attachement",
261
+ "type": "object",
262
+ "properties": {"scope": SCOPE,
263
+ "name": NAME,
264
+ "rse": {"description": "RSE name",
265
+ "type": ["string", "null"],
266
+ "pattern": "^([A-Z0-9]+([_-][A-Z0-9]+)*)$"},
267
+ "dids": DIDS},
268
+ "required": ["dids"],
269
+ "additionalProperties": False}
270
+
271
+ ATTACHMENTS = {"description": "Array of attachments",
272
+ "type": "array",
273
+ "items": ATTACHMENT,
274
+ "minItems": 1,
275
+ "maxItems": 1000}
276
+
277
+ SUBSCRIPTION_FILTER = {"type": "object",
278
+ "properties": {"datatype": {"type": "array"},
279
+ "prod_step": {"type": "array"},
280
+ "stream_name": {"type": "array"},
281
+ "project": {"type": "array"},
282
+ "scope": {"type": "array"},
283
+ "pattern": {"type": "string"},
284
+ "excluded_pattern": {"type": "string"},
285
+ "group": {"type": "string"},
286
+ "provenance": {"type": "string"},
287
+ "account": ACCOUNTS,
288
+ "grouping": {"type": "string"},
289
+ "split_rule": {"type": "boolean"}}}
290
+
291
+ ADD_REPLICA_FILE = {"description": "add replica file",
292
+ "type": "object",
293
+ "properties": {"scope": SCOPE,
294
+ "name": NAME,
295
+ "bytes": BYTES,
296
+ "adler32": ADLER32},
297
+ "required": ["scope", "name", "bytes", "adler32"]}
298
+
299
+ ADD_REPLICA_FILES = {"description": "add replica files",
300
+ "type": "array",
301
+ "items": ADD_REPLICA_FILE,
302
+ "minItems": 1,
303
+ "maxItems": 1000}
304
+
305
+ CACHE_ADD_REPLICAS = {"description": "rucio cache add replicas",
306
+ "type": "object",
307
+ "properties": {"files": ADD_REPLICA_FILES,
308
+ "rse": RSE,
309
+ "lifetime": LIFETIME,
310
+ "operation": {"enum": ["add_replicas"]}},
311
+ "required": ['files', 'rse', 'lifetime', 'operation']}
312
+
313
+ DELETE_REPLICA_FILE = {"description": "delete replica file",
314
+ "type": "object",
315
+ "properties": {"scope": SCOPE,
316
+ "name": NAME},
317
+ "required": ["scope", "name"]}
318
+
319
+ DELETE_REPLICA_FILES = {"description": "delete replica files",
320
+ "type": "array",
321
+ "items": DELETE_REPLICA_FILE,
322
+ "minItems": 1,
323
+ "maxItems": 1000}
324
+
325
+ CACHE_DELETE_REPLICAS = {"description": "rucio cache delete replicas",
326
+ "type": "object",
327
+ "properties": {"files": DELETE_REPLICA_FILES,
328
+ "rse": RSE,
329
+ "operation": {"enum": ["delete_replicas"]}},
330
+ "required": ['files', 'rse', 'operation']}
331
+
332
+ MESSAGE_OPERATION = {"type": "object",
333
+ "properties": {'operation': {"enum": ["add_replicas", "delete_replicas"]}}}
334
+
335
+ ACCOUNT_ATTRIBUTE = {"description": "Account attribute",
336
+ "type": "string",
337
+ "pattern": r'^[a-zA-Z0-9-_\\/\\.]{1,30}$'}
338
+
339
+ SCOPE_NAME_REGEXP = '/(.*)/(.*)'
340
+
341
+ DISTANCE = {"description": "RSE distance",
342
+ "type": "object",
343
+ "properties": {
344
+ "src_rse_id": {"type": "string"},
345
+ "dest_rse_id": {"type": "string"},
346
+ "ranking": {"type": "integer"}
347
+ },
348
+ "required": ["src_rse_id", "dest_rse_id", "ranking"],
349
+ "additionalProperties": True}
350
+
351
+ IMPORT = {"description": "import data into rucio.",
352
+ "type": "object",
353
+ "properties": {
354
+ "rses": {
355
+ "type": "object"
356
+ },
357
+ "distances": {
358
+ "type": "object"
359
+ }
360
+ }}
361
+
362
+ SCHEMAS = {'account': ACCOUNT,
363
+ 'account_type': ACCOUNT_TYPE,
364
+ 'activity': ACTIVITY,
365
+ 'name': NAME,
366
+ 'r_name': R_NAME,
367
+ 'rse': RSE,
368
+ 'rse_attribute': RSE_ATTRIBUTE,
369
+ 'scope': SCOPE,
370
+ 'r_scope': R_SCOPE,
371
+ 'did': DID,
372
+ 'did_filters': DID_FILTERS,
373
+ 'r_did': R_DID,
374
+ 'dids': DIDS,
375
+ 'rule': RULE,
376
+ 'r_dids': R_DIDS,
377
+ 'collection': COLLECTION,
378
+ 'collections': COLLECTIONS,
379
+ 'attachment': ATTACHMENT,
380
+ 'attachments': ATTACHMENTS,
381
+ 'subscription_filter': SUBSCRIPTION_FILTER,
382
+ 'cache_add_replicas': CACHE_ADD_REPLICAS,
383
+ 'cache_delete_replicas': CACHE_DELETE_REPLICAS,
384
+ 'account_attribute': ACCOUNT_ATTRIBUTE,
385
+ 'import': IMPORT}
386
+
387
+
388
+ def validate_schema(name, obj):
389
+ """
390
+ Validate object against json schema
391
+
392
+ :param name: The json schema name.
393
+ :param obj: The object to validate.
394
+ """
395
+ try:
396
+ if obj:
397
+ validate(obj, SCHEMAS.get(name, {}))
398
+ except ValidationError as error: # NOQA, pylint: disable=W0612
399
+ raise InvalidObject(f'Problem validating {name}: {error}')