rucio-clients 32.8.6__py3-none-any.whl → 35.8.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-clients might be problematic. Click here for more details.

Files changed (92) hide show
  1. rucio/__init__.py +0 -1
  2. rucio/alembicrevision.py +1 -2
  3. rucio/client/__init__.py +0 -1
  4. rucio/client/accountclient.py +45 -25
  5. rucio/client/accountlimitclient.py +37 -9
  6. rucio/client/baseclient.py +199 -154
  7. rucio/client/client.py +2 -3
  8. rucio/client/configclient.py +19 -6
  9. rucio/client/credentialclient.py +9 -4
  10. rucio/client/didclient.py +238 -63
  11. rucio/client/diracclient.py +13 -5
  12. rucio/client/downloadclient.py +162 -51
  13. rucio/client/exportclient.py +4 -4
  14. rucio/client/fileclient.py +3 -4
  15. rucio/client/importclient.py +4 -4
  16. rucio/client/lifetimeclient.py +21 -5
  17. rucio/client/lockclient.py +18 -8
  18. rucio/client/{metaclient.py → metaconventionsclient.py} +18 -15
  19. rucio/client/pingclient.py +0 -1
  20. rucio/client/replicaclient.py +15 -5
  21. rucio/client/requestclient.py +35 -19
  22. rucio/client/rseclient.py +133 -51
  23. rucio/client/ruleclient.py +29 -22
  24. rucio/client/scopeclient.py +8 -6
  25. rucio/client/subscriptionclient.py +47 -35
  26. rucio/client/touchclient.py +8 -4
  27. rucio/client/uploadclient.py +166 -82
  28. rucio/common/__init__.py +0 -1
  29. rucio/common/cache.py +4 -4
  30. rucio/common/config.py +52 -47
  31. rucio/common/constants.py +69 -2
  32. rucio/common/constraints.py +0 -1
  33. rucio/common/didtype.py +24 -22
  34. rucio/common/exception.py +281 -222
  35. rucio/common/extra.py +0 -1
  36. rucio/common/logging.py +54 -38
  37. rucio/common/pcache.py +122 -101
  38. rucio/common/plugins.py +153 -0
  39. rucio/common/policy.py +4 -4
  40. rucio/common/schema/__init__.py +17 -10
  41. rucio/common/schema/atlas.py +7 -5
  42. rucio/common/schema/belleii.py +7 -5
  43. rucio/common/schema/domatpc.py +7 -5
  44. rucio/common/schema/escape.py +7 -5
  45. rucio/common/schema/generic.py +8 -6
  46. rucio/common/schema/generic_multi_vo.py +7 -5
  47. rucio/common/schema/icecube.py +7 -5
  48. rucio/common/stomp_utils.py +0 -1
  49. rucio/common/stopwatch.py +0 -1
  50. rucio/common/test_rucio_server.py +2 -2
  51. rucio/common/types.py +262 -17
  52. rucio/common/utils.py +743 -451
  53. rucio/rse/__init__.py +3 -4
  54. rucio/rse/protocols/__init__.py +0 -1
  55. rucio/rse/protocols/bittorrent.py +184 -0
  56. rucio/rse/protocols/cache.py +1 -2
  57. rucio/rse/protocols/dummy.py +1 -2
  58. rucio/rse/protocols/gfal.py +12 -10
  59. rucio/rse/protocols/globus.py +7 -7
  60. rucio/rse/protocols/gsiftp.py +2 -3
  61. rucio/rse/protocols/http_cache.py +1 -2
  62. rucio/rse/protocols/mock.py +1 -2
  63. rucio/rse/protocols/ngarc.py +1 -2
  64. rucio/rse/protocols/posix.py +12 -13
  65. rucio/rse/protocols/protocol.py +116 -52
  66. rucio/rse/protocols/rclone.py +6 -7
  67. rucio/rse/protocols/rfio.py +4 -5
  68. rucio/rse/protocols/srm.py +9 -10
  69. rucio/rse/protocols/ssh.py +8 -9
  70. rucio/rse/protocols/storm.py +2 -3
  71. rucio/rse/protocols/webdav.py +17 -14
  72. rucio/rse/protocols/xrootd.py +23 -17
  73. rucio/rse/rsemanager.py +19 -7
  74. rucio/vcsversion.py +4 -4
  75. rucio/version.py +5 -13
  76. rucio_clients-35.8.0.data/data/requirements.client.txt +15 -0
  77. {rucio_clients-32.8.6.data → rucio_clients-35.8.0.data}/data/rucio_client/merge_rucio_configs.py +2 -5
  78. {rucio_clients-32.8.6.data → rucio_clients-35.8.0.data}/scripts/rucio +87 -85
  79. {rucio_clients-32.8.6.data → rucio_clients-35.8.0.data}/scripts/rucio-admin +45 -32
  80. {rucio_clients-32.8.6.dist-info → rucio_clients-35.8.0.dist-info}/METADATA +13 -13
  81. rucio_clients-35.8.0.dist-info/RECORD +88 -0
  82. {rucio_clients-32.8.6.dist-info → rucio_clients-35.8.0.dist-info}/WHEEL +1 -1
  83. {rucio_clients-32.8.6.dist-info → rucio_clients-35.8.0.dist-info}/licenses/AUTHORS.rst +3 -0
  84. rucio/common/schema/cms.py +0 -478
  85. rucio/common/schema/lsst.py +0 -423
  86. rucio_clients-32.8.6.data/data/requirements.txt +0 -55
  87. rucio_clients-32.8.6.dist-info/RECORD +0 -88
  88. {rucio_clients-32.8.6.data → rucio_clients-35.8.0.data}/data/etc/rse-accounts.cfg.template +0 -0
  89. {rucio_clients-32.8.6.data → rucio_clients-35.8.0.data}/data/etc/rucio.cfg.atlas.client.template +0 -0
  90. {rucio_clients-32.8.6.data → rucio_clients-35.8.0.data}/data/etc/rucio.cfg.template +0 -0
  91. {rucio_clients-32.8.6.dist-info → rucio_clients-35.8.0.dist-info}/licenses/LICENSE +0 -0
  92. {rucio_clients-32.8.6.dist-info → rucio_clients-35.8.0.dist-info}/top_level.txt +0 -0
