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/__init__.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");
rucio/alembicrevision.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,4 +12,4 @@
13
12
  # See the License for the specific language governing permissions and
14
13
  # limitations under the License.
15
14
 
16
- ALEMBIC_REVISION = '27e3a68927fb' # the current alembic head revision
15
+ ALEMBIC_REVISION = 'b0070f3695c8' # the current alembic head revision
rucio/client/__init__.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");
@@ -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");
@@ -14,14 +13,17 @@
14
13
  # limitations under the License.
15
14
 
16
15
  from json import dumps
16
+ from typing import TYPE_CHECKING, Any, Optional
17
17
  from urllib.parse import quote_plus
18
18
 
19
19
  from requests.status_codes import codes
20
20
 
21
- from rucio.client.baseclient import BaseClient
22
- from rucio.client.baseclient import choice
21
+ from rucio.client.baseclient import BaseClient, choice
23
22
  from rucio.common.utils import build_url
24
23
 
24
+ if TYPE_CHECKING:
25
+ from collections.abc import Iterator
26
+
25
27
 
26
28
  class AccountClient(BaseClient):
27
29
 
@@ -29,7 +31,7 @@ class AccountClient(BaseClient):
29
31
 
30
32
  ACCOUNTS_BASEURL = 'accounts'
31
33
 
32
- def add_account(self, account, type_, email):
34
+ def add_account(self, account: str, type_: str, email: str) -> bool:
33
35
  """
34
36
  Sends the request to create a new account.
35
37
 
@@ -51,7 +53,7 @@ class AccountClient(BaseClient):
51
53
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
52
54
  raise exc_cls(exc_msg)
53
55
 
54
- def delete_account(self, account):
56
+ def delete_account(self, account: str) -> bool:
55
57
  """
56
58
  Sends the request to disable an account.
57
59
 
@@ -70,7 +72,7 @@ class AccountClient(BaseClient):
70
72
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
71
73
  raise exc_cls(exc_msg)
72
74
 
73
- def get_account(self, account):
75
+ def get_account(self, account: str) -> Optional[dict[str, Any]]:
74
76
  """
75
77
  Sends the request to get information about a given account.
76
78
 
@@ -89,7 +91,7 @@ class AccountClient(BaseClient):
89
91
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
90
92
  raise exc_cls(exc_msg)
91
93
 
92
- def update_account(self, account, key, value):
94
+ def update_account(self, account: str, key: str, value: Any) -> bool:
93
95
  """ Update a property of an account.
94
96
 
95
97
  :param account: Name of the account.
@@ -108,13 +110,18 @@ class AccountClient(BaseClient):
108
110
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
109
111
  raise exc_cls(exc_msg)
110
112
 
111
- def list_accounts(self, account_type=None, identity=None, filters=None):
113
+ def list_accounts(
114
+ self,
115
+ account_type: Optional[str] = None,
116
+ identity: Optional[str] = None,
117
+ filters: Optional[dict[str, Any]] = None
118
+ ) -> "Iterator[dict[str, Any]]":
112
119
  """
113
120
  Sends the request to list all rucio accounts.
114
121
 
115
122
  :param type: The account type
116
123
  :param identity: The identity key name. For example x509 DN, or a username.
117
- :param filters: A dictionnary key:account attribute to use for the filtering
124
+ :param filters: A dictionary key:account attribute to use for the filtering
118
125
 
119
126
  :return: a list containing account info dictionary for all rucio accounts.
120
127
  :raises AccountNotFound: if account doesn't exist.
@@ -139,7 +146,7 @@ class AccountClient(BaseClient):
139
146
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
140
147
  raise exc_cls(exc_msg)
141
148
 
142
- def whoami(self):
149
+ def whoami(self) -> Optional[dict[str, Any]]:
143
150
  """
144
151
  Get information about account whose token is used
145
152
 
@@ -148,7 +155,15 @@ class AccountClient(BaseClient):
148
155
  """
149
156
  return self.get_account('whoami')
150
157
 
151
- def add_identity(self, account, identity, authtype, email, default=False, password=None):
158
+ def add_identity(
159
+ self,
160
+ account: str,
161
+ identity: str,
162
+ authtype: str,
163
+ email: str,
164
+ default: bool = False,
165
+ password: Optional[str] = None
166
+ ) -> bool:
152
167
  """
153
168
  Adds a membership association between identity and account.
154
169
 
@@ -173,7 +188,12 @@ class AccountClient(BaseClient):
173
188
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
174
189
  raise exc_cls(exc_msg)
175
190
 
