rucio-clients 37.0.0rc1__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 (104) hide show
  1. rucio/__init__.py +17 -0
  2. rucio/alembicrevision.py +15 -0
  3. rucio/cli/__init__.py +14 -0
  4. rucio/cli/account.py +216 -0
  5. rucio/cli/bin_legacy/__init__.py +13 -0
  6. rucio/cli/bin_legacy/rucio.py +2825 -0
  7. rucio/cli/bin_legacy/rucio_admin.py +2500 -0
  8. rucio/cli/command.py +272 -0
  9. rucio/cli/config.py +72 -0
  10. rucio/cli/did.py +191 -0
  11. rucio/cli/download.py +128 -0
  12. rucio/cli/lifetime_exception.py +33 -0
  13. rucio/cli/replica.py +162 -0
  14. rucio/cli/rse.py +293 -0
  15. rucio/cli/rule.py +158 -0
  16. rucio/cli/scope.py +40 -0
  17. rucio/cli/subscription.py +73 -0
  18. rucio/cli/upload.py +60 -0
  19. rucio/cli/utils.py +226 -0
  20. rucio/client/__init__.py +15 -0
  21. rucio/client/accountclient.py +432 -0
  22. rucio/client/accountlimitclient.py +183 -0
  23. rucio/client/baseclient.py +983 -0
  24. rucio/client/client.py +120 -0
  25. rucio/client/configclient.py +126 -0
  26. rucio/client/credentialclient.py +59 -0
  27. rucio/client/didclient.py +868 -0
  28. rucio/client/diracclient.py +56 -0
  29. rucio/client/downloadclient.py +1783 -0
  30. rucio/client/exportclient.py +44 -0
  31. rucio/client/fileclient.py +50 -0
  32. rucio/client/importclient.py +42 -0
  33. rucio/client/lifetimeclient.py +90 -0
  34. rucio/client/lockclient.py +109 -0
  35. rucio/client/metaconventionsclient.py +140 -0
  36. rucio/client/pingclient.py +44 -0
  37. rucio/client/replicaclient.py +452 -0
  38. rucio/client/requestclient.py +125 -0
  39. rucio/client/richclient.py +317 -0
  40. rucio/client/rseclient.py +746 -0
  41. rucio/client/ruleclient.py +294 -0
  42. rucio/client/scopeclient.py +90 -0
  43. rucio/client/subscriptionclient.py +173 -0
  44. rucio/client/touchclient.py +82 -0
  45. rucio/client/uploadclient.py +969 -0
  46. rucio/common/__init__.py +13 -0
  47. rucio/common/bittorrent.py +234 -0
  48. rucio/common/cache.py +111 -0
  49. rucio/common/checksum.py +168 -0
  50. rucio/common/client.py +122 -0
  51. rucio/common/config.py +788 -0
  52. rucio/common/constants.py +217 -0
  53. rucio/common/constraints.py +17 -0
  54. rucio/common/didtype.py +237 -0
  55. rucio/common/exception.py +1208 -0
  56. rucio/common/extra.py +31 -0
  57. rucio/common/logging.py +420 -0
  58. rucio/common/pcache.py +1409 -0
  59. rucio/common/plugins.py +185 -0
  60. rucio/common/policy.py +93 -0
  61. rucio/common/schema/__init__.py +200 -0
  62. rucio/common/schema/generic.py +416 -0
  63. rucio/common/schema/generic_multi_vo.py +395 -0
  64. rucio/common/stomp_utils.py +423 -0
  65. rucio/common/stopwatch.py +55 -0
  66. rucio/common/test_rucio_server.py +154 -0
  67. rucio/common/types.py +483 -0
  68. rucio/common/utils.py +1688 -0
  69. rucio/rse/__init__.py +96 -0
  70. rucio/rse/protocols/__init__.py +13 -0
  71. rucio/rse/protocols/bittorrent.py +194 -0
  72. rucio/rse/protocols/cache.py +111 -0
  73. rucio/rse/protocols/dummy.py +100 -0
  74. rucio/rse/protocols/gfal.py +708 -0
  75. rucio/rse/protocols/globus.py +243 -0
  76. rucio/rse/protocols/http_cache.py +82 -0
  77. rucio/rse/protocols/mock.py +123 -0
  78. rucio/rse/protocols/ngarc.py +209 -0
  79. rucio/rse/protocols/posix.py +250 -0
  80. rucio/rse/protocols/protocol.py +361 -0
  81. rucio/rse/protocols/rclone.py +365 -0
  82. rucio/rse/protocols/rfio.py +145 -0
  83. rucio/rse/protocols/srm.py +338 -0
  84. rucio/rse/protocols/ssh.py +414 -0
  85. rucio/rse/protocols/storm.py +195 -0
  86. rucio/rse/protocols/webdav.py +594 -0
  87. rucio/rse/protocols/xrootd.py +302 -0
  88. rucio/rse/rsemanager.py +881 -0
  89. rucio/rse/translation.py +260 -0
  90. rucio/vcsversion.py +11 -0
  91. rucio/version.py +45 -0
  92. rucio_clients-37.0.0rc1.data/data/etc/rse-accounts.cfg.template +25 -0
  93. rucio_clients-37.0.0rc1.data/data/etc/rucio.cfg.atlas.client.template +43 -0
  94. rucio_clients-37.0.0rc1.data/data/etc/rucio.cfg.template +241 -0
  95. rucio_clients-37.0.0rc1.data/data/requirements.client.txt +19 -0
  96. rucio_clients-37.0.0rc1.data/data/rucio_client/merge_rucio_configs.py +144 -0
  97. rucio_clients-37.0.0rc1.data/scripts/rucio +133 -0
  98. rucio_clients-37.0.0rc1.data/scripts/rucio-admin +97 -0
  99. rucio_clients-37.0.0rc1.dist-info/METADATA +54 -0
  100. rucio_clients-37.0.0rc1.dist-info/RECORD +104 -0
  101. rucio_clients-37.0.0rc1.dist-info/WHEEL +5 -0
  102. rucio_clients-37.0.0rc1.dist-info/licenses/AUTHORS.rst +100 -0
  103. rucio_clients-37.0.0rc1.dist-info/licenses/LICENSE +201 -0
  104. rucio_clients-37.0.0rc1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1208 @@
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
+ """
16
+ Exceptions used with Rucio.
17
+
18
+ The base exception class is :class:`. RucioException`.
19
+ Exceptions which are raised are all subclasses of it.
20
+
21
+ """
22
+
23
+ from typing import Optional
24
+
25
+ from rucio.common.constraints import AUTHORIZED_VALUE_TYPES
26
+
27
+
28
+ class RucioException(Exception):
29
+ """
30
+ To correctly use this class, inherit from it and define
31
+ a 'message' property. That message will get printf'd
32
+ with the keyword arguments provided to the constructor.
33
+ """
34
+
35
+ def __init__(self, *args):
36
+ super(RucioException, self).__init__(*args)
37
+ self._message = "An unknown exception occurred."
38
+ self.args = args
39
+ self.error_code = 1
40
+ self._error_string = None
41
+
42
+ def __str__(self):
43
+ self._error_string = self._message
44
+ if len(self.args) > 0:
45
+ # If there is a non-kwarg parameter, assume it's the error
46
+ # message or reason description and tack it on to the end
47
+ # of the exception message
48
+ # Convert all arguments into their string representations...
49
+ args = ["%s" % arg for arg in self.args if arg]
50
+ self._error_string = (self._error_string + "\nDetails: %s" % '\n'.join(args))
51
+ return self._error_string.strip()
52
+
53
+
54
+ # Please insert new exceptions sorted by error_code, not alphabetically.
55
+
56
+ class AccessDenied(RucioException):
57
+ """
58
+ AccessDenied
59
+ """
60
+ def __init__(self, *args):
61
+ super(AccessDenied, self).__init__(*args)
62
+ self._message = "Access to the requested resource denied."
63
+ self.error_code = 2
64
+
65
+
66
+ class AccountNotFound(RucioException):
67
+ """
68
+ AccountNotFound
69
+ """
70
+ def __init__(self, *args):
71
+ super(AccountNotFound, self).__init__(*args)
72
+ self._message = "Account does not exist."
73
+ self.error_code = 3
74
+
75
+
76
+ class CannotAuthenticate(RucioException):
77
+ """
78
+ CannotAuthenticate
79
+ """
80
+ def __init__(self, *args):
81
+ super(CannotAuthenticate, self).__init__(*args)
82
+ self._message = "Cannot authenticate."
83
+ self.error_code = 4
84
+
85
+
86
+ class ClientParameterMismatch(RucioException):
87
+ """
88
+ RucioException
89
+ """
90
+ def __init__(self, *args):
91
+ super(ClientParameterMismatch, self).__init__(*args)
92
+ self._message = "Client parameters don\'t match."
93
+ self.error_code = 5
94
+
95
+
96
+ class ClientProtocolNotSupported(RucioException):
97
+ """
98
+ Client protocol not supported
99
+ """
100
+
101
+ def __init__(self, host: str, protocol: str, protocols_allowed: Optional[list[str]] = None, *args):
102
+ super(ClientProtocolNotSupported, self).__init__(*args)
103
+ self._message = f"Client protocol '{protocol}' not supported when connecting to host '{host}'.{' Allowed protocols: ' + ', '.join(protocols_allowed) if protocols_allowed else ''}"
104
+ self.error_code = 6
105
+
106
+
107
+ class ConfigNotFound(RucioException):
108
+ """
109
+ RucioException
110
+ """
111
+ def __init__(self, *args):
112
+ super(ConfigNotFound, self).__init__(*args)
113
+ self._message = "Configuration not found."
114
+ self.error_code = 7
115
+
116
+
117
+ class ConfigurationError(RucioException):
118
+ """
119
+ RucioException
120
+ """
121
+ def __init__(self, *args):
122
+ super(ConfigurationError, self).__init__(*args)
123
+ self._message = "Error during configuration."
124
+ self.error_code = 8
125
+
126
+
127
+ class CounterNotFound(RucioException):
128
+ """
129
+ RucioException
130
+ """
131
+ def __init__(self, *args):
132
+ super(CounterNotFound, self).__init__(*args)
133
+ self._message = "The requested counter does not exist."
134
+ self.error_code = 9
135
+
136
+
137
+ class DatabaseException(RucioException):
138
+ """
139
+ RucioException
140
+ """
141
+ def __init__(self, *args):
142
+ super(DatabaseException, self).__init__(*args)
143
+ self._message = "Database exception."
144
+ self.error_code = 10
145
+
146
+
147
+ class DataIdentifierAlreadyExists(RucioException):
148
+ """
149
+ RucioException
150
+ """
151
+ def __init__(self, *args):
152
+ super(DataIdentifierAlreadyExists, self).__init__(*args)
153
+ self._message = "Data Identifier Already Exists."
154
+ self.error_code = 11
155
+
156
+
157
+ class DataIdentifierNotFound(RucioException):
158
+ """
159
+ RucioException
160
+ """
161
+ def __init__(self, *args):
162
+ super(DataIdentifierNotFound, self).__init__(*args)
163
+ self._message = "Data identifier not found."
164
+ self.error_code = 12
165
+
166
+
167
+ class DestinationNotAccessible(RucioException):
168
+ """
169
+ RucioException
170
+ """
171
+ def __init__(self, *args):
172
+ super(DestinationNotAccessible, self).__init__(*args)
173
+ self._message = "Access to local destination denied."
174
+ self.error_code = 13
175
+
176
+
177
+ class Duplicate(RucioException):
178
+ """
179
+ RucioException
180
+ """
181
+ def __init__(self, *args):
182
+ super(Duplicate, self).__init__(*args)
183
+ self._message = "An object with the same identifier already exists."
184
+ self.error_code = 14
185
+
186
+
187
+ class DuplicateContent(RucioException):
188
+ """
189
+ RucioException
190
+ """
191
+ def __init__(self, *args):
192
+ super(DuplicateContent, self).__init__(*args)
193
+ self._message = "Data identifier already added to the destination content."
194
+ self.error_code = 15
195
+
196
+
197
+ class DuplicateRule(RucioException):
198
+ """
199
+ RucioException
200
+ """
201
+ def __init__(self, *args):
202
+ super(DuplicateRule, self).__init__(*args)
203
+ self._message = "A duplicate rule for this account, did, rse_expression, copies already exists."
204
+ self.error_code = 16
205
+
206
+
207
+ class ErrorLoadingCredentials(RucioException):
208
+ """
209
+ RucioException
210
+ """
211
+ def __init__(self, *args):
212
+ super(ErrorLoadingCredentials, self).__init__(*args)
213
+ self._message = "Unable to to load user credentials."
214
+ self.error_code = 17
215
+
216
+
217
+ class FileAlreadyExists(RucioException):
218
+ """
219
+ RucioException
220
+ """
221
+ def __init__(self, *args):
222
+ super(FileAlreadyExists, self).__init__(*args)
223
+ self._message = "The file already exists."
224
+ self.error_code = 18
225
+
226
+
227
+ class FileConsistencyMismatch(RucioException):
228
+ """
229
+ RucioException
230
+ """
231
+ def __init__(self, *args):
232
+ super(FileConsistencyMismatch, self).__init__(*args)
233
+ self._message = "Error related to file consistency."
234
+ self.error_code = 19
235
+
236
+
237
+ class FileReplicaAlreadyExists(RucioException):
238
+ """
239
+ RucioException
240
+ """
241
+ def __init__(self, *args):
242
+ super(FileReplicaAlreadyExists, self).__init__(*args)
243
+ self._message = "File name in specified scope already exists"
244
+ self.error_code = 20
245
+
246
+
247
+ class ReplicaNotFound(RucioException):
248
+ """
249
+ RucioException
250
+ """
251
+ def __init__(self, *args):
252
+ super(ReplicaNotFound, self).__init__(*args)
253
+ self._message = "Replica not found"
254
+ self.error_code = 21
255
+
256
+
257
+ class ReplicaUnAvailable(RucioException):
258
+ """
259
+ RucioException
260
+ """
261
+ def __init__(self, *args):
262
+ super(ReplicaUnAvailable, self).__init__(*args)
263
+ self._message = "Replica unavailable"
264
+ self.error_code = 22
265
+
266
+
267
+ class FullStorage(RucioException):
268
+ """
269
+ RucioException
270
+ """
271
+ def __init__(self, *args):
272
+ super(FullStorage, self).__init__(*args)
273
+ self._message = "The Referenced storage is out of disk space."
274
+ self.error_code = 23
275
+
276
+
277
+ class IdentityError(RucioException):
278
+ """
279
+ RucioException
280
+ """
281
+ def __init__(self, *args):
282
+ super(IdentityError, self).__init__(*args)
283
+ self._message = "Identity error."
284
+ self.error_code = 24
285
+
286
+
287
+ class IdentityNotFound(RucioException):
288
+ def __init__(self, *args):
289
+ super(IdentityNotFound, self).__init__(*args)
290
+ self._message = "This identity does not exist."
291
+ self.error_code = 25
292
+
293
+
294
+ class InputValidationError(RucioException):
295
+ """
296
+ RucioException
297
+ """
298
+ def __init__(self, *args):
299
+ super(InputValidationError, self).__init__(*args)
300
+ self._message = "There is an error with one of the input parameters."
301
+ self.error_code = 26
302
+
303
+
304
+ class InsufficientAccountLimit(RucioException):
305
+ """
306
+ RucioException
307
+ """
308
+ def __init__(self, *args):
309
+ super(InsufficientAccountLimit, self).__init__(*args)
310
+ self._message = "There is not enough quota left to fulfil the operation."
311
+ self.error_code = 27
312
+
313
+
314
+ class InsufficientTargetRSEs(RucioException):
315
+ """
316
+ RucioException
317
+ """
318
+ def __init__(self, *args):
319
+ super(InsufficientTargetRSEs, self).__init__(*args)
320
+ self._message = "There are not enough target RSEs to fulfil the request at this time."
321
+ self.error_code = 28
322
+
323
+
324
+ class InvalidMetadata(RucioException):
325
+ """
326
+ RucioException
327
+ """
328
+ def __init__(self, *args):
329
+ super(InvalidMetadata, self).__init__(*args)
330
+ self._message = "Provided metadata is considered invalid."
331
+ self.error_code = 29
332
+
333
+
334
+ class InvalidObject(RucioException):
335
+ """
336
+ RucioException
337
+ """
338
+ def __init__(self, *args):
339
+ super(InvalidObject, self).__init__(*args)
340
+ self._message = "Provided object does not match schema."
341
+ self.error_code = 30
342
+
343
+
344
+ class InvalidReplicationRule(RucioException):
345
+ """
346
+ RucioException
347
+ """
348
+ def __init__(self, *args):
349
+ super(InvalidReplicationRule, self).__init__(*args)
350
+ self._message = "Provided replication rule is considered invalid."
351
+ self.error_code = 31
352
+
353
+
354
+ class InvalidRSEExpression(RucioException):
355
+ """
356
+ RucioException
357
+ """
358
+ def __init__(self, *args):
359
+ super(InvalidRSEExpression, self).__init__(*args)
360
+ self._message = "Provided RSE expression is considered invalid."
361
+ self.error_code = 32
362
+
363
+
364
+ class InvalidRuleWeight(RucioException):
365
+ """
366
+ RucioException
367
+ """
368
+ def __init__(self, *args):
369
+ super(InvalidRuleWeight, self).__init__(*args)
370
+ self._message = "An invalid weight value/type is used for an RSE."
371
+ self.error_code = 33
372
+
373
+
374
+ class InvalidType(RucioException):
375
+ """
376
+ RucioException
377
+ """
378
+ def __init__(self, *args):
379
+ super(InvalidType, self).__init__(*args)
380
+ self._message = "Provided type is considered invalid."
381
+ self.error_code = 34
382
+
383
+
384
+ class InvalidValueForKey(RucioException):
385
+ """
386
+ RucioException
387
+ """
388
+ def __init__(self, *args):
389
+ super(InvalidValueForKey, self).__init__(*args)
390
+ self._message = "Invalid value for the key."
391
+ self.error_code = 35
392
+
393
+
394
+ class InvalidRequest(RucioException):
395
+ """
396
+ RucioException
397
+ """
398
+ def __init__(self, *args):
399
+ super(InvalidRequest, self).__init__(*args)
400
+ self._message = "Request is considered invalid."
401
+ self.error_code = 36
402
+
403
+
404
+ class InvalidPath(RucioException):
405
+ """
406
+ RucioException
407
+ """
408
+ def __init__(self, *args):
409
+ super(InvalidPath, self).__init__(*args)
410
+ self._message = "The path provided is invalid."
411
+ self.error_code = 37
412
+
413
+
414
+ class KeyNotFound(RucioException):
415
+ """
416
+ RucioException
417
+ """
418
+ def __init__(self, *args):
419
+ super(KeyNotFound, self).__init__(*args)
420
+ self._message = "Key does not exist."
421
+ self.error_code = 38
422
+
423
+
424
+ class LifetimeExceptionDuplicate(RucioException):
425
+ """
426
+ RucioException
427
+ """
428
+ def __init__(self, *args):
429
+ super(LifetimeExceptionDuplicate, self).__init__(*args)
430
+ self._message = "An exception already exists."
431
+ self.error_code = 39
432
+
433
+
434
+ class LifetimeExceptionNotFound(RucioException):
435
+ """
436
+ RucioException
437
+ """
438
+ def __init__(self, *args):
439
+ super(LifetimeExceptionNotFound, self).__init__(*args)
440
+ self._message = "Exception does not exist."
441
+ self.error_code = 40
442
+
443
+
444
+ class ManualRuleApprovalBlocked(RucioException):
445
+ """
446
+ RucioException
447
+ """
448
+ def __init__(self, *args):
449
+ super(ManualRuleApprovalBlocked, self).__init__(*args)
450
+ self._message = "Manual rule approval is blocked on this RSE."
451
+ self.error_code = 41
452
+
453
+
454
+ class MissingClientParameter(RucioException):
455
+ """
456
+ RucioException
457
+ """
458
+ def __init__(self, *args):
459
+ super(MissingClientParameter, self).__init__(*args)
460
+ self._message = "Client parameters are missing."
461
+ self.error_code = 42
462
+
463
+
464
+ class MissingDependency(RucioException):
465
+ """
466
+ RucioException
467
+ """
468
+ def __init__(self, *args):
469
+ super(MissingDependency, self).__init__(*args)
470
+ self._message = "One dependency is missing."
471
+ self.error_code = 43
472
+
473
+
474
+ class MissingSourceReplica(RucioException):
475
+ """
476
+ RucioException
477
+ """
478
+ def __init__(self, *args):
479
+ super(MissingSourceReplica, self).__init__(*args)
480
+ self._message = "Source replicas are missing to fulfil the request at this moment."
481
+ self.error_code = 44
482
+
483
+
484
+ class NameTypeError(RucioException):
485
+ """
486
+ RucioException
487
+ """
488
+ def __init__(self, *args):
489
+ super(NameTypeError, self).__init__(*args)
490
+ self._message = "Name is of the wrong type"
491
+ self.error_code = 45
492
+
493
+
494
+ class NoAuthInformation(RucioException):
495
+ """
496
+ RucioException
497
+ """
498
+ def __init__(self, *args):
499
+ super(NoAuthInformation, self).__init__(*args)
500
+ self._message = "No authentication information passed."
501
+ self.error_code = 46
502
+
503
+
504
+ class NoFilesDownloaded(RucioException):
505
+ """
506
+ RucioException
507
+ """
508
+ def __init__(self, *args):
509
+ super(NoFilesDownloaded, self).__init__(*args)
510
+ self._message = "None of the requested files have been downloaded."
511
+ self.error_code = 75
512
+
513
+
514
+ class NotAllFilesDownloaded(RucioException):
515
+ """
516
+ RucioException
517
+ """
518
+ def __init__(self, *args):
519
+ super(NotAllFilesDownloaded, self).__init__(*args)
520
+ self._message = "Not all of the requested files have been downloaded."
521
+ self.error_code = 76
522
+
523
+
524
+ class ReplicationRuleCreationTemporaryFailed(RucioException):
525
+ """
526
+ RucioException
527
+ """
528
+ def __init__(self, *args):
529
+ super(ReplicationRuleCreationTemporaryFailed, self).__init__(*args)
530
+ self._message = "The creation of the replication rule failed at this time. Please try again later."
531
+ self.error_code = 47
532
+
533
+
534
+ class RequestNotFound(RucioException):
535
+ def __init__(self, *args):
536
+ super(RequestNotFound, self).__init__(*args)
537
+ self._message = "A request for this DID and RSE does not exist."
538
+ self.error_code = 48
539
+
540
+
541
+ class RSEAccessDenied(RucioException):
542
+ """
543
+ RucioException
544
+ """
545
+ def __init__(self, *args):
546
+ super(RSEAccessDenied, self).__init__(*args)
547
+ self._message = "Referenced RSE not reachable."
548
+ self.error_code = 49
549
+
550
+
551
+ class RSEWriteBlocked(RucioException):
552
+ """
553
+ RucioException
554
+ """
555
+ def __init__(self, *args):
556
+ super(RSEWriteBlocked, self).__init__(*args)
557
+ self._message = "RSE excluded; not available for writing."
558
+ self.error_code = 50
559
+
560
+
561
+ class RSENotConnected(RucioException):
562
+ """
563
+ RucioException
564
+ """
565
+ def __init__(self, *args):
566
+ super(RSENotConnected, self).__init__(*args)
567
+ self._message = "Connection to RSE not established."
568
+ self.error_code = 51
569
+
570
+
571
+ class RSENotFound(RucioException):
572
+ """
573
+ RucioException
574
+ """
575
+ def __init__(self, *args):
576
+ super(RSENotFound, self).__init__(*args)
577
+ self._message = "RSE does not exist."
578
+ self.error_code = 52
579
+
580
+
581
+ class RSEProtocolNotSupported(RucioException):
582
+ """
583
+ RucioException
584
+ """
585
+ def __init__(self, *args):
586
+ super(RSEProtocolNotSupported, self).__init__(*args)
587
+ self._message = "RSE does not support requested protocol."
588
+ self.error_code = 53
589
+
590
+
591
+ class RSEProtocolPriorityError(RucioException):
592
+ """
593
+ RucioException
594
+ """
595
+ def __init__(self, *args):
596
+ super(RSEProtocolPriorityError, self).__init__(*args)
597
+ self._message = "RSE does not support provided protocol priority for protocol."
598
+ self.error_code = 54
599
+
600
+
601
+ class RSEProtocolDomainNotSupported(RucioException):
602
+ """
603
+ RucioException
604
+ """
605
+ def __init__(self, *args):
606
+ super(RSEProtocolDomainNotSupported, self).__init__(*args)
607
+ self._message = "RSE does not support requested protocol scope."
608
+ self.error_code = 55
609
+
610
+
611
+ class RSEOperationNotSupported(RucioException):
612
+ """
613
+ RucioException
614
+ """
615
+ def __init__(self, *args):
616
+ super(RSEOperationNotSupported, self).__init__(*args)
617
+ self._message = "RSE does not support requested operation."
618
+ self.error_code = 56
619
+
620
+
621
+ class RSEFileNameNotSupported(RucioException):
622
+ """
623
+ RucioException
624
+ """
625
+ def __init__(self, *args):
626
+ super(RSEFileNameNotSupported, self).__init__(*args)
627
+ self._message = "RSE does not support provided filename."
628
+ self.error_code = 57
629
+
630
+
631
+ class RSEOverQuota(RucioException):
632
+ """
633
+ RucioException
634
+ """
635
+ def __init__(self, *args):
636
+ super(RSEOverQuota, self).__init__(*args)
637
+ self._message = "Quota of Referenced RSE is exceeded."
638
+ self.error_code = 58
639
+
640
+
641
+ class ResourceTemporaryUnavailable(RucioException):
642
+ """
643
+ RucioException
644
+ """
645
+ def __init__(self, *args):
646
+ super(ResourceTemporaryUnavailable, self).__init__(*args)
647
+ self._message = "The resource is temporary not available."
648
+ self.error_code = 59
649
+
650
+
651
+ class RuleNotFound(RucioException):
652
+ """
653
+ RucioException
654
+ """
655
+ def __init__(self, *args):
656
+ super(RuleNotFound, self).__init__(*args)
657
+ self._message = "No replication rule found."
658
+ self.error_code = 60
659
+
660
+
661
+ class RuleReplaceFailed(RucioException):
662
+ """
663
+ RucioException
664
+ """
665
+ def __init__(self, *args):
666
+ super(RuleReplaceFailed, self).__init__(*args)
667
+ self._message = "The replace operation for the rule failed."
668
+ self.error_code = 61
669
+
670
+
671
+ class ScratchDiskLifetimeConflict(RucioException):
672
+ """
673
+ RucioException
674
+ """
675
+ def __init__(self, *args):
676
+ super(ScratchDiskLifetimeConflict, self).__init__(*args)
677
+ self._message = "The requested replication rule exceeds the maximum SCRATCHDISK lifetime of 15 days."
678
+ self.error_code = 62
679
+
680
+
681
+ class ServiceUnavailable(RucioException):
682
+ """
683
+ RucioException
684
+ """
685
+ def __init__(self, *args):
686
+ super(ServiceUnavailable, self).__init__(*args)
687
+ self._message = "The requested service is not available at the moment."
688
+ self.error_code = 63
689
+
690
+
691
+ class ScopeAccessDenied(RucioException):
692
+ """
693
+ RucioException
694
+ """
695
+ def __init__(self, *args):
696
+ super(ScopeAccessDenied, self).__init__(*args)
697
+ self._message = "Access to Referenced scope denied."
698
+ self.error_code = 64
699
+
700
+
701
+ class ScopeNotFound(RucioException):
702
+ """
703
+ RucioException
704
+ """
705
+ def __init__(self, *args):
706
+ super(ScopeNotFound, self).__init__(*args)
707
+ self._message = "Scope does not exist."
708
+ self.error_code = 65
709
+
710
+
711
+ class SourceAccessDenied(RucioException):
712
+ """
713
+ RucioException
714
+ """
715
+ def __init__(self, *args):
716
+ super(SourceAccessDenied, self).__init__(*args)
717
+ self._message = "Access to local source file denied."
718
+ self.error_code = 66
719
+
720
+
721
+ class SourceNotFound(RucioException):
722
+ """
723
+ RucioException
724
+ """
725
+ def __init__(self, *args):
726
+ super(SourceNotFound, self).__init__(*args)
727
+ self._message = "Source file not found."
728
+ self.error_code = 67
729
+
730
+
731
+ class StagingAreaRuleRequiresLifetime(RucioException):
732
+ """
733
+ RucioException
734
+ """
735
+ def __init__(self, *args):
736
+ super(StagingAreaRuleRequiresLifetime, self).__init__(*args)
737
+ self._message = "A rule involving a staging area requires a lifetime!"
738
+ self.error_code = 68
739
+
740
+
741
+ class SubscriptionDuplicate(RucioException):
742
+ """
743
+ RucioException
744
+ """
745
+ def __init__(self, *args):
746
+ super(SubscriptionDuplicate, self).__init__(*args)
747
+ self._message = "A subscription with the same identifier already exists."
748
+ self.error_code = 69
749
+
750
+
751
+ class SubscriptionNotFound(RucioException):
752
+ """
753
+ RucioException
754
+ """
755
+ def __init__(self, *args):
756
+ super(SubscriptionNotFound, self).__init__(*args)
757
+ self._message = "Subscription not found."
758
+ self.error_code = 70
759
+
760
+
761
+ class UnsupportedDIDType(RucioException):
762
+ """
763
+ RucioException
764
+ """
765
+ def __init__(self, *args):
766
+ super(UnsupportedDIDType, self).__init__(*args)
767
+ self._message = "Unsupported DID type for this operation. Only DATASET or FILE is allowed."
768
+ self.error_code = 71
769
+
770
+
771
+ class UnsupportedOperation(RucioException):
772
+ """
773
+ RucioException
774
+ """
775
+ def __init__(self, *args):
776
+ super(UnsupportedOperation, self).__init__(*args)
777
+ self._message = "The resource doesn't support the requested operation."
778
+ self.error_code = 72
779
+
780
+
781
+ class UnsupportedStatus(RucioException):
782
+ """
783
+ RucioException
784
+ """
785
+ def __init__(self, *args):
786
+ super(UnsupportedStatus, self).__init__(*args)
787
+ self._message = "Unsupported data identifier status."
788
+ self.error_code = 73
789
+
790
+
791
+ class UnsupportedValueType(RucioException):
792
+ """
793
+ RucioException
794
+ """
795
+ def __init__(self, *args):
796
+ super(UnsupportedValueType, self).__init__(*args)
797
+ self._message = "Unsupported type for the value. List of supported types: %s." % str(AUTHORIZED_VALUE_TYPES)
798
+ self.error_code = 74
799
+
800
+
801
+ class MissingModuleException(RucioException):
802
+ """
803
+ RucioException
804
+ """
805
+ def __init__(self, *args):
806
+ super(MissingModuleException, self).__init__(*args)
807
+ self._message = "The module is not installed."
808
+ self.error_code = 77
809
+
810
+
811
+ class ServerConnectionException(RucioException):
812
+ """
813
+ RucioException
814
+ """
815
+ def __init__(self, *args):
816
+ super(ServerConnectionException, self).__init__(*args)
817
+ self._message = "Cannot connect to the Rucio server."
818
+ self.error_code = 78
819
+
820
+
821
+ class NoFilesUploaded(RucioException):
822
+ """
823
+ RucioException
824
+ """
825
+ def __init__(self, *args):
826
+ super(NoFilesUploaded, self).__init__(*args)
827
+ self._message = "None of the given files have been uploaded."
828
+ self.error_code = 79
829
+
830
+
831
+ class NotAllFilesUploaded(RucioException):
832
+ """
833
+ RucioException
834
+ """
835
+ def __init__(self, *args):
836
+ super(NotAllFilesUploaded, self).__init__(*args)
837
+ self._message = "Not all of the given files have been uploaded."
838
+ self.error_code = 80
839
+
840
+
841
+ class RSEChecksumUnavailable(RucioException):
842
+ """
843
+ Cannot retrieve checksum from RSE
844
+ """
845
+ def __init__(self, *args):
846
+ super(RSEChecksumUnavailable, self).__init__(*args)
847
+ self._message = "RSE checksum unavailable."
848
+ self.error_code = 81
849
+
850
+
851
+ class UndefinedPolicy(RucioException):
852
+ """
853
+ Cannot find a defined policy in the Rucio config
854
+ """
855
+ def __init__(self, *args):
856
+ super(UndefinedPolicy, self).__init__(*args)
857
+ self._message = "No policy is defined."
858
+ self.error_code = 82
859
+
860
+
861
+ class TransferToolTimeout(RucioException):
862
+ """
863
+ Timeout from the transfer tool
864
+ """
865
+ def __init__(self, *args):
866
+ super(TransferToolTimeout, self).__init__(*args)
867
+ self._message = "Timeout from the transfer tool."
868
+ self.error_code = 83
869
+
870
+
871
+ class TransferToolWrongAnswer(RucioException):
872
+ """
873
+ Wrong answer returned by the transfer tool
874
+ """
875
+ def __init__(self, *args):
876
+ super(TransferToolWrongAnswer, self).__init__(*args)
877
+ self._message = "Wrong answer returned by the transfer tool."
878
+ self.error_code = 84
879
+
880
+
881
+ class RSEAttributeNotFound(RucioException):
882
+ """
883
+ RSE attribute not found.
884
+ """
885
+ def __init__(self, *args):
886
+ super(RSEAttributeNotFound, self).__init__(*args)
887
+ self._message = "RSE attribute not found."
888
+ self.error_code = 85
889
+
890
+
891
+ class UnsupportedKeyType(RucioException):
892
+ """
893
+ RucioException
894
+ """
895
+ def __init__(self, *args):
896
+ super(UnsupportedKeyType, self).__init__(*args)
897
+ self._message = "Unsupported type for the key."
898
+ self.error_code = 86
899
+
900
+
901
+ class MetalinkJsonParsingError(RucioException):
902
+ """
903
+ Failed to parse input with metalink and json
904
+ """
905
+ def __init__(self, data, metalink_err, json_err, *args):
906
+ super(MetalinkJsonParsingError, self).__init__(*args)
907
+ self._message = 'Failed parsing of %s. MetalinkError: %s. JsonError: %s' % (data, metalink_err, json_err)
908
+ self.error_code = 87
909
+
910
+
911
+ class ReplicaIsLocked(RucioException):
912
+ """
913
+ Replica has one or more locks.
914
+ """
915
+ def __init__(self, *args):
916
+ super(ReplicaIsLocked, self).__init__(*args)
917
+ self._message = 'Replica is locked'
918
+ self.error_code = 88
919
+
920
+
921
+ class UnsupportedRequestedContentType(RucioException):
922
+ """
923
+ The requested content type is not supported by the API endpoint.
924
+ """
925
+ def __init__(self, *args):
926
+ super(UnsupportedRequestedContentType, self).__init__(*args)
927
+ self._message = 'The requested content type is not supported.'
928
+ self.error_code = 89
929
+
930
+
931
+ class DuplicateFileTransferSubmission(RucioException):
932
+ """
933
+ A transfer for the same file is already submitted to the Transfer Tool.
934
+ """
935
+ def __init__(self, *args):
936
+ super(DuplicateFileTransferSubmission, self).__init__(*args)
937
+ self._message = 'One or more files are already submitted to the transfer tool'
938
+ self.error_code = 90
939
+
940
+
941
+ class DIDError(RucioException):
942
+ """
943
+ An operation related to DID type went wrong
944
+ """
945
+ def __init__(self, *args):
946
+ super(DIDError, self).__init__(*args)
947
+ self._message = 'Error using DID type'
948
+ self.error_code = 91
949
+
950
+
951
+ class NoDistance(RucioException):
952
+ """
953
+ No distance can be found between 2 RSEs
954
+ """
955
+ def __init__(self, *args):
956
+ super(NoDistance, self).__init__(*args)
957
+ self._message = 'Cannot found a distance between 2 RSEs'
958
+ self.error_code = 92
959
+
960
+
961
+ class PolicyPackageBaseException(RucioException):
962
+ """
963
+ Base exception for policy package errors.
964
+ """
965
+ def __init__(self, package: str, *args):
966
+ super(PolicyPackageBaseException, self).__init__(*args)
967
+ self.package = package
968
+
969
+
970
+ class PolicyPackageNotFound(PolicyPackageBaseException):
971
+ """
972
+ The policy package specified in the config file was not found
973
+ """
974
+ def __init__(self, package: str, *args):
975
+ super(PolicyPackageNotFound, self).__init__(package, *args)
976
+ self._message = 'The specified policy package %s was not found' % self.package
977
+ self.error_code = 93
978
+
979
+
980
+ class CannotAuthorize(RucioException):
981
+ """
982
+ Failed to authorize an operation.
983
+ """
984
+ def __init__(self, *args):
985
+ super(CannotAuthorize, self).__init__(*args)
986
+ self._message = 'Can not authorize operation.'
987
+ self.error_code = 94
988
+
989
+
990
+ class SubscriptionWrongParameter(RucioException):
991
+ """
992
+ RucioException
993
+ """
994
+ def __init__(self, *args):
995
+ super(SubscriptionWrongParameter, self).__init__(*args)
996
+ self._message = "Subscription wrong parameters"
997
+ self.error_code = 95
998
+
999
+
1000
+ class VONotFound(RucioException):
1001
+ """
1002
+ Requested VO does not exist.
1003
+ """
1004
+ def __init__(self, *args):
1005
+ super(VONotFound, self).__init__(*args)
1006
+ self._message = 'The requested VO does not exist'
1007
+ self.error_code = 96
1008
+
1009
+
1010
+ class UnsupportedAccountName(RucioException):
1011
+ """
1012
+ Requested account name is not supported for users.
1013
+ """
1014
+ def __init__(self, *args):
1015
+ super(UnsupportedAccountName, self).__init__(*args)
1016
+ self._message = 'The requested account name cannot be used'
1017
+ self.error_code = 97
1018
+
1019
+
1020
+ class DuplicateCriteriaInDIDFilter(RucioException):
1021
+ """
1022
+ Duplicate criteria found in DID filter.
1023
+ """
1024
+ def __init__(self, *args):
1025
+ super(DuplicateCriteriaInDIDFilter, self).__init__(*args)
1026
+ self._message = 'Duplicate criteria for key/operator in filter expression: {}'.format(args[0])
1027
+ self.error_code = 98
1028
+
1029
+
1030
+ class DIDFilterSyntaxError(RucioException):
1031
+ """
1032
+ DID filter is not parsable.
1033
+ """
1034
+ def __init__(self, *args):
1035
+ super(DIDFilterSyntaxError, self).__init__(*args)
1036
+ self._message = 'Syntax error in filter expression.'
1037
+ self.error_code = 99
1038
+
1039
+
1040
+ class InvalidAlgorithmName(RucioException):
1041
+ """
1042
+ The given algorithm name is not valid for the VO.
1043
+ """
1044
+ def __init__(self, algorithm, vo, *args):
1045
+ super(InvalidAlgorithmName, self).__init__(*args)
1046
+ self.message = 'Algorithm name %s is not valid for VO %s' % (algorithm, vo)
1047
+ self.error_code = 100
1048
+
1049
+
1050
+ class FilterEngineGenericError(RucioException):
1051
+ """
1052
+ Generic Filter Engine error.
1053
+ """
1054
+ def __init__(self, *args):
1055
+ super(FilterEngineGenericError, self).__init__(*args)
1056
+ self._message = 'Generic filter engine error.'
1057
+ self.error_code = 101
1058
+
1059
+
1060
+ class MetadataSchemaMismatchError(RucioException):
1061
+ """
1062
+ External table does not match expected table schema.
1063
+ """
1064
+ def __init__(self, *args):
1065
+ super(MetadataSchemaMismatchError, self).__init__(*args)
1066
+ self._message = 'The external table does not match the expected table schema.'
1067
+ self.error_code = 102
1068
+
1069
+
1070
+ class PolicyPackageVersionError(PolicyPackageBaseException):
1071
+ """
1072
+ Policy package is not compatible with this version of Rucio.
1073
+ """
1074
+ def __init__(self, package: str, rucio_version: str, supported_versionset: str, *args):
1075
+ super(PolicyPackageVersionError, self).__init__(package, *args)
1076
+ self.rucio_version = rucio_version
1077
+ self.supported_versionset = supported_versionset
1078
+ self._message = 'Policy package %s is not compatible with this Rucio version.\nRucio version: %s\nVersions supported by the package: %s' % (
1079
+ self.package,
1080
+ self.rucio_version,
1081
+ self.supported_versionset
1082
+ )
1083
+ self.error_code = 103
1084
+
1085
+
1086
+ class InvalidSourceReplicaExpression(RucioException):
1087
+ """
1088
+ Source Replica Expression Considered Invalid
1089
+ """
1090
+
1091
+ def __init__(self, *args):
1092
+ super(InvalidSourceReplicaExpression, self).__init__(*args)
1093
+ self._message = 'Provided Source Replica expression is considered invalid.'
1094
+ self.error_code = 104
1095
+
1096
+
1097
+ class DeprecationError(RucioException):
1098
+ """
1099
+ Function has been deprecated.
1100
+ """
1101
+ def __init__(self, *args):
1102
+ super(DeprecationError, self).__init__(*args)
1103
+ self._message = 'Command or function has been deprecated.'
1104
+ self.error_code = 105
1105
+
1106
+
1107
+ class SortingAlgorithmNotSupported(RucioException):
1108
+ """
1109
+ Sorting algorithm is not supported.
1110
+ """
1111
+ def __init__(self, *args):
1112
+ super(SortingAlgorithmNotSupported, self).__init__(*args)
1113
+ self._message = 'Sorting algorithm is not supported.'
1114
+ self.error_code = 106
1115
+
1116
+
1117
+ class ErrorLoadingPolicyPackage(PolicyPackageBaseException):
1118
+ """
1119
+ An error occurred while loading the policy package.
1120
+ """
1121
+ def __init__(self, package: str, *args):
1122
+ super(ErrorLoadingPolicyPackage, self).__init__(package, *args)
1123
+ self._message = 'An error occurred while loading the policy package %s' % self.package
1124
+ self.error_code = 107
1125
+
1126
+
1127
+ class TraceValidationSchemaNotFound(RucioException):
1128
+ """
1129
+ Trace validation schema not found.
1130
+ """
1131
+ def __init__(self, *args):
1132
+ super(TraceValidationSchemaNotFound, self).__init__(*args)
1133
+ self._message = 'Trace validation schema not found.'
1134
+ self.error_code = 108
1135
+
1136
+
1137
+ class PolicyPackageIsNotVersioned(PolicyPackageBaseException):
1138
+ """
1139
+ Policy package does not contain version information.
1140
+ """
1141
+ def __init__(self, package: str, *args):
1142
+ super(PolicyPackageIsNotVersioned, self).__init__(package, *args)
1143
+ self._message = 'Policy package %s does not include information about which Rucio versions it supports.' % self.package
1144
+ self.error_code = 109
1145
+
1146
+
1147
+ class UnsupportedMetadataPlugin(RucioException):
1148
+ """
1149
+ Raised when attempting to use a metadata plugin that is not enabled on the server.
1150
+ """
1151
+ def __init__(self, *args):
1152
+ super(UnsupportedMetadataPlugin, self).__init__(*args)
1153
+ self._message = "The requested metadata plugin is not enabled on the server."
1154
+ self.error_code = 110
1155
+
1156
+
1157
+ class ChecksumCalculationError(RucioException):
1158
+ """
1159
+ An error occurred while calculating the checksum.
1160
+ """
1161
+ def __init__(
1162
+ self,
1163
+ algorithm_name: str,
1164
+ filepath: str,
1165
+ *args,
1166
+ **kwargs
1167
+ ):
1168
+ super(ChecksumCalculationError, self).__init__(*args, **kwargs)
1169
+ self.algorithm_name = algorithm_name
1170
+ self.filepath = filepath
1171
+ self._message = 'An error occurred while calculating the %s checksum of file %s.' % (self.algorithm_name, self.filepath)
1172
+ self.error_code = 111
1173
+
1174
+
1175
+ class ConfigLoadingError(RucioException):
1176
+ """
1177
+ An error occurred while loading the configuration.
1178
+ """
1179
+ def __init__(
1180
+ self,
1181
+ config_file: str,
1182
+ *args,
1183
+ **kwargs
1184
+ ):
1185
+ super(ConfigLoadingError, self).__init__(*args, **kwargs)
1186
+ self._message = 'Could not load Rucio configuration file. Rucio tried loading the following configuration file:\n\t %s' % (config_file)
1187
+ self.error_code = 112
1188
+
1189
+
1190
+ class ClientProtocolNotFound(RucioException):
1191
+ """
1192
+ Missing protocol in client configuration (e.g. no http/https in url).
1193
+ """
1194
+
1195
+ def __init__(self, host: str, protocols_allowed: Optional[list[str]] = None, *args):
1196
+ super(ClientProtocolNotFound, self).__init__(*args)
1197
+ self._message = f"Client protocol missing when connecting to host '{host}'.{' Allowed protocols: ' + ', '.join(protocols_allowed) if protocols_allowed else ''}"
1198
+ self.error_code = 113
1199
+
1200
+
1201
+ class ConnectionParameterNotFound(RucioException):
1202
+ """
1203
+ Thrown when a required connection parameter is missing.
1204
+ """
1205
+ def __init__(self, param: str, *args):
1206
+ super(ConnectionParameterNotFound, self).__init__(*args)
1207
+ self._message = f"Required connection parameter '{param}' is not provided."
1208
+ self.error_code = 114