rucio/common/types.py CHANGED
@@ -1,4 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
1
  # Copyright European Organization for Nuclear Research (CERN) since 2012
3
2
  #
4
3
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,14 +12,29 @@
13
12
  # See the License for the specific language governing permissions and
14
13
  # limitations under the License.
15
14
 
16
- from typing import Any, Optional, TypedDict, Union
15
+ import sys
16
+ from collections.abc import Callable
17
+ from datetime import datetime
18
+ from os import PathLike
17
19
 
20
+ if sys.version_info < (3, 11):
21
+ from typing_extensions import TYPE_CHECKING, Any, Literal, NotRequired, Optional, TypedDict, Union # noqa: UP035
22
+ PathTypeAlias = Union[PathLike, str]
23
+ else:
24
+ from typing import TYPE_CHECKING, Any, Literal, NotRequired, Optional, TypedDict, Union
25
+ PathTypeAlias = PathLike
18
26
 
19
- class InternalType(object):
27
+
28
+ if TYPE_CHECKING:
29
+ from rucio.common.constants import SUPPORTED_PROTOCOLS_LITERAL
30
+ from rucio.db.sqla.constants import AccountType, IdentityType, RequestState, RequestType
31
+
32
+
33
+ class InternalType:
20
34
  '''
21
35
  Base for Internal representations of string types
22
36
  '''
23
- def __init__(self, value, vo='def', fromExternal=True):
37
+ def __init__(self, value: Optional[str], vo: str = 'def', fromExternal: bool = True):
24
38
  if value is None:
25
39
  self.external = None
26
40
  self.internal = None
@@ -69,20 +83,22 @@ class InternalType(object):
69
83
  def __hash__(self):
70
84
  return hash(self.internal)
71
85
 
72
- def _calc_external(self):
86
+ def _calc_external(self) -> tuple[str, str]:
73
87
  ''' Utility to convert between internal and external representations'''
74
- split = self.internal.split('@', 1)
75
- if len(split) == 1: # if cannot convert, vo is '' and this is single vo
76
- vo = 'def'
77
- external = split[0]
78
- else:
79
- vo = split[1]
80
- external = split[0]
81
- return vo, external
88
+ if isinstance(self.internal, str):
89
+ split = self.internal.split('@', 1)
90
+ if len(split) == 1: # if cannot convert, vo is '' and this is single vo
91
+ vo = 'def'
92
+ external = split[0]
93
+ else:
94
+ vo = split[1]
95
+ external = split[0]
96
+ return vo, external
97
+ return '', ''
82
98
 
