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
rucio/rse/__init__.py ADDED
@@ -0,0 +1,97 @@
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 dogpile.cache import make_region
17
+
18
+ from rucio.common.utils import is_client
19
+ from rucio.rse import rsemanager
20
+
21
+ if is_client():
22
+ setattr(rsemanager, 'CLIENT_MODE', True)
23
+ setattr(rsemanager, 'SERVER_MODE', False)
24
+ else:
25
+ setattr(rsemanager, 'CLIENT_MODE', False)
26
+ setattr(rsemanager, 'SERVER_MODE', True)
27
+
28
+
29
+ def get_rse_client(rse, vo='def', **kwarg):
30
+ '''
31
+ get_rse_client
32
+ '''
33
+ from rucio.client.rseclient import RSEClient
34
+ client = RSEClient(vo=vo)
35
+ return client.get_rse(rse)
36
+
37
+
38
+ def get_signed_url_client(rse, service, op, url, vo='def'):
39
+ '''
40
+ get_signed_url_client
41
+ '''
42
+ from rucio.client.credentialclient import CredentialClient
43
+ return CredentialClient(vo=vo).get_signed_url(rse, service, op, url)
44
+
45
+
46
+ def get_signed_url_server(rse, service, op, url, vo='def'):
47
+ '''
48
+ get_signed_url_server
49
+ '''
50
+ from rucio.core.rse import get_rse_id
51
+ from rucio.core.credential import get_signed_url
52
+
53
+ rse_id = get_rse_id(rse=rse, vo=vo)
54
+ return get_signed_url(rse_id, service, op, url)
55
+
56
+
57
+ def rse_key_generator(namespace, fn, **kwargs):
58
+ '''
59
+ Key generator for RSE
60
+ '''
61
+ def generate_key(rse, vo='def', session=None):
62
+ '''
63
+ generate_key
64
+ '''
65
+ return '{}:{}'.format(rse, vo)
66
+ return generate_key
67
+
68
+
69
+ if rsemanager.CLIENT_MODE: # pylint:disable=no-member
70
+ setattr(rsemanager, '__request_rse_info', get_rse_client)
71
+ setattr(rsemanager, '__get_signed_url', get_signed_url_client)
72
+
73
+ # Preparing region for dogpile.cache
74
+ RSE_REGION = make_region(function_key_generator=rse_key_generator).configure(
75
+ 'dogpile.cache.memory',
76
+ expiration_time=900)
77
+ setattr(rsemanager, 'RSE_REGION', RSE_REGION)
78
+
79
+
80
+ if rsemanager.SERVER_MODE: # pylint:disable=no-member
81
+ from rucio.core.rse import get_rse_protocols, get_rse_id
82
+ from rucio.core.vo import map_vo
83
+ from rucio.common.cache import make_region_memcached
84
+
85
+ def tmp_rse_info(rse=None, vo='def', rse_id=None, session=None):
86
+ if rse_id is None:
87
+ # This can be called directly by client tools if they're co-located on a server
88
+ # i.e. running rucio cli on a server and during the test suite.
89
+ # We have to map to VO name here for this situations, despite this nominally
90
+ # not being a client interface.
91
+ rse_id = get_rse_id(rse=rse, vo=map_vo(vo))
92
+ return get_rse_protocols(rse_id=rse_id, session=session)
93
+
94
+ setattr(rsemanager, '__request_rse_info', tmp_rse_info)
95
+ setattr(rsemanager, '__get_signed_url', get_signed_url_server)
96
+ RSE_REGION = make_region_memcached(expiration_time=900)
97
+ setattr(rsemanager, 'RSE_REGION', RSE_REGION)
@@ -0,0 +1,14 @@
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.
@@ -0,0 +1,123 @@
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 rucio.rse.protocols import protocol
17
+
18
+
19
+ class Default(protocol.RSEProtocol):
20
+ """ Implementing access to RSEs using the local filesystem."""
21
+
22
+ def __init__(self, protocol_attr, rse_settings, logger=None):
23
+ """ Initializes the object with information about the referred RSE.
24
+
25
+ :param props: Properties derived from the RSE Repository
26
+ """
27
+ super(Default, self).__init__(protocol_attr, rse_settings, logger=logger)
28
+ self.attributes.pop('determinism_type', None)
29
+ self.files = []
30
+
31
+ def _get_path(self, scope, name):
32
+ """ Transforms the physical file name into the local URI in the referred RSE.
33
+ Suitable for sites implementoing the RUCIO naming convention.
34
+
35
+ :param name: filename
36
+ :param scope: scope
37
+
38
+ :returns: RSE specific URI of the physical file
39
+ """
40
+ return '%s/%s' % (scope, name)
41
+
42
+ def path2pfn(self, path):
43
+ """
44
+ Retruns a fully qualified PFN for the file referred by path.
45
+
46
+ :param path: The path to the file.
47
+
48
+ :returns: Fully qualified PFN.
49
+
50
+ """
51
+ return ''.join([self.rse['scheme'], '://%s' % self.rse['hostname'], path])
52
+
53
+ def exists(self, pfn):
54
+ """ Checks if the requested file is known by the referred RSE.
55
+
56
+ :param pfn: Physical file name
57
+
58
+ :returns: True if the file exists, False if it doesn't
59
+
60
+ :raise ServiceUnavailable
61
+ """
62
+ raise NotImplementedError
63
+
64
+ def connect(self):
65
+ """ Establishes the actual connection to the referred RSE.
66
+
67
+ :param credentials: Provide all necessary information to establish a connection
68
+ to the referred storage system. Some is loaded from the repository inside the
69
+ RSE class and some must be provided specific for the SFTP protocol like
70
+ username, password, private_key, private_key_pass, port.
71
+ For details about possible additional parameters and details about their usage
72
+ see the pysftp.Connection() documentation.
73
+ NOTE: the host parametrer is overwritten with the value provided by the repository
74
+
75
+ :raise RSEAccessDenied
76
+ """
77
+ raise NotImplementedError
78
+
79
+ def close(self):
80
+ """ Closes the connection to RSE."""
81
+ raise NotImplementedError
82
+
83
+ def get(self, pfn, dest, transfer_timeout=None):
84
+ """ Provides access to files stored inside connected the RSE.
85
+
86
+ :param pfn: Physical file name of requested file
87
+ :param dest: Name and path of the files when stored at the client
88
+ :param transfer_timeout Transfer timeout (in seconds)
89
+
90
+ :raises DestinationNotAccessible, ServiceUnavailable, SourceNotFound
91
+ """
92
+ raise NotImplementedError
93
+
94
+ def put(self, source, target, source_dir=None, transfer_timeout=None):
95
+ """ Allows to store files inside the referred RSE.
96
+
97
+ :param source: Physical file name
98
+ :param target: Name of the file on the storage system e.g. with prefixed scope
99
+ :param source_dir Path where the to be transferred files are stored in the local file system
100
+ :param transfer_timeout Transfer timeout (in seconds)
101
+
102
+ :raises DestinationNotAccessible, ServiceUnavailable, SourceNotFound
103
+ """
104
+ raise NotImplementedError
105
+
106
+ def delete(self, pfn):
107
+ """ Deletes a file from the connected RSE.
108
+
109
+ :param pfn: Physical file name
110
+
111
+ :raises ServiceUnavailable, SourceNotFound
112
+ """
113
+ raise NotImplementedError
114
+
115
+ def rename(self, pfn, new_pfn):
116
+ """ Allows to rename a file stored inside the connected RSE.
117
+
118
+ :param pfn: Current physical file name
119
+ :param new_pfn New physical file name
120
+
121
+ :raises DestinationNotAccessible, ServiceUnavailable, SourceNotFound
122
+ """
123
+ raise NotImplementedError
@@ -0,0 +1,112 @@
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 rucio.rse.protocols import protocol
17
+
18
+
19
+ class Default(protocol.RSEProtocol):
20
+ """ Implementing access to RSEs using the local filesystem."""
21
+
22
+ def __init__(self, protocol_attr, rse_settings, logger=None):
23
+ """ Initializes the object with information about the referred RSE.
24
+
25
+ :param props: Properties derived from the RSE Repository
26
+ """
27
+ super(Default, self).__init__(protocol_attr, rse_settings, logger=logger)
28
+ self.attributes.pop('determinism_type', None)
29
+ self.files = []
30
+
31
+ def path2pfn(self, path):
32
+ """
33
+ Retruns a fully qualified PFN for the file referred by path.
34
+
35
+ :param path: The path to the file.
36
+
37
+ :returns: Fully qualified PFN.
38
+
39
+ """
40
+ return ''.join([self.rse['scheme'], '://%s' % self.rse['hostname'], path])
41
+
42
+ def exists(self, pfn):
43
+ """ Checks if the requested file is known by the referred RSE.
44
+
45
+ :param pfn: Physical file name
46
+
47
+ :returns: True if the file exists, False if it doesn't
48
+
49
+ :raise ServiceUnavailable
50
+ """
51
+ raise NotImplementedError
52
+
53
+ def connect(self):
54
+ """ Establishes the actual connection to the referred RSE.
55
+
56
+ :param credentials: Provide all necessary information to establish a connection
57
+ to the referred storage system. Some is loaded from the repository inside the
58
+ RSE class and some must be provided specific for the SFTP protocol like
59
+ username, password, private_key, private_key_pass, port.
60
+ For details about possible additional parameters and details about their usage
61
+ see the pysftp.Connection() documentation.
62
+ NOTE: the host parametrer is overwritten with the value provided by the repository
63
+
64
+ :raise RSEAccessDenied
65
+ """
66
+ raise NotImplementedError
67
+
68
+ def close(self):
69
+ """ Closes the connection to RSE."""
70
+ raise NotImplementedError
71
+
72
+ def get(self, pfn, dest, transfer_timeout=None):
73
+ """ Provides access to files stored inside connected the RSE.
74
+
75
+ :param pfn: Physical file name of requested file
76
+ :param dest: Name and path of the files when stored at the client
77
+ :param transfer_timeout Transfer timeout (in seconds)
78
+
79
+ :raises DestinationNotAccessible, ServiceUnavailable, SourceNotFound
80
+ """
81
+ raise NotImplementedError
82
+
83
+ def put(self, source, target, source_dir=None, transfer_timeout=None):
84
+ """ Allows to store files inside the referred RSE.
85
+
86
+ :param source: Physical file name
87
+ :param target: Name of the file on the storage system e.g. with prefixed scope
88
+ :param source_dir Path where the to be transferred files are stored in the local file system
89
+ :param transfer_timeout Transfer timeout (in seconds)
90
+
91
+ :raises DestinationNotAccessible, ServiceUnavailable, SourceNotFound
92
+ """
93
+ raise NotImplementedError
94
+
95
+ def delete(self, pfn):
96
+ """ Deletes a file from the connected RSE.
97
+
98
+ :param pfn: Physical file name
99
+
100
+ :raises ServiceUnavailable, SourceNotFound
101
+ """
102
+ raise NotImplementedError
103
+
104
+ def rename(self, pfn, new_pfn):
105
+ """ Allows to rename a file stored inside the connected RSE.
106
+
107
+ :param pfn: Current physical file name
108
+ :param new_pfn New physical file name
109
+
110
+ :raises DestinationNotAccessible, ServiceUnavailable, SourceNotFound
111
+ """
112
+ raise NotImplementedError