176
- def del_identity(self, account, identity, authtype):
191
+ def del_identity(
192
+ self,
193
+ account: str,
194
+ identity: str,
195
+ authtype: str
196
+ ) -> bool:
177
197
  """
178
198
  Delete an identity's membership association with an account.
179
199
 
@@ -196,7 +216,7 @@ class AccountClient(BaseClient):
196
216
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
197
217
  raise exc_cls(exc_msg)
198
218
 
199
- def list_identities(self, account):
219
+ def list_identities(self, account: str) -> "Iterator[dict[str, Any]]":
200
220
  """
201
221
  List all identities on an account.
202
222
 
@@ -212,7 +232,7 @@ class AccountClient(BaseClient):
212
232
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
213
233
  raise exc_cls(exc_msg)
214
234
 
215
- def list_account_rules(self, account):
235
+ def list_account_rules(self, account: str) -> "Iterator[dict[str, Any]]":
216
236
  """
217
237
  List the associated rules of an account.
218
238
 
@@ -228,7 +248,7 @@ class AccountClient(BaseClient):
228
248
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
229
249
  raise exc_cls(exc_msg)
230
250
 
231
- def get_account_limits(self, account, rse_expression, locality):
251
+ def get_account_limits(self, account: str, rse_expression: str, locality: str) -> dict[str, Any]:
232
252
  """
233
253
  Return the correct account limits for the given locality.
234
254
 
@@ -245,7 +265,7 @@ class AccountClient(BaseClient):
245
265
  from rucio.common.exception import UnsupportedOperation
246
266
  raise UnsupportedOperation('The provided locality (%s) for the account limit was invalid' % locality)
247
267
 
248
- def get_global_account_limit(self, account, rse_expression):
268
+ def get_global_account_limit(self, account: str, rse_expression: str) -> dict[str, Any]:
249
269
  """
250
270
  List the account limit for the specific RSE expression.
251
271
 
@@ -261,7 +281,7 @@ class AccountClient(BaseClient):
261
281
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
262
282
  raise exc_cls(exc_msg)
263
283
 
264
- def get_global_account_limits(self, account):
284
+ def get_global_account_limits(self, account: str) -> dict[str, Any]:
265
285
  """
266
286
  List all RSE expression limits of this account.
267
287
 
@@ -276,7 +296,7 @@ class AccountClient(BaseClient):
276
296
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
277
297
  raise exc_cls(exc_msg)
278
298
 
279
- def get_local_account_limits(self, account):
299
+ def get_local_account_limits(self, account: str) -> dict[str, Any]:
280
300
  """
281
301
  List the account rse limits of this account.
282
302
 
@@ -291,7 +311,7 @@ class AccountClient(BaseClient):
291
311
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
292
312
  raise exc_cls(exc_msg)
293
313
 
294
- def get_local_account_limit(self, account, rse):
314
+ def get_local_account_limit(self, account: str, rse: str) -> dict[str, Any]:
295
315
  """
296
316
  List the account rse limits of this account for the specific rse.
297
317
 
@@ -307,7 +327,7 @@ class AccountClient(BaseClient):
307
327
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
308
328
  raise exc_cls(exc_msg)
309
329
 
310
- def get_local_account_usage(self, account, rse=None):
330
+ def get_local_account_usage(self, account: str, rse: Optional[str] = None) -> "Iterator[dict[str, Any]]":
311
331
  """
312
332
  List the account usage for one or all rses of this account.
313
333
 
@@ -326,7 +346,7 @@ class AccountClient(BaseClient):
326
346
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
327
347
  raise exc_cls(exc_msg)
328
348
 
329
- def get_global_account_usage(self, account, rse_expression=None):
349
+ def get_global_account_usage(self, account: str, rse_expression: Optional[str] = None) -> "Iterator[dict[str, Any]]":
330
350
  """
331
351
  List the account usage for one or all RSE expressions of this account.
332
352
 
@@ -345,7 +365,7 @@ class AccountClient(BaseClient):
345
365
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
346
366
  raise exc_cls(exc_msg)
347
367
 
348
- def get_account_usage_history(self, account, rse):
368
+ def get_account_usage_history(self, account: str, rse: str) -> dict[str, Any]:
349
369
  """
350
370
  List the account usage history of this account on rse.
351
371
 
@@ -361,7 +381,7 @@ class AccountClient(BaseClient):
361
381
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
362
382
  raise exc_cls(exc_msg)
363
383
 
364
- def list_account_attributes(self, account):
384
+ def list_account_attributes(self, account: str) -> "Iterator[dict[dict[str, Any], Any]]":
365
385
  """
366
386
  List the attributes for an account.