83
- def _calc_internal(self):
99
+ def _calc_internal(self) -> str:
84
100
  ''' Utility to convert between internal and external representations'''
85
- if self.vo == 'def':
101
+ if self.vo == 'def' and self.external is not None:
86
102
  return self.external
87
103
  internal = '{}@{}'.format(self.external, self.vo)
88
104
  return internal
@@ -92,7 +108,7 @@ class InternalAccount(InternalType):
92
108
  '''
93
109
  Internal representation of an account
94
110
  '''
95
- def __init__(self, account, vo='def', fromExternal=True):
111
+ def __init__(self, account: Optional[str], vo: str = 'def', fromExternal: bool = True):
96
112
  super(InternalAccount, self).__init__(value=account, vo=vo, fromExternal=fromExternal)
97
113
 
98
114
 
@@ -100,10 +116,13 @@ class InternalScope(InternalType):
100
116
  '''
101
117
  Internal representation of a scope
102
118
  '''
103
- def __init__(self, scope, vo='def', fromExternal=True):
119
+ def __init__(self, scope: Optional[str], vo: str = 'def', fromExternal: bool = True):
104
120
  super(InternalScope, self).__init__(value=scope, vo=vo, fromExternal=fromExternal)
105
121
 
106
122
 
123
+ LoggerFunction = Callable[..., Any]
124
+
125
+
107
126
  class RSEDomainLANDict(TypedDict):
108
127
  read: Optional[int]
109
128
  write: Optional[int]
@@ -156,3 +175,229 @@ class RSESettingsDict(TypedDict):
156
175
  deterministic: bool
157
176
  domain: list[str]
158
177
  protocols: list[RSEProtocolDict]
