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
rucio/__init__.py ADDED
@@ -0,0 +1,17 @@
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
+ import gettext
16
+
17
+ gettext.install('rucio')
@@ -0,0 +1,15 @@
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
+ ALEMBIC_REVISION = '30d5206e9cad' # the current alembic head revision
rucio/cli/__init__.py ADDED
@@ -0,0 +1,14 @@
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
+ from rucio.cli import command # noqa: F401
rucio/cli/account.py ADDED
@@ -0,0 +1,216 @@
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
+ import click
15
+
16
+ from rucio.cli.bin_legacy.rucio import list_account_usage
17
+ from rucio.cli.bin_legacy.rucio_admin import (
18
+ add_account,
19
+ add_account_attribute,
20
+ ban_account,
21
+ delete_account,
22
+ delete_account_attribute,
23
+ delete_limits,
24
+ identity_delete,
25
+ info_account,
26
+ list_account_attributes,
27
+ list_accounts,
28
+ list_identities,
29
+ set_limits,
30
+ unban_account,
31
+ update_account,
32
+ )
33
+ from rucio.cli.bin_legacy.rucio_admin import identity_add as legacy_identity_add
34
+ from rucio.cli.utils import Arguments
35
+
36
+
37
+ @click.group()
38
+ def account():
39
+ """Methods to add or change accounts for users, groups, and services. Used to assign privileges"""
40
+
41
+
42
+ @account.command("add")
43
+ @click.argument("account-name")
44
+ @click.argument("account-type", type=click.Choice(["USER", "GROUP", "SERVICE"]))
45
+ @click.option("--email", type=str, help="Email address associated with the account")
46
+ @click.pass_context
47
+ def add_(ctx, account_type, account_name, email):
48
+ """Add an account of type [ACCOUNT-TYPE] with the name [ACCOUNT-NAME]
49
+
50
+ \b
51
+ Example:
52
+ $ rucio account add
53
+ """
54
+ args = Arguments({"account_type": account_type, "account": account_name, "email": email})
55
+ add_account(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
56
+
57
+
58
+ @account.command("list")
59
+ @click.option("--type", "type_", type=click.Choice(["USER", "GROUP", "SERVICE"]))
60
+ @click.option("--id", help="Filter by identity (e.g. DN)")
61
+ @click.option("--filter", help="Filter arguments in form `key=value,another_key=next_value`") # TODO Explicit numeration of these possible keys
62
+ @click.pass_context
63
+ def list_(ctx, type_, id, filter):
64
+ """List all accounts that match given filters"""
65
+ args = Arguments({"account_type": type_, "identity": id, "filters": filter})
66
+ list_accounts(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
67
+
68
+
69
+ @account.command("show")
70
+ @click.argument("account-name")
71
+ @click.pass_context
72
+ def show(ctx, account_name):
73
+ """
74
+ Show info about a single account
75
+ """
76
+ info_account(Arguments({"account": account_name}), ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
77
+
78
+
79
+ @account.command("remove")
80
+ @click.argument("account-name")
81
+ @click.pass_context
82
+ def remove(ctx, account_name):
83
+ """
84
+ Remove an account
85
+ (WARNING: Permanently disables the account. If you want to temporarily disable, use `account update [account-name] --ban`)
86
+ """
87
+ delete_account(Arguments({"account": account_name}), ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
88
+
89
+
90
+ @account.command("update")
91
+ @click.argument("account-name")
92
+ @click.option("--email", help="Email address associated with the account")
93
+ @click.option("--ban/--unban", default=None, help="Temporarily disable/enable an account")
94
+ @click.pass_context
95
+ def update(ctx, ban, account_name, email):
96
+ """Update account settings"""
97
+ args = Arguments({"account": account_name, "key": "email", "value": email})
98
+ if ban is not None:
99
+ if ban:
100
+ ban_account(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
101
+ else:
102
+ unban_account(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
103
+ else:
104
+ update_account(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
105
+
106
+
107
+ @account.group()
108
+ def attribute():
109
+ """View or modify account attributes"""
110
+
111
+
112
+ @attribute.command("list")
113
+ @click.argument("account-name")
114
+ @click.pass_context
115
+ def attribute_list(ctx, account_name):
116
+ "List the attributes for a given account"
117
+ list_account_attributes(Arguments({"account": account_name}), ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
118
+
119
+
120
+ @attribute.command("add")
121
+ @click.argument("account-name")
122
+ @click.option('--key', help='Attribute key', required=True)
123
+ @click.option('--value', help='Attribute value', required=True)
124
+ @click.pass_context
125
+ def attribute_add(ctx, account_name, key, value):
126
+ """Add a new attribute [key] to an account"""
127
+ add_account_attribute(Arguments({"account": account_name, "key": key, "value": value}), ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
128
+
129
+
130
+ @attribute.command("remove")
131
+ @click.argument("account-name")
132
+ @click.option("--key", help="Attribute key", required=True)
133
+ @click.pass_context
134
+ def attribute_remove(ctx, account_name, key):
135
+ """Remove an attribute from an account without reassigning it"""
136
+ delete_account_attribute(Arguments({"account": account_name, "key": key}), ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
137
+
138
+
139
+ @account.group("limit")
140
+ def limit():
141
+ """View or modify account limits - limit how much data an account can store on an RSE"""
142
+
143
+
144
+ @limit.command("list", help="Shows the space used, the quota limit and the quota left for an account for every RSE where the user have quota.")
145
+ @click.argument("account-name")
146
+ @click.option("--rse", "--rse-name", help="Show usage for only for this RSE.")
147
+ @click.pass_context
148
+ def limit_list(ctx, account_name, rse):
149
+ """List the limits and current usage for an account"""
150
+ args = Arguments({"usage_account": account_name, "rse": rse})
151
+ list_account_usage(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
152
+
153
+
154
+ @limit.command("add")
155
+ @click.argument(
156
+ "account-name",
157
+ )
158
+ @click.option("--rse", "--rse-name", help="Full RSE name", required=True) # TODO Separate RSE (local) and RSE Expression (global)
159
+ @click.option("--bytes", "bytes_", help='Value of the limit; can be specified in bytes ("10000"), with a storage unit ("10GB"), or "infinity"', required=True)
160
+ @click.option("--locality", type=click.Choice(["local", "global"]), help="Global or local limit scope", default="local")
161
+ @click.pass_context
162
+ def limit_add(ctx, account_name, rse, bytes_, locality):
163
+ """Add a new limit for an account on an RSE. An account can have both local and global limits on the same RSE."""
164
+ args = Arguments({"account": account_name, "rse": rse, "bytes": bytes_, "locality": locality})
165
+ set_limits(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
166
+
167
+
168
+ @limit.command("remove")
169
+ @click.argument(
170
+ "account-name",
171
+ )
172
+ @click.option("--rse", "--rse-name", help="Full RSE name", required=True)
173
+ @click.option("--locality", type=click.Choice(["local", "global"]), help="Global or local limit scope", default="local")
174
+ @click.pass_context
175
+ def limit_remove(ctx, account_name, rse, locality):
176
+ """Remove existing limits for an account on an RSE"""
177
+ args = Arguments({"account": account_name, "rse": rse, "locality": locality})
178
+ delete_limits(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
179
+
180
+
181
+ @account.group("identity")
182
+ def identity():
183
+ """Manage identities for an account - used to login"""
184
+
185
+
186
+ @identity.command("list")
187
+ @click.argument("account-name", required=True)
188
+ @click.pass_context
189
+ def identity_list(ctx, account_name):
190
+ """See all the IDs for [account-name]"""
191
+ args = Arguments({"account": account_name})
192
+ list_identities(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
193
+
194
+
195
+ @identity.command("add")
196
+ @click.argument("account-name", required=True)
197
+ @click.option("--type", "type_", type=click.Choice(["X509", "GSS", "USERPASS", "SSH", "SAML", "OIDC"]), help="Authentication type", required=True)
198
+ @click.option("--id", help="Identity", required=True)
199
+ @click.option("--email", help="Email address associated with the identity", required=True)
200
+ @click.option("--password", help="Password if authtype is USERPASS")
201
+ @click.pass_context
202
+ def identity_add(ctx, account_name, type_, id, email, password):
203
+ """Add a new identity for [account-name]"""
204
+ args = Arguments({"account": account_name, "authtype": type_, "identity": id, "email": email, "password": password})
205
+ legacy_identity_add(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
206
+
207
+
208
+ @identity.command("remove")
209
+ @click.argument("account-name", required=True)
210
+ @click.option("--type", "type_", type=click.Choice(["X509", "GSS", "USERPASS", "SSH", "SAML", "OIDC"]), help="Authentication type", required=True)
211
+ @click.option("--id", help="Identity", required=True)
212
+ @click.pass_context
213
+ def identity_remove(ctx, account_name, type_, id):
214
+ """Revoke a given ID's access from an account"""
215
+ args = Arguments({"account": account_name, "authtype": type_, "id": id})
216
+ identity_delete(args, ctx.obj.client, ctx.obj.logger, ctx.obj.console, ctx.obj.spinner)
@@ -0,0 +1,13 @@
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.