rucio 37.2.0__py3-none-any.whl → 37.3.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 might be problematic. Click here for more details.
- rucio/common/plugins.py +1 -1
- rucio/core/did.py +2 -3
- rucio/core/replica.py +1 -1
- rucio/db/sqla/util.py +1 -1
- rucio/gateway/authentication.py +58 -88
- rucio/gateway/config.py +63 -75
- rucio/gateway/did.py +245 -329
- rucio/gateway/dirac.py +33 -34
- rucio/gateway/exporter.py +27 -30
- rucio/gateway/importer.py +12 -14
- rucio/gateway/lifetime_exception.py +16 -24
- rucio/gateway/lock.py +27 -40
- rucio/gateway/replica.py +223 -226
- rucio/gateway/rse.py +191 -218
- rucio/gateway/rule.py +115 -146
- rucio/gateway/scope.py +18 -25
- rucio/gateway/trace.py +48 -0
- rucio/vcsversion.py +3 -3
- rucio/web/rest/flaskapi/v1/accounts.py +2 -2
- rucio/web/rest/flaskapi/v1/auth.py +15 -0
- rucio/web/rest/flaskapi/v1/common.py +3 -0
- rucio/web/rest/flaskapi/v1/config.py +7 -7
- rucio/web/rest/flaskapi/v1/dids.py +55 -55
- rucio/web/rest/flaskapi/v1/dirac.py +2 -2
- rucio/web/rest/flaskapi/v1/export.py +1 -1
- rucio/web/rest/flaskapi/v1/import.py +1 -1
- rucio/web/rest/flaskapi/v1/lifetime_exceptions.py +5 -5
- rucio/web/rest/flaskapi/v1/locks.py +4 -4
- rucio/web/rest/flaskapi/v1/main.py +17 -10
- rucio/web/rest/flaskapi/v1/replicas.py +29 -28
- rucio/web/rest/flaskapi/v1/rses.py +37 -37
- rucio/web/rest/flaskapi/v1/rules.py +15 -15
- rucio/web/rest/flaskapi/v1/scopes.py +3 -3
- rucio/web/rest/flaskapi/v1/traces.py +75 -77
- {rucio-37.2.0.dist-info → rucio-37.3.0.dist-info}/METADATA +1 -1
- {rucio-37.2.0.dist-info → rucio-37.3.0.dist-info}/RECORD +95 -94
- {rucio-37.2.0.dist-info → rucio-37.3.0.dist-info}/WHEEL +1 -1
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/alembic.ini.template +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/rucio.cfg.template +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/requirements.server.txt +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/tools/bootstrap.py +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/data/rucio/tools/reset_database.py +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-abacus-account +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-abacus-collection-replica +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-abacus-rse +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-admin +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-atropos +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-auditor +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-automatix +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-bb8 +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-cache-client +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-cache-consumer +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-conveyor-finisher +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-conveyor-poller +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-conveyor-preparer +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-conveyor-receiver +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-conveyor-stager +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-conveyor-submitter +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-conveyor-throttler +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-dark-reaper +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-dumper +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-follower +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-hermes +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-judge-cleaner +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-judge-evaluator +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-judge-injector +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-judge-repairer +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-kronos +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-minos +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-necromancer +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-oauth-manager +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-reaper +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-replica-recoverer +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-rse-decommissioner +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-storage-consistency-actions +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-transmogrifier +0 -0
- {rucio-37.2.0.data → rucio-37.3.0.data}/scripts/rucio-undertaker +0 -0
- {rucio-37.2.0.dist-info → rucio-37.3.0.dist-info}/licenses/AUTHORS.rst +0 -0
- {rucio-37.2.0.dist-info → rucio-37.3.0.dist-info}/licenses/LICENSE +0 -0
- {rucio-37.2.0.dist-info → rucio-37.3.0.dist-info}/top_level.txt +0 -0
|
@@ -15,15 +15,19 @@
|
|
|
15
15
|
|
|
16
16
|
import importlib
|
|
17
17
|
import logging
|
|
18
|
+
from typing import TYPE_CHECKING
|
|
18
19
|
|
|
19
20
|
from flask import Flask
|
|
20
21
|
|
|
21
|
-
from rucio.common.config import
|
|
22
|
+
from rucio.common.config import config_get_list
|
|
22
23
|
from rucio.common.exception import ConfigurationError
|
|
23
24
|
from rucio.common.logging import setup_logging
|
|
24
25
|
from rucio.web.rest.flaskapi.v1.common import CORSMiddleware
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
if TYPE_CHECKING:
|
|
28
|
+
from collections.abc import Iterable
|
|
29
|
+
|
|
30
|
+
DEFAULT_ENDPOINTS = {
|
|
27
31
|
'accountlimits',
|
|
28
32
|
'accounts',
|
|
29
33
|
'auth',
|
|
@@ -46,10 +50,10 @@ DEFAULT_ENDPOINTS = [
|
|
|
46
50
|
'rules',
|
|
47
51
|
'scopes',
|
|
48
52
|
'subscriptions',
|
|
49
|
-
|
|
53
|
+
}
|
|
50
54
|
|
|
51
55
|
|
|
52
|
-
def apply_endpoints(app, modules):
|
|
56
|
+
def apply_endpoints(app: Flask, modules: "Iterable[str]") -> None:
|
|
53
57
|
for blueprint_module in modules:
|
|
54
58
|
# Legacy patch - TODO Remove in 38.0.0
|
|
55
59
|
if blueprint_module == "meta":
|
|
@@ -71,15 +75,18 @@ def apply_endpoints(app, modules):
|
|
|
71
75
|
else:
|
|
72
76
|
raise ConfigurationError(f'"{blueprint_module}" from the endpoints configuration value did not have a blueprint')
|
|
73
77
|
|
|
78
|
+
endpoints = set(config_get_list('api', 'endpoints', raise_exception=False, default=[]))
|
|
79
|
+
endpoints_add = set(config_get_list('api', 'endpoints_add', raise_exception=False, default=[]))
|
|
80
|
+
endpoints_remove = set(config_get_list('api', 'endpoints_remove', raise_exception=False, default=[]))
|
|
81
|
+
|
|
82
|
+
if endpoints and (endpoints_add or endpoints_remove):
|
|
83
|
+
raise ConfigurationError("Endpoints cannot be set in both 'endpoints' and 'endpoints_add'/'endpoints_remove'")
|
|
74
84
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
endpoints = list(filter(bool, map(str.strip, endpoints.split(sep=','))))
|
|
78
|
-
except RuntimeError:
|
|
79
|
-
endpoints = None
|
|
85
|
+
if endpoints_add.intersection(endpoints_remove):
|
|
86
|
+
raise ConfigurationError("Endpoints cannot be in both 'endpoints_add' and 'endpoints_remove'")
|
|
80
87
|
|
|
81
88
|
if not endpoints:
|
|
82
|
-
endpoints = DEFAULT_ENDPOINTS
|
|
89
|
+
endpoints = DEFAULT_ENDPOINTS - endpoints_remove | endpoints_add
|
|
83
90
|
|
|
84
91
|
application = Flask(__name__)
|
|
85
92
|
application.wsgi_app = CORSMiddleware(application.wsgi_app)
|
|
@@ -226,7 +226,7 @@ class Replicas(ErrorHandlingMethodView):
|
|
|
226
226
|
description: Not acceptable
|
|
227
227
|
"""
|
|
228
228
|
try:
|
|
229
|
-
scope, name = parse_scope_name(scope_name, request.environ
|
|
229
|
+
scope, name = parse_scope_name(scope_name, request.environ['vo'])
|
|
230
230
|
except ValueError as error:
|
|
231
231
|
return generate_http_error_flask(400, error)
|
|
232
232
|
|
|
@@ -264,7 +264,7 @@ class Replicas(ErrorHandlingMethodView):
|
|
|
264
264
|
rfile['pfns'] = dict(_sorted_with_priorities(rfile['pfns'], replicas, limit=limit))
|
|
265
265
|
yield rfile
|
|
266
266
|
|
|
267
|
-
rfiles = _list_and_sort_replicas(vo=request.environ
|
|
267
|
+
rfiles = _list_and_sort_replicas(vo=request.environ['vo'])
|
|
268
268
|
if metalink:
|
|
269
269
|
response_generator = _generate_metalink_response(rfiles, 'atlas', detailed_url=False)
|
|
270
270
|
else:
|
|
@@ -359,8 +359,8 @@ class Replicas(ErrorHandlingMethodView):
|
|
|
359
359
|
add_replicas(
|
|
360
360
|
rse=rse,
|
|
361
361
|
files=files,
|
|
362
|
-
issuer=request.environ
|
|
363
|
-
vo=request.environ
|
|
362
|
+
issuer=request.environ['issuer'],
|
|
363
|
+
vo=request.environ['vo'],
|
|
364
364
|
ignore_availability=param_get(parameters, 'ignore_availability', default=False),
|
|
365
365
|
)
|
|
366
366
|
except InvalidPath as error:
|
|
@@ -432,7 +432,7 @@ class Replicas(ErrorHandlingMethodView):
|
|
|
432
432
|
files = param_get(parameters, 'files')
|
|
433
433
|
|
|
434
434
|
try:
|
|
435
|
-
update_replicas_states(rse=rse, files=files, issuer=request.environ
|
|
435
|
+
update_replicas_states(rse=rse, files=files, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
436
436
|
except AccessDenied as error:
|
|
437
437
|
return generate_http_error_flask(401, error)
|
|
438
438
|
|
|
@@ -486,8 +486,8 @@ class Replicas(ErrorHandlingMethodView):
|
|
|
486
486
|
delete_replicas(
|
|
487
487
|
rse=rse,
|
|
488
488
|
files=files,
|
|
489
|
-
issuer=request.environ
|
|
490
|
-
vo=request.environ
|
|
489
|
+
issuer=request.environ['issuer'],
|
|
490
|
+
vo=request.environ['vo'],
|
|
491
491
|
ignore_availability=param_get(parameters, 'ignore_availability', default=False),
|
|
492
492
|
)
|
|
493
493
|
except AccessDenied as error:
|
|
@@ -746,8 +746,8 @@ class ListReplicas(ErrorHandlingMethodView):
|
|
|
746
746
|
yield rfile
|
|
747
747
|
|
|
748
748
|
rfiles = _list_and_sort_replicas(request_id=request.environ.get('request_id'),
|
|
749
|
-
issuer=request.environ
|
|
750
|
-
vo=request.environ
|
|
749
|
+
issuer=request.environ['issuer'],
|
|
750
|
+
vo=request.environ['vo'])
|
|
751
751
|
if metalink:
|
|
752
752
|
policy_schema = config_get('policy', 'schema', raise_exception=False, default='generic')
|
|
753
753
|
response_generator = _generate_metalink_response(rfiles, policy_schema)
|
|
@@ -822,7 +822,7 @@ class ReplicasDIDs(ErrorHandlingMethodView):
|
|
|
822
822
|
for pfn in get_did_from_pfns(pfns, rse, vo=vo):
|
|
823
823
|
yield dumps(pfn) + '\n'
|
|
824
824
|
|
|
825
|
-
return try_stream(generate(vo=request.environ
|
|
825
|
+
return try_stream(generate(vo=request.environ['vo']))
|
|
826
826
|
except AccessDenied as error:
|
|
827
827
|
return generate_http_error_flask(401, error)
|
|
828
828
|
|
|
@@ -882,7 +882,7 @@ class BadReplicas(ErrorHandlingMethodView):
|
|
|
882
882
|
|
|
883
883
|
try:
|
|
884
884
|
not_declared_files = declare_bad_file_replicas(replicas, reason=reason,
|
|
885
|
-
issuer=request.environ
|
|
885
|
+
issuer=request.environ['issuer'], vo=request.environ['vo'],
|
|
886
886
|
force=force)
|
|
887
887
|
return not_declared_files, 201
|
|
888
888
|
except AccessDenied as error:
|
|
@@ -1002,7 +1002,7 @@ class SuspiciousReplicas(ErrorHandlingMethodView):
|
|
|
1002
1002
|
reason = param_get(parameters, 'reason', default=None)
|
|
1003
1003
|
|
|
1004
1004
|
try:
|
|
1005
|
-
not_declared_files = declare_suspicious_file_replicas(pfns=pfns, reason=reason, issuer=request.environ
|
|
1005
|
+
not_declared_files = declare_suspicious_file_replicas(pfns=pfns, reason=reason, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
1006
1006
|
return not_declared_files, 201
|
|
1007
1007
|
except AccessDenied as error:
|
|
1008
1008
|
return generate_http_error_flask(401, error)
|
|
@@ -1081,7 +1081,7 @@ class SuspiciousReplicas(ErrorHandlingMethodView):
|
|
|
1081
1081
|
if 'nattempts' in params:
|
|
1082
1082
|
nattempts = int(params['nattempts'][0])
|
|
1083
1083
|
|
|
1084
|
-
result = get_suspicious_files(rse_expression=rse_expression, younger_than=younger_than, nattempts=nattempts, vo=request.environ
|
|
1084
|
+
result = get_suspicious_files(rse_expression=rse_expression, younger_than=younger_than, nattempts=nattempts, vo=request.environ['vo'])
|
|
1085
1085
|
return Response(render_json(result), 200, content_type='application/json')
|
|
1086
1086
|
|
|
1087
1087
|
|
|
@@ -1180,7 +1180,8 @@ class BadReplicasStates(ErrorHandlingMethodView):
|
|
|
1180
1180
|
406:
|
|
1181
1181
|
description: Not acceptable
|
|
1182
1182
|
"""
|
|
1183
|
-
|
|
1183
|
+
list_pfns = False
|
|
1184
|
+
state, rse, younger_than, older_than, limit = None, None, None, None, None
|
|
1184
1185
|
if request.query_string:
|
|
1185
1186
|
query_string = request.query_string.decode(encoding='utf-8')
|
|
1186
1187
|
try:
|
|
@@ -1208,7 +1209,7 @@ class BadReplicasStates(ErrorHandlingMethodView):
|
|
|
1208
1209
|
vo=vo):
|
|
1209
1210
|
yield dumps(row, cls=APIEncoder) + '\n'
|
|
1210
1211
|
|
|
1211
|
-
return try_stream(generate(vo=request.environ
|
|
1212
|
+
return try_stream(generate(vo=request.environ['vo']))
|
|
1212
1213
|
|
|
1213
1214
|
|
|
1214
1215
|
class BadReplicasSummary(ErrorHandlingMethodView):
|
|
@@ -1287,7 +1288,7 @@ class BadReplicasSummary(ErrorHandlingMethodView):
|
|
|
1287
1288
|
to_date=to_date, vo=vo):
|
|
1288
1289
|
yield dumps(row, cls=APIEncoder) + '\n'
|
|
1289
1290
|
|
|
1290
|
-
return try_stream(generate(vo=request.environ
|
|
1291
|
+
return try_stream(generate(vo=request.environ['vo']))
|
|
1291
1292
|
|
|
1292
1293
|
|
|
1293
1294
|
class DatasetReplicas(ErrorHandlingMethodView):
|
|
@@ -1370,7 +1371,7 @@ class DatasetReplicas(ErrorHandlingMethodView):
|
|
|
1370
1371
|
description: Not acceptable
|
|
1371
1372
|
"""
|
|
1372
1373
|
try:
|
|
1373
|
-
scope, name = parse_scope_name(scope_name, request.environ
|
|
1374
|
+
scope, name = parse_scope_name(scope_name, request.environ['vo'])
|
|
1374
1375
|
|
|
1375
1376
|
def generate(_deep, vo):
|
|
1376
1377
|
for row in list_dataset_replicas(scope=scope, name=name, deep=_deep, vo=vo):
|
|
@@ -1378,7 +1379,7 @@ class DatasetReplicas(ErrorHandlingMethodView):
|
|
|
1378
1379
|
|
|
1379
1380
|
deep = request.args.get('deep', default=False)
|
|
1380
1381
|
|
|
1381
|
-
return try_stream(generate(_deep=deep, vo=request.environ
|
|
1382
|
+
return try_stream(generate(_deep=deep, vo=request.environ['vo']))
|
|
1382
1383
|
except ValueError as error:
|
|
1383
1384
|
return generate_http_error_flask(400, error)
|
|
1384
1385
|
|
|
@@ -1483,7 +1484,7 @@ class DatasetReplicasBulk(ErrorHandlingMethodView):
|
|
|
1483
1484
|
for row in list_dataset_replicas_bulk(dids=dids, vo=vo):
|
|
1484
1485
|
yield dumps(row, cls=APIEncoder) + '\n'
|
|
1485
1486
|
|
|
1486
|
-
return try_stream(generate(vo=request.environ
|
|
1487
|
+
return try_stream(generate(vo=request.environ['vo']))
|
|
1487
1488
|
except InvalidObject as error:
|
|
1488
1489
|
return generate_http_error_flask(400, error, f'Cannot validate DIDs: {error}')
|
|
1489
1490
|
|
|
@@ -1520,7 +1521,7 @@ class DatasetReplicasVP(ErrorHandlingMethodView):
|
|
|
1520
1521
|
description: Not acceptable
|
|
1521
1522
|
"""
|
|
1522
1523
|
try:
|
|
1523
|
-
scope, name = parse_scope_name(scope_name, request.environ
|
|
1524
|
+
scope, name = parse_scope_name(scope_name, request.environ['vo'])
|
|
1524
1525
|
|
|
1525
1526
|
def generate(_deep, vo):
|
|
1526
1527
|
for row in list_dataset_replicas_vp(scope=scope, name=name, deep=_deep, vo=vo):
|
|
@@ -1528,7 +1529,7 @@ class DatasetReplicasVP(ErrorHandlingMethodView):
|
|
|
1528
1529
|
|
|
1529
1530
|
deep = request.args.get('deep', default=False)
|
|
1530
1531
|
|
|
1531
|
-
return try_stream(generate(_deep=deep, vo=request.environ
|
|
1532
|
+
return try_stream(generate(_deep=deep, vo=request.environ['vo']))
|
|
1532
1533
|
except ValueError as error:
|
|
1533
1534
|
return generate_http_error_flask(400, error)
|
|
1534
1535
|
|
|
@@ -1610,7 +1611,7 @@ class ReplicasRSE(ErrorHandlingMethodView):
|
|
|
1610
1611
|
for row in list_datasets_per_rse(rse=rse, vo=vo):
|
|
1611
1612
|
yield dumps(row, cls=APIEncoder) + '\n'
|
|
1612
1613
|
|
|
1613
|
-
return try_stream(generate(vo=request.environ
|
|
1614
|
+
return try_stream(generate(vo=request.environ['vo']))
|
|
1614
1615
|
|
|
1615
1616
|
|
|
1616
1617
|
class BadDIDs(ErrorHandlingMethodView):
|
|
@@ -1676,11 +1677,11 @@ class BadDIDs(ErrorHandlingMethodView):
|
|
|
1676
1677
|
not_declared_files = add_bad_dids(
|
|
1677
1678
|
dids=param_get(parameters, 'dids', default=[]),
|
|
1678
1679
|
rse=param_get(parameters, 'rse', default=None),
|
|
1679
|
-
issuer=request.environ
|
|
1680
|
+
issuer=request.environ['issuer'],
|
|
1680
1681
|
state=BadFilesStatus.BAD,
|
|
1681
1682
|
reason=param_get(parameters, 'reason', default=None),
|
|
1682
1683
|
expires_at=expires_at,
|
|
1683
|
-
vo=request.environ
|
|
1684
|
+
vo=request.environ['vo'],
|
|
1684
1685
|
)
|
|
1685
1686
|
except (ValueError, InvalidType) as error:
|
|
1686
1687
|
return generate_http_error_flask(400, ValueError.__name__, error.args[0])
|
|
@@ -1745,11 +1746,11 @@ class BadPFNs(ErrorHandlingMethodView):
|
|
|
1745
1746
|
try:
|
|
1746
1747
|
add_bad_pfns(
|
|
1747
1748
|
pfns=param_get(parameters, 'pfns', default=[]),
|
|
1748
|
-
issuer=request.environ
|
|
1749
|
+
issuer=request.environ['issuer'],
|
|
1749
1750
|
state=param_get(parameters, 'state', default=None),
|
|
1750
1751
|
reason=param_get(parameters, 'reason', default=None),
|
|
1751
1752
|
expires_at=expires_at,
|
|
1752
|
-
vo=request.environ
|
|
1753
|
+
vo=request.environ['vo'],
|
|
1753
1754
|
)
|
|
1754
1755
|
except (ValueError, InvalidType) as error:
|
|
1755
1756
|
return generate_http_error_flask(400, ValueError.__name__, error.args[0])
|
|
@@ -1816,8 +1817,8 @@ class Tombstone(ErrorHandlingMethodView):
|
|
|
1816
1817
|
rse=replica['rse'],
|
|
1817
1818
|
scope=replica['scope'],
|
|
1818
1819
|
name=replica['name'],
|
|
1819
|
-
issuer=request.environ
|
|
1820
|
-
vo=request.environ
|
|
1820
|
+
issuer=request.environ['issuer'],
|
|
1821
|
+
vo=request.environ['vo'],
|
|
1821
1822
|
)
|
|
1822
1823
|
except ReplicaNotFound as error:
|
|
1823
1824
|
return generate_http_error_flask(404, error)
|
|
@@ -178,7 +178,7 @@ class RSEs(ErrorHandlingMethodView):
|
|
|
178
178
|
for rse in parse_rse_expression(expression, vo=vo):
|
|
179
179
|
yield render_json(rse=rse) + '\n'
|
|
180
180
|
|
|
181
|
-
return try_stream(generate(vo=request.environ
|
|
181
|
+
return try_stream(generate(vo=request.environ['vo']))
|
|
182
182
|
except (InvalidRSEExpression, InvalidObject) as error:
|
|
183
183
|
return generate_http_error_flask(400, error)
|
|
184
184
|
else:
|
|
@@ -187,7 +187,7 @@ class RSEs(ErrorHandlingMethodView):
|
|
|
187
187
|
rse['availability'] = Availability(rse['availability_read'], rse['availability_write'], rse['availability_delete']).integer
|
|
188
188
|
yield render_json(**rse) + '\n'
|
|
189
189
|
|
|
190
|
-
return try_stream(generate(vo=request.environ
|
|
190
|
+
return try_stream(generate(vo=request.environ['vo']))
|
|
191
191
|
|
|
192
192
|
|
|
193
193
|
class RSE(ErrorHandlingMethodView):
|
|
@@ -316,8 +316,8 @@ class RSE(ErrorHandlingMethodView):
|
|
|
316
316
|
for keyword in kwargs.keys():
|
|
317
317
|
kwargs[keyword] = param_get(parameters, keyword, default=kwargs[keyword])
|
|
318
318
|
|
|
319
|
-
kwargs['issuer'] = request.environ
|
|
320
|
-
kwargs['vo'] = request.environ
|
|
319
|
+
kwargs['issuer'] = request.environ['issuer']
|
|
320
|
+
kwargs['vo'] = request.environ['vo']
|
|
321
321
|
try:
|
|
322
322
|
add_rse(rse, **kwargs)
|
|
323
323
|
except InvalidObject as error:
|
|
@@ -408,8 +408,8 @@ class RSE(ErrorHandlingMethodView):
|
|
|
408
408
|
"""
|
|
409
409
|
kwargs = {
|
|
410
410
|
'parameters': json_parameters(optional=True),
|
|
411
|
-
'issuer': request.environ
|
|
412
|
-
'vo': request.environ
|
|
411
|
+
'issuer': request.environ['issuer'],
|
|
412
|
+
'vo': request.environ['vo'],
|
|
413
413
|
}
|
|
414
414
|
try:
|
|
415
415
|
update_rse(rse, **kwargs)
|
|
@@ -508,7 +508,7 @@ class RSE(ErrorHandlingMethodView):
|
|
|
508
508
|
description: Not acceptable
|
|
509
509
|
"""
|
|
510
510
|
try:
|
|
511
|
-
rse = get_rse(rse=rse, vo=request.environ
|
|
511
|
+
rse = get_rse(rse=rse, vo=request.environ['vo'])
|
|
512
512
|
rse['availability'] = Availability(rse['availability_read'], rse['availability_write'], rse['availability_delete']).integer
|
|
513
513
|
return Response(render_json(**rse), content_type="application/json")
|
|
514
514
|
except RSENotFound as error:
|
|
@@ -537,7 +537,7 @@ class RSE(ErrorHandlingMethodView):
|
|
|
537
537
|
description: RSE not found
|
|
538
538
|
"""
|
|
539
539
|
try:
|
|
540
|
-
del_rse(rse=rse, issuer=request.environ
|
|
540
|
+
del_rse(rse=rse, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
541
541
|
except (RSENotFound, RSEOperationNotSupported, CounterNotFound) as error:
|
|
542
542
|
return generate_http_error_flask(404, error)
|
|
543
543
|
except AccessDenied as error:
|
|
@@ -600,7 +600,7 @@ class Attributes(ErrorHandlingMethodView):
|
|
|
600
600
|
parameters = json_parameters()
|
|
601
601
|
value = param_get(parameters, 'value')
|
|
602
602
|
try:
|
|
603
|
-
add_rse_attribute(rse=rse, key=key, value=value, issuer=request.environ
|
|
603
|
+
add_rse_attribute(rse=rse, key=key, value=value, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
604
604
|
except AccessDenied as error:
|
|
605
605
|
return generate_http_error_flask(401, error)
|
|
606
606
|
except Duplicate as error:
|
|
@@ -643,7 +643,7 @@ class Attributes(ErrorHandlingMethodView):
|
|
|
643
643
|
description: Not acceptable
|
|
644
644
|
"""
|
|
645
645
|
try:
|
|
646
|
-
rse_attr = list_rse_attributes(rse, vo=request.environ
|
|
646
|
+
rse_attr = list_rse_attributes(rse, vo=request.environ['vo'])
|
|
647
647
|
except AccessDenied as error:
|
|
648
648
|
return generate_http_error_flask(401, error)
|
|
649
649
|
except RSENotFound as error:
|
|
@@ -680,7 +680,7 @@ class Attributes(ErrorHandlingMethodView):
|
|
|
680
680
|
description: RSE or RSE attribute not found
|
|
681
681
|
"""
|
|
682
682
|
try:
|
|
683
|
-
del_rse_attribute(rse=rse, key=key, issuer=request.environ
|
|
683
|
+
del_rse_attribute(rse=rse, key=key, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
684
684
|
except AccessDenied as error:
|
|
685
685
|
return generate_http_error_flask(401, error)
|
|
686
686
|
except (RSENotFound, RSEAttributeNotFound) as error:
|
|
@@ -831,7 +831,7 @@ class ProtocolList(ErrorHandlingMethodView):
|
|
|
831
831
|
description: Not acceptable
|
|
832
832
|
"""
|
|
833
833
|
try:
|
|
834
|
-
p_list = get_rse_protocols(rse, issuer=request.environ
|
|
834
|
+
p_list = get_rse_protocols(rse, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
835
835
|
except (RSEOperationNotSupported, RSENotFound, RSEProtocolNotSupported, RSEProtocolDomainNotSupported) as error:
|
|
836
836
|
return generate_http_error_flask(404, error)
|
|
837
837
|
|
|
@@ -909,7 +909,7 @@ class LFNS2PFNS(ErrorHandlingMethodView):
|
|
|
909
909
|
operation = request.args.get('operation', default='write')
|
|
910
910
|
|
|
911
911
|
try:
|
|
912
|
-
rse_settings = get_rse_protocols(rse, issuer=request.environ
|
|
912
|
+
rse_settings = get_rse_protocols(rse, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
913
913
|
except (RSENotFound, RSEProtocolNotSupported, RSEProtocolDomainNotSupported) as error:
|
|
914
914
|
return generate_http_error_flask(404, error)
|
|
915
915
|
|
|
@@ -1009,7 +1009,7 @@ class Protocol(ErrorHandlingMethodView):
|
|
|
1009
1009
|
parameters['scheme'] = scheme
|
|
1010
1010
|
|
|
1011
1011
|
try:
|
|
1012
|
-
add_protocol(rse, issuer=request.environ
|
|
1012
|
+
add_protocol(rse, issuer=request.environ['issuer'], vo=request.environ['vo'], data=parameters)
|
|
1013
1013
|
except (RSENotFound, RSEProtocolDomainNotSupported) as error:
|
|
1014
1014
|
return generate_http_error_flask(404, error)
|
|
1015
1015
|
except AccessDenied as error:
|
|
@@ -1167,7 +1167,7 @@ class Protocol(ErrorHandlingMethodView):
|
|
|
1167
1167
|
description: Not acceptable
|
|
1168
1168
|
"""
|
|
1169
1169
|
try:
|
|
1170
|
-
p_list = get_rse_protocols(rse, issuer=request.environ
|
|
1170
|
+
p_list = get_rse_protocols(rse, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
1171
1171
|
except (RSENotFound, RSEProtocolNotSupported, RSEProtocolDomainNotSupported) as error:
|
|
1172
1172
|
return generate_http_error_flask(404, error)
|
|
1173
1173
|
|
|
@@ -1334,8 +1334,8 @@ class Protocol(ErrorHandlingMethodView):
|
|
|
1334
1334
|
try:
|
|
1335
1335
|
update_protocols(
|
|
1336
1336
|
rse,
|
|
1337
|
-
issuer=request.environ
|
|
1338
|
-
vo=request.environ
|
|
1337
|
+
issuer=request.environ['issuer'],
|
|
1338
|
+
vo=request.environ['vo'],
|
|
1339
1339
|
scheme=scheme,
|
|
1340
1340
|
hostname=hostname,
|
|
1341
1341
|
port=int(port) if port else None,
|
|
@@ -1395,8 +1395,8 @@ class Protocol(ErrorHandlingMethodView):
|
|
|
1395
1395
|
try:
|
|
1396
1396
|
del_protocols(
|
|
1397
1397
|
rse,
|
|
1398
|
-
issuer=request.environ
|
|
1399
|
-
vo=request.environ
|
|
1398
|
+
issuer=request.environ['issuer'],
|
|
1399
|
+
vo=request.environ['vo'],
|
|
1400
1400
|
scheme=scheme,
|
|
1401
1401
|
hostname=hostname,
|
|
1402
1402
|
port=int(port) if port else None
|
|
@@ -1485,10 +1485,10 @@ class Usage(ErrorHandlingMethodView):
|
|
|
1485
1485
|
|
|
1486
1486
|
return try_stream(
|
|
1487
1487
|
generate(
|
|
1488
|
-
issuer=request.environ
|
|
1488
|
+
issuer=request.environ['issuer'],
|
|
1489
1489
|
source=request.args.get('source'),
|
|
1490
1490
|
per_account=per_account,
|
|
1491
|
-
vo=request.environ
|
|
1491
|
+
vo=request.environ['vo'],
|
|
1492
1492
|
)
|
|
1493
1493
|
)
|
|
1494
1494
|
except RSENotFound as error:
|
|
@@ -1544,7 +1544,7 @@ class Usage(ErrorHandlingMethodView):
|
|
|
1544
1544
|
kwargs[keyword] = param_get(parameters, keyword, default=kwargs[keyword])
|
|
1545
1545
|
|
|
1546
1546
|
try:
|
|
1547
|
-
set_rse_usage(rse=rse, issuer=request.environ
|
|
1547
|
+
set_rse_usage(rse=rse, issuer=request.environ['issuer'], vo=request.environ['vo'], **kwargs)
|
|
1548
1548
|
except AccessDenied as error:
|
|
1549
1549
|
return generate_http_error_flask(401, error)
|
|
1550
1550
|
except RSENotFound as error:
|
|
@@ -1615,7 +1615,7 @@ class UsageHistory(ErrorHandlingMethodView):
|
|
|
1615
1615
|
for usage in list_rse_usage_history(rse=rse, issuer=issuer, source=source, vo=vo):
|
|
1616
1616
|
yield render_json(**usage) + '\n'
|
|
1617
1617
|
|
|
1618
|
-
return try_stream(generate(issuer=request.environ
|
|
1618
|
+
return try_stream(generate(issuer=request.environ['issuer'], source=request.args.get('source'), vo=request.environ['vo']))
|
|
1619
1619
|
except RSENotFound as error:
|
|
1620
1620
|
return generate_http_error_flask(404, error)
|
|
1621
1621
|
|
|
@@ -1658,7 +1658,7 @@ class Limits(ErrorHandlingMethodView):
|
|
|
1658
1658
|
description: Not acceptable
|
|
1659
1659
|
"""
|
|
1660
1660
|
try:
|
|
1661
|
-
limits = get_rse_limits(rse=rse, issuer=request.environ
|
|
1661
|
+
limits = get_rse_limits(rse=rse, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
1662
1662
|
return Response(render_json(**limits), content_type="application/json")
|
|
1663
1663
|
except RSENotFound as error:
|
|
1664
1664
|
return generate_http_error_flask(404, error)
|
|
@@ -1705,7 +1705,7 @@ class Limits(ErrorHandlingMethodView):
|
|
|
1705
1705
|
kwargs[keyword] = param_get(parameters, keyword, default=kwargs[keyword])
|
|
1706
1706
|
|
|
1707
1707
|
try:
|
|
1708
|
-
set_rse_limits(rse=rse, issuer=request.environ
|
|
1708
|
+
set_rse_limits(rse=rse, issuer=request.environ['issuer'], vo=request.environ['vo'], **kwargs)
|
|
1709
1709
|
except AccessDenied as error:
|
|
1710
1710
|
return generate_http_error_flask(401, error)
|
|
1711
1711
|
except RSENotFound as error:
|
|
@@ -1752,7 +1752,7 @@ class Limits(ErrorHandlingMethodView):
|
|
|
1752
1752
|
name = param_get(parameters, 'name')
|
|
1753
1753
|
|
|
1754
1754
|
try:
|
|
1755
|
-
delete_rse_limits(rse=rse, name=name, issuer=request.environ
|
|
1755
|
+
delete_rse_limits(rse=rse, name=name, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
1756
1756
|
except AccessDenied as error:
|
|
1757
1757
|
return generate_http_error_flask(401, error)
|
|
1758
1758
|
except RSENotFound as error:
|
|
@@ -1820,7 +1820,7 @@ class RSEAccountUsageLimit(ErrorHandlingMethodView):
|
|
|
1820
1820
|
for usage in get_rse_account_usage(rse=rse, vo=vo):
|
|
1821
1821
|
yield render_json(**usage) + '\n'
|
|
1822
1822
|
|
|
1823
|
-
return try_stream(generate(vo=request.environ
|
|
1823
|
+
return try_stream(generate(vo=request.environ['vo']), content_type='application/json')
|
|
1824
1824
|
except RSENotFound as error:
|
|
1825
1825
|
return generate_http_error_flask(404, error)
|
|
1826
1826
|
|
|
@@ -1882,7 +1882,7 @@ class Distance(ErrorHandlingMethodView):
|
|
|
1882
1882
|
description: Not acceptable
|
|
1883
1883
|
"""
|
|
1884
1884
|
try:
|
|
1885
|
-
distance = get_distance(source=source, destination=destination, issuer=request.environ
|
|
1885
|
+
distance = get_distance(source=source, destination=destination, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
1886
1886
|
return Response(dumps(distance, cls=APIEncoder), content_type="application/json")
|
|
1887
1887
|
except RSENotFound as error:
|
|
1888
1888
|
return generate_http_error_flask(404, error)
|
|
@@ -1946,8 +1946,8 @@ class Distance(ErrorHandlingMethodView):
|
|
|
1946
1946
|
source=source,
|
|
1947
1947
|
destination=destination,
|
|
1948
1948
|
distance=distance,
|
|
1949
|
-
issuer=request.environ
|
|
1950
|
-
vo=request.environ
|
|
1949
|
+
issuer=request.environ['issuer'],
|
|
1950
|
+
vo=request.environ['vo'],
|
|
1951
1951
|
)
|
|
1952
1952
|
except AccessDenied as error:
|
|
1953
1953
|
return generate_http_error_flask(401, error)
|
|
@@ -2017,8 +2017,8 @@ class Distance(ErrorHandlingMethodView):
|
|
|
2017
2017
|
source=source,
|
|
2018
2018
|
destination=destination,
|
|
2019
2019
|
distance=distance,
|
|
2020
|
-
issuer=request.environ
|
|
2021
|
-
vo=request.environ
|
|
2020
|
+
issuer=request.environ['issuer'],
|
|
2021
|
+
vo=request.environ['vo'],
|
|
2022
2022
|
)
|
|
2023
2023
|
except AccessDenied as error:
|
|
2024
2024
|
return generate_http_error_flask(401, error)
|
|
@@ -2066,8 +2066,8 @@ class Distance(ErrorHandlingMethodView):
|
|
|
2066
2066
|
delete_distance(
|
|
2067
2067
|
source=source,
|
|
2068
2068
|
destination=destination,
|
|
2069
|
-
issuer=request.environ
|
|
2070
|
-
vo=request.environ
|
|
2069
|
+
issuer=request.environ['issuer'],
|
|
2070
|
+
vo=request.environ['vo']
|
|
2071
2071
|
)
|
|
2072
2072
|
except AccessDenied as error:
|
|
2073
2073
|
return generate_http_error_flask(401, error)
|
|
@@ -2117,7 +2117,7 @@ class QoSPolicy(ErrorHandlingMethodView):
|
|
|
2117
2117
|
description: Not acceptable
|
|
2118
2118
|
"""
|
|
2119
2119
|
try:
|
|
2120
|
-
add_qos_policy(rse=rse, qos_policy=policy, issuer=request.environ
|
|
2120
|
+
add_qos_policy(rse=rse, qos_policy=policy, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
2121
2121
|
except RSENotFound as error:
|
|
2122
2122
|
return generate_http_error_flask(404, error)
|
|
2123
2123
|
|
|
@@ -2155,7 +2155,7 @@ class QoSPolicy(ErrorHandlingMethodView):
|
|
|
2155
2155
|
description: Not acceptable
|
|
2156
2156
|
"""
|
|
2157
2157
|
try:
|
|
2158
|
-
delete_qos_policy(rse=rse, qos_policy=policy, issuer=request.environ
|
|
2158
|
+
delete_qos_policy(rse=rse, qos_policy=policy, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
2159
2159
|
except RSENotFound as error:
|
|
2160
2160
|
return generate_http_error_flask(404, error)
|
|
2161
2161
|
|
|
@@ -2201,7 +2201,7 @@ class QoSPolicy(ErrorHandlingMethodView):
|
|
|
2201
2201
|
description: Not acceptable
|
|
2202
2202
|
"""
|
|
2203
2203
|
try:
|
|
2204
|
-
qos_policies = list_qos_policies(rse=rse, issuer=request.environ
|
|
2204
|
+
qos_policies = list_qos_policies(rse=rse, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
2205
2205
|
return Response(dumps(qos_policies, cls=APIEncoder), content_type='application/json')
|
|
2206
2206
|
except RSENotFound as error:
|
|
2207
2207
|
return generate_http_error_flask(404, error)
|
|
@@ -92,7 +92,7 @@ class Rule(ErrorHandlingMethodView):
|
|
|
92
92
|
return generate_http_error_flask(501, "NotImplemented", exc_msg="estimate_ttc is not implemented!")
|
|
93
93
|
|
|
94
94
|
try:
|
|
95
|
-
rule = get_replication_rule(rule_id, issuer=request.environ
|
|
95
|
+
rule = get_replication_rule(rule_id, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
96
96
|
except RuleNotFound as error:
|
|
97
97
|
return generate_http_error_flask(404, error)
|
|
98
98
|
|
|
@@ -177,7 +177,7 @@ class Rule(ErrorHandlingMethodView):
|
|
|
177
177
|
parameters = json_parameters()
|
|
178
178
|
options: dict[str, Any] = param_get(parameters, 'options')
|
|
179
179
|
try:
|
|
180
|
-
update_replication_rule(rule_id=rule_id, options=options, issuer=request.environ
|
|
180
|
+
update_replication_rule(rule_id=rule_id, options=options, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
181
181
|
except AccessDenied as error:
|
|
182
182
|
return generate_http_error_flask(401, error)
|
|
183
183
|
except (RuleNotFound, AccountNotFound) as error:
|
|
@@ -212,7 +212,7 @@ class Rule(ErrorHandlingMethodView):
|
|
|
212
212
|
parameters = json_parameters()
|
|
213
213
|
purge_replicas = param_get(parameters, 'purge_replicas', default=None)
|
|
214
214
|
try:
|
|
215
|
-
delete_replication_rule(rule_id=rule_id, purge_replicas=purge_replicas, issuer=request.environ
|
|
215
|
+
delete_replication_rule(rule_id=rule_id, purge_replicas=purge_replicas, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
216
216
|
except (AccessDenied, UnsupportedOperation) as error:
|
|
217
217
|
return generate_http_error_flask(401, error)
|
|
218
218
|
except RuleNotFound as error:
|
|
@@ -250,7 +250,7 @@ class AllRule(ErrorHandlingMethodView):
|
|
|
250
250
|
for rule in list_replication_rules(filters=filters, vo=vo):
|
|
251
251
|
yield dumps(rule, cls=APIEncoder) + '\n'
|
|
252
252
|
|
|
253
|
-
return try_stream(generate(filters=dict(request.args.items(multi=False)), vo=request.environ
|
|
253
|
+
return try_stream(generate(filters=dict(request.args.items(multi=False)), vo=request.environ['vo']))
|
|
254
254
|
except RuleNotFound as error:
|
|
255
255
|
return generate_http_error_flask(404, error)
|
|
256
256
|
|
|
@@ -397,8 +397,8 @@ class AllRule(ErrorHandlingMethodView):
|
|
|
397
397
|
priority=param_get(parameters, 'priority', default=3),
|
|
398
398
|
split_container=param_get(parameters, 'split_container', default=False),
|
|
399
399
|
meta=param_get(parameters, 'meta', default=None),
|
|
400
|
-
issuer=request.environ
|
|
401
|
-
vo=request.environ
|
|
400
|
+
issuer=request.environ['issuer'],
|
|
401
|
+
vo=request.environ['vo'],
|
|
402
402
|
)
|
|
403
403
|
except (
|
|
404
404
|
InvalidReplicationRule,
|
|
@@ -477,7 +477,7 @@ class ReplicaLocks(ErrorHandlingMethodView):
|
|
|
477
477
|
for lock in get_replica_locks_for_rule_id(rule_id, vo=vo):
|
|
478
478
|
yield render_json(**lock) + '\n'
|
|
479
479
|
|
|
480
|
-
return try_stream(generate(vo=request.environ
|
|
480
|
+
return try_stream(generate(vo=request.environ['vo']))
|
|
481
481
|
|
|
482
482
|
|
|
483
483
|
class ReduceRule(ErrorHandlingMethodView):
|
|
@@ -531,8 +531,8 @@ class ReduceRule(ErrorHandlingMethodView):
|
|
|
531
531
|
rule_ids = reduce_replication_rule(rule_id=rule_id,
|
|
532
532
|
copies=copies,
|
|
533
533
|
exclude_expression=exclude_expression,
|
|
534
|
-
issuer=request.environ
|
|
535
|
-
vo=request.environ
|
|
534
|
+
issuer=request.environ['issuer'],
|
|
535
|
+
vo=request.environ['vo'])
|
|
536
536
|
# TODO: Add all other error cases here
|
|
537
537
|
except RuleReplaceFailed as error:
|
|
538
538
|
return generate_http_error_flask(409, error)
|
|
@@ -612,8 +612,8 @@ class MoveRule(ErrorHandlingMethodView):
|
|
|
612
612
|
rule_ids = move_replication_rule(rule_id=rule_id,
|
|
613
613
|
rse_expression=rse_expression,
|
|
614
614
|
override=override,
|
|
615
|
-
issuer=request.environ
|
|
616
|
-
vo=request.environ
|
|
615
|
+
issuer=request.environ['issuer'],
|
|
616
|
+
vo=request.environ['vo'])
|
|
617
617
|
except RuleReplaceFailed as error:
|
|
618
618
|
return generate_http_error_flask(409, error)
|
|
619
619
|
except RuleNotFound as error:
|
|
@@ -676,7 +676,7 @@ class RuleHistory(ErrorHandlingMethodView):
|
|
|
676
676
|
for history in list_replication_rule_history(rule_id, issuer=issuer, vo=vo):
|
|
677
677
|
yield render_json(**history) + '\n'
|
|
678
678
|
|
|
679
|
-
return try_stream(generate(issuer=request.environ
|
|
679
|
+
return try_stream(generate(issuer=request.environ['issuer'], vo=request.environ['vo']))
|
|
680
680
|
|
|
681
681
|
|
|
682
682
|
class RuleHistoryFull(ErrorHandlingMethodView):
|
|
@@ -740,13 +740,13 @@ class RuleHistoryFull(ErrorHandlingMethodView):
|
|
|
740
740
|
description: Not acceptable.
|
|
741
741
|
"""
|
|
742
742
|
try:
|
|
743
|
-
scope, name = parse_scope_name(scope_name, request.environ
|
|
743
|
+
scope, name = parse_scope_name(scope_name, request.environ['vo'])
|
|
744
744
|
|
|
745
745
|
def generate(vo):
|
|
746
746
|
for history in list_replication_rule_full_history(scope, name, vo=vo):
|
|
747
747
|
yield render_json(**history) + '\n'
|
|
748
748
|
|
|
749
|
-
return try_stream(generate(vo=request.environ
|
|
749
|
+
return try_stream(generate(vo=request.environ['vo']))
|
|
750
750
|
except ValueError as error:
|
|
751
751
|
return generate_http_error_flask(400, error)
|
|
752
752
|
|
|
@@ -819,7 +819,7 @@ class RuleAnalysis(ErrorHandlingMethodView):
|
|
|
819
819
|
406:
|
|
820
820
|
description: Not acceptable.
|
|
821
821
|
"""
|
|
822
|
-
analysis = examine_replication_rule(rule_id, issuer=request.environ
|
|
822
|
+
analysis = examine_replication_rule(rule_id, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
823
823
|
return Response(render_json(**analysis), content_type='application/json')
|
|
824
824
|
|
|
825
825
|
|