178
+
179
+
180
+ class RSEAccountCounterDict(TypedDict):
181
+ account: InternalAccount
182
+ rse_id: str
183
+
184
+
185
+ class RuleDict(TypedDict):
186
+ account: InternalAccount
187
+ copies: int
188
+ rse_expression: str
189
+ grouping: Literal['ALL', 'DATASET', 'NONE']
190
+ weight: Optional[str]
191
+ lifetime: Optional[int]
192
+ locked: bool
193
+ subscription_id: Optional[str]
194
+ source_replica_expression: Optional[str]
195
+ activity: str
196
+ notify: Optional[Literal['Y', 'N', 'C', 'P']]
197
+ purge_replicas: bool
198
+
199
+
200
+ class DIDDict(TypedDict):
201
+ name: str
202
+ scope: InternalScope
203
+
204
+
205
+ class DIDStringDict(TypedDict):
206
+ name: str
207
+ scope: str
208
+
209
+
210
+ class DatasetDict(DIDStringDict):
211
+ rse: str
212
+
213
+
214
+ class AttachDict(DatasetDict):
215
+ did: DIDStringDict
216
+
217
+
218
+ class HopDict(TypedDict):
219
+ source_rse_id: str
220
+ source_scheme: "SUPPORTED_PROTOCOLS_LITERAL"
221
+ source_scheme_priority: int
222
+ dest_rse_id: str
223
+ dest_scheme: "SUPPORTED_PROTOCOLS_LITERAL"
224
+ dest_scheme_priority: int
225
+
226
+
227
+ class TokenDict(TypedDict):
228
+ token: str
229
+ expires_at: datetime
230
+
231
+
232
+ class TokenValidationDict(TypedDict):
233
+ account: Optional[InternalAccount]
234
+ identity: Optional[str]
235
+ lifetime: datetime
236
+ audience: Optional[str]
237
+ authz_scope: Optional[str]
238
+
239
+
240
+ class IPDict(TypedDict):
241
+ ip: str
242
+ fqdn: str
243
+ site: str
244
+ latitude: Optional[float]
245
+ longitude: Optional[float]
246
+
247
+
248
+ class AccountDict(TypedDict):
249
+ account: InternalAccount
250
+ type: "AccountType"
251
+ email: str
252
+
253
+
254
+ class AccountAttributesDict(TypedDict):
255
+ key: str
256
+ value: Union[bool, str]
257
+
258
+
259
+ class IdentityDict(TypedDict):
260
+ type: "IdentityType"
261
+ identity: str
262
+ email: str
263
+
264
+
265
+ class UsageDict(TypedDict):
266
+ bytes: int
267
+ files: int
268
+ updated_at: Optional[datetime]
269
+
270
+
271
+ class AccountUsageModelDict(TypedDict):
272
+ account: InternalAccount
273
+ rse_id: str
274
+ files: int
275
+ bytes: int
276
+
277
+
278
+ class TraceBaseDict(TypedDict):
279
+ hostname: str
280
+ account: str
281
+ eventType: str
282
+ eventVersion: str
283
+ vo: Optional[str]
284
+ uuid: NotRequired[str]
285
+ scope: NotRequired[str]
286
+ datasetScope: NotRequired[str]
287
+ dataset: NotRequired[str]
288
+ remoteSite: NotRequired[str]
289
+ filesize: NotRequired[int]
290
+ stateReason: NotRequired[str]
291
+ protocol: NotRequired[str]
292
+ clientState: NotRequired[str]
293
+ transferStart: NotRequired[float]
294
+ transferEnd: NotRequired[float]
295
+
296
+
297
+ class TraceDict(TraceBaseDict):
298
+ uuid: str
299
+ scope: str
300
+ datasetScope: str
301
+ dataset: str
302
+ remoteSite: str
303
+ filesize: int
304
+ stateReason: str
305
+ protocol: str
306
+ clientState: str
307
+ transferStart: float
308
+ transferEnd: float
309
+
310
+
311
+ class TraceSchemaDict(TypedDict):
312
+ eventType: str
313
+
314
+
315
+ class FileToUploadDict(TypedDict):
316
+ path: PathTypeAlias
317
+ rse: str
318
+ did_scope: str
319
+ did_name: str
320
+ dataset_scope: NotRequired[str]
321
+ dataset_name: NotRequired[str]
322
+ dataset_meta: NotRequired[str]
323
+ impl: NotRequired[str]
324
+ force_scheme: NotRequired[str]
325
+ pfn: NotRequired[str]
326
+ no_register: NotRequired[bool]
327
+ register_after_upload: NotRequired[bool]
328
+ lifetime: NotRequired[int]
329
+ transfer_timeout: NotRequired[int]
330
+ guid: NotRequired[str]
331
+ recursive: NotRequired[bool]
332
+
333
+
334
+ class FileToUploadWithCollectedInfoDict(FileToUploadDict):
335
+ basename: str
336
+ adler32: str
337
+ md5: str
338
+ meta: dict[str, str]
339
+ state: str
340
+ dataset_did_str: NotRequired[str]
341
+ dirname: str
342
+ upload_result: dict
343
+ bytes: int
344
+ basename: str
345
+
346
+
347
+ class FileToUploadWithCollectedAndDatasetInfoDict(FileToUploadWithCollectedInfoDict):
348
+ dataset_scope: str
349
+ dataset_name: str
350
+
351
+
352
+ class RequestGatewayDict(TypedDict):
353
+ """
354
+ Request dict expected as input to gateway
355
+ """
356
+ scope: str
357
+ name: str
358
+ account: Optional[str]
359
+ dest_rse_id: str
360
+ request_type: "RequestType"
361
+ attributes: "RequestAttributesDict"
362
+
363
+
364
+ class RequestDict(TypedDict):
365
+ """
366
+ Requested dict used in core
367
+ """
368
+ id: str
369
+ request_id: str
370
+ scope: InternalScope
371
+ name: str
372
+ source_rse_id: str
373
+ dest_rse_id: str
374
+ dest_url: str
375
+ state: "RequestState"
376
+ account: NotRequired[InternalAccount]
377
+ rule_id: str
378
+ adler32: str
379
+ bytes: int
380
+ err_msg: str
381
+ sources: list[dict[str, Any]]
382
+ request_type: "RequestType"
383
+ retry_count: Optional[int]
384
+ previous_attempt_id: str
385
+ external_host: str
386
+ external_id: str
387
+ transfertool: str
388
+ attributes: "RequestAttributesDict"
389
+
390
+
391
+ class RequestAttributesDict(TypedDict):
392
+ activity: str
393
+ bytes: int
394
+ md5: str
395
+ adler32: str
396
+ is_intermediate_hop: bool
397
+
398
+
399
+ class FilterDict(TypedDict):
400
+ rule_id: str
401
+ request_id: str
402
+ older_than: datetime
403
+ activities: Union[list[str], str]