367
387
 
@@ -376,7 +396,7 @@ class AccountClient(BaseClient):
376
396
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
377
397
  raise exc_cls(exc_msg)
378
398
 
379
- def add_account_attribute(self, account, key, value):
399
+ def add_account_attribute(self, account: str, key: str, value: Any) -> bool:
380
400
  """
381
401
  Adds an attribute to an account.
382
402
 
@@ -395,7 +415,7 @@ class AccountClient(BaseClient):
395
415
  exc_cls, exc_msg = self._get_exception(headers=res.headers, status_code=res.status_code, data=res.content)
396
416
  raise exc_cls(exc_msg)
397
417
 
398
- def delete_account_attribute(self, account, key):
418
+ def delete_account_attribute(self, account: str, key: str) -> bool:
399
419
  """
400
420
  Delete an attribute for an account.
401
421
 
@@ -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");
@@ -14,12 +13,12 @@
14
13
  # limitations under the License.
15
14
 
16
15
  from json import dumps
16
+ from typing import Literal
17
17
  from urllib.parse import quote_plus
18
18
 
19
19
  from requests.status_codes import codes
20
20
 
21
- from rucio.client.baseclient import BaseClient
22
- from rucio.client.baseclient import choice
21
+ from rucio.client.baseclient import BaseClient, choice
23
22
  from rucio.common.utils import build_url
24
23
 
25
24
 
@@ -29,7 +28,13 @@ class AccountLimitClient(BaseClient):
29
28
 
30
29
  ACCOUNTLIMIT_BASEURL = 'accountlimits'
31
30
 
32
- def set_account_limit(self, account, rse, bytes_, locality):
31
+ def set_account_limit(
32
+ self,
33
+ account: str,
34
+ rse: str,
35
+ bytes_: int,
36
+ locality: Literal['local', 'global']
37
+ ) -> bool:
33
38
  """
34
39
  Sets an account limit for a given limit scope.
35
40
 
@@ -48,7 +53,12 @@ class AccountLimitClient(BaseClient):
48
53
  from rucio.common.exception import UnsupportedOperation
49
54
  raise UnsupportedOperation('The provided scope (%s) for the account limit was invalid' % locality)
50
55
 
51
- def delete_account_limit(self, account, rse, locality):
56
+ def delete_account_limit(
57
+ self,
58
+ account: str,
59
+ rse: str,
60
+ locality: Literal['local', 'global']
61
+ ) -> bool:
52
62
  """
53
63
  Deletes an account limit for a given limit scope.
54
64
 
@@ -66,7 +76,12 @@ class AccountLimitClient(BaseClient):
66
76
  from rucio.common.exception import UnsupportedOperation
67
77
  raise UnsupportedOperation('The provided scope (%s) for the account limit was invalid' % locality)
68
78
 
69
- def set_local_account_limit(self, account, rse, bytes_):
79
+ def set_local_account_limit(
80
+ self,
81
+ account: str,
82
+ rse: str,
83
+ bytes_: int
84
+ ) -> bool:
70
85
  """
71
86
  Sends the request to set an account limit for an account.
72
87
 
@@ -88,7 +103,11 @@ class AccountLimitClient(BaseClient):
88
103
  exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
89
104
  raise exc_cls(exc_msg)
90
105
 
91
- def delete_local_account_limit(self, account, rse):
106
+ def delete_local_account_limit(
107
+ self,
108
+ account: str,
109
+ rse: str
110
+ ) -> bool:
92
111
  """
93
112
  Sends the request to remove an account limit.
94
113
 
@@ -110,7 +129,12 @@ class AccountLimitClient(BaseClient):
110
129
  exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
111
130
  raise exc_cls(exc_msg)
112
131
 
113
- def set_global_account_limit(self, account, rse_expression, bytes_):
132
+ def set_global_account_limit(
133
+ self,
134
+ account: str,
135
+ rse_expression: str,
136
+ bytes_: int
137
+ ) -> bool:
114
138
  """
115
139
  Sends the request to set a global account limit for an account.
116
140
 
@@ -132,7 +156,11 @@ class AccountLimitClient(BaseClient):
132
156
  exc_cls, exc_msg = self._get_exception(headers=r.headers, status_code=r.status_code, data=r.content)
133
157
  raise exc_cls(exc_msg)
134
158
 
135
- def delete_global_account_limit(self, account, rse_expression):
159
+ def delete_global_account_limit(
160
+ self,
161
+ account: str,
162
+ rse_expression: str
163
+ ) -> bool:
136
164
  """
137
165
  Sends the request to remove a global account limit.
138
166