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,92 @@
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
+ import enum
17
+ from collections import namedtuple
18
+
19
+ from rucio.common.config import config_get_bool
20
+
21
+ """
22
+ Constants.
23
+
24
+ """
25
+
26
+ RESERVED_KEYS = ['scope', 'name', 'account', 'did_type', 'is_open', 'monotonic', 'obsolete', 'complete',
27
+ 'availability', 'suppressed', 'bytes', 'length', 'md5', 'adler32', 'rule_evaluation_action',
28
+ 'rule_evaluation_required', 'expired_at', 'deleted_at', 'created_at', 'updated_at']
29
+ # collection_keys =
30
+ # file_keys =
31
+
32
+ KEY_TYPES = ['ALL', 'COLLECTION', 'FILE', 'DERIVED']
33
+ # all(container, dataset, file), collection(dataset or container), file, derived(compute from file for collection)
34
+
35
+ SCHEME_MAP = {'srm': ['srm', 'gsiftp'],
36
+ 'gsiftp': ['srm', 'gsiftp'],
37
+ 'https': ['https', 'davs', 'srm+https', 'cs3s'],
38
+ 'davs': ['https', 'davs', 'srm+https', 'cs3s'],
39
+ 'srm+https': ['https', 'davs', 'srm+https', 'cs3s'],
40
+ 'cs3s': ['https', 'davs', 'srm+https', 'cs3s'],
41
+ 'root': ['root'],
42
+ 'scp': ['scp'],
43
+ 'rsync': ['rsync'],
44
+ 'rclone': ['rclone']}
45
+ if config_get_bool('transfers', 'srm_https_compatibility', raise_exception=False, default=False):
46
+ SCHEME_MAP['srm'].append('https')
47
+ SCHEME_MAP['https'].append('srm')
48
+ SCHEME_MAP['srm'].append('davs')
49
+ SCHEME_MAP['davs'].append('srm')
50
+
51
+ SUPPORTED_PROTOCOLS = ['gsiftp', 'srm', 'root', 'davs', 'http', 'https', 'file', 'storm', 'srm+https', 'scp', 'rsync', 'rclone']
52
+
53
+ FTS_STATE = namedtuple('FTS_STATE', ['SUBMITTED', 'READY', 'ACTIVE', 'FAILED', 'FINISHED', 'FINISHEDDIRTY', 'NOT_USED',
54
+ 'CANCELED'])('SUBMITTED', 'READY', 'ACTIVE', 'FAILED', 'FINISHED', 'FINISHEDDIRTY',
55
+ 'NOT_USED', 'CANCELED')
56
+
57
+ FTS_COMPLETE_STATE = namedtuple('FTS_COMPLETE_STATE', ['OK', 'ERROR'])('Ok', 'Error')
58
+
59
+ # https://gitlab.cern.ch/fts/fts3/-/blob/master/src/db/generic/Job.h#L41
60
+ FTS_JOB_TYPE = namedtuple('FTS_JOB_TYPE', ['MULTIPLE_REPLICA', 'MULTI_HOP', 'SESSION_REUSE', 'REGULAR'])('R', 'H', 'Y', 'N')
61
+
62
+
63
+ # Messages constants
64
+
65
+ MAX_MESSAGE_LENGTH = 4000
66
+
67
+
68
+ class SuspiciousAvailability(enum.Enum):
69
+ ALL = 0
70
+ EXIST_COPIES = 1
71
+ LAST_COPY = 2
72
+
73
+
74
+ class ReplicaState(enum.Enum):
75
+ # From rucio.db.sqla.constants, update that file at the same time as this
76
+ AVAILABLE = 'A'
77
+ UNAVAILABLE = 'U'
78
+ COPYING = 'C'
79
+ BEING_DELETED = 'B'
80
+ BAD = 'D'
81
+ TEMPORARY_UNAVAILABLE = 'T'
82
+
83
+
84
+ @enum.unique
85
+ class HermesService(str, enum.Enum):
86
+ """
87
+ The services supported by Hermes2.
88
+ """
89
+ INFLUX = "INFLUX"
90
+ ELASTIC = "ELASTIC"
91
+ EMAIL = "EMAIL"
92
+ ACTIVEMQ = "ACTIVEMQ"
@@ -0,0 +1,18 @@
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
+ # List of authorized value types for key
17
+ AUTHORIZED_VALUE_TYPES = (float, int, str)
18
+ STRING_TYPES = (str, )
@@ -0,0 +1,187 @@
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
+ """
17
+ DID type to represent a did and to simplify operations on it
18
+ """
19
+
20
+ from rucio.common.exception import DIDError
21
+
22
+
23
+ class DID(object):
24
+
25
+ """
26
+ Class used to store a DID
27
+ Given an object did of type DID
28
+ scope is stored in did.scope
29
+ name is stored in did.name
30
+ """
31
+
32
+ SCOPE_SEPARATOR = ':'
33
+ IMPLICIT_SCOPE_SEPARATOR = '.'
34
+ IMPLICIT_SCOPE_TO_LEN = {'user': 2, 'group': 2}
35
+ __slots__ = ['scope', 'name']
36
+
37
+ def __init__(self, *args, **kwargs):
38
+ """
39
+ Constructs the DID object. Possible parameter combinations are:
40
+ DID()
41
+ DID('scope:name.did.str')
42
+ DID('user.implicit.scope.in.name')
43
+ DID('custom.scope', 'custom.name')
44
+ DID(['list.scope', 'list.name'])
45
+ DID(('tuple.scope', 'tuple.name'))
46
+ DID({'scope': 'dict.scope', 'name': 'dict.name'})
47
+ DID(scope='kw.scope')
48
+ DID(name='kw.name')
49
+ DID(name='user.kw.implicit.scope')
50
+ DID(scope='kw.scope', name='kw.name')
51
+ DID(did={'scope': 'kw.did.scope', 'name': 'kw.did.name'})
52
+ DID(did=['kw.list.scope', 'kw.list.name'])
53
+ DID(did=('kw.tuple.scope', 'kw.tuple.name'))
54
+ DID('arg.scope', name='kwarg.name')
55
+ DID('arg.name', scope='kwarg.scope')
56
+ """
57
+ self.scope = self.name = ''
58
+
59
+ num_args = len(args)
60
+ num_kwargs = len(kwargs)
61
+ if (num_args + num_kwargs) > 2:
62
+ raise DIDError('Constructor takes at most 2 arguments. Given number: {}'.format(num_args + num_kwargs))
63
+
64
+ did = ''
65
+ if num_args == 1:
66
+ did = args[0]
67
+
68
+ if num_kwargs == 1:
69
+ if not isinstance(did, str):
70
+ raise DIDError('First argument of constructor is expected to be string type'
71
+ 'when keyword argument is given. Given type: {}'.format(type(did)))
72
+
73
+ k, v = next(iter(kwargs.items()))
74
+ if k == 'scope':
75
+ did = (v, did)
76
+ elif k == 'name':
77
+ did = (did, v)
78
+ else:
79
+ raise DIDError('Constructor got unexpected keyword argument: {}'.format(k))
80
+ elif num_args == 0:
81
+ did = kwargs.get('did', kwargs)
82
+ else:
83
+ did = args
84
+
85
+ if isinstance(did, dict):
86
+ self.scope = did.get('scope', '')
87
+ self.name = did.get('name', '')
88
+ if not self.has_scope():
89
+ self.update_implicit_scope()
90
+ elif isinstance(did, tuple) or isinstance(did, list):
91
+ if len(did) != 2:
92
+ raise DIDError('Construction from tuple or list requires exactly 2 elements')
93
+ self.scope = did[0]
94
+ self.name = did[1]
95
+ elif isinstance(did, str):
96
+ did_parts = did.split(DID.SCOPE_SEPARATOR, 1)
97
+ if len(did_parts) == 1:
98
+ self.name = did
99
+ self.update_implicit_scope()
100
+ if not self.has_scope():
101
+ raise DIDError('Object construction from non-splitable string is ambigious')
102
+ else:
103
+ self.scope = did_parts[0]
104
+ self.name = did_parts[1]
105
+ elif isinstance(did, DID):
106
+ self.scope = did.scope
107
+ self.name = did.name
108
+ else:
109
+ raise DIDError('Cannot build object from: {}'.format(type(did)))
110
+
111
+ if self.name.endswith('/'):
112
+ self.name = self.name[:-1]
113
+
114
+ if not self.is_valid_format():
115
+ raise DIDError('Object has invalid format after construction: {}'.format(str(self)))
116
+
117
+ def update_implicit_scope(self):
118
+ """
119
+ This method sets the scope if it is implicitly given in self.name
120
+ """
121
+ did_parts = self.name.split(DID.IMPLICIT_SCOPE_SEPARATOR)
122
+ num_scope_parts = DID.IMPLICIT_SCOPE_TO_LEN.get(did_parts[0], 0)
123
+ if num_scope_parts > 0:
124
+ self.scope = '.'.join(did_parts[0:num_scope_parts])
125
+
126
+ def is_valid_format(self):
127
+ """
128
+ Method to check if the stored DID has a valid format
129
+ :return: bool
130
+ """
131
+ if self.scope.count(DID.SCOPE_SEPARATOR) or self.name.count(DID.SCOPE_SEPARATOR):
132
+ return False
133
+ return True
134
+
135
+ def has_scope(self):
136
+ """
137
+ Method to check if the scope part was set
138
+ :return: bool
139
+ """
140
+ return len(self.scope) > 0
141
+
142
+ def has_name(self):
143
+ """
144
+ Method to check if the name part was set
145
+ :return: bool
146
+ """
147
+ return len(self.name) > 0
148
+
149
+ def __str__(self):
150
+ """
151
+ Creates the string representation of self
152
+ :return: string
153
+ """
154
+ if self.has_scope() and self.has_name():
155
+ return '{}{}{}'.format(self.scope, DID.SCOPE_SEPARATOR, self.name)
156
+ elif self.has_scope():
157
+ return self.scope
158
+ return self.name
159
+
160
+ def __eq__(self, other):
161
+ """
162
+ Equality comparison with another object
163
+ :return: bool
164
+ """
165
+ if isinstance(other, str):
166
+ return str(self) == other
167
+ elif not isinstance(other, DID):
168
+ try:
169
+ other = DID(other)
170
+ except DIDError:
171
+ return False
172
+
173
+ return self.scope == other.scope and self.name == other.name
174
+
175
+ def __ne__(self, other):
176
+ """
177
+ Inequality comparison with another object
178
+ :return: bool
179
+ """
180
+ return not self.__eq__(other)
181
+
182
+ def __hash__(self):
183
+ """
184
+ Uses the string representation of self to create a hash
185
+ :return: int
186
+ """
187
+ return hash(str(self))