rucio 37.3.0__py3-none-any.whl → 37.5.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.

Files changed (128) hide show
  1. rucio/cli/rule.py +1 -1
  2. rucio/client/accountclient.py +205 -60
  3. rucio/client/accountlimitclient.py +84 -25
  4. rucio/client/baseclient.py +85 -48
  5. rucio/client/client.py +49 -41
  6. rucio/client/configclient.py +36 -13
  7. rucio/client/credentialclient.py +16 -6
  8. rucio/client/didclient.py +321 -133
  9. rucio/client/diracclient.py +13 -6
  10. rucio/client/downloadclient.py +435 -165
  11. rucio/client/exportclient.py +8 -2
  12. rucio/client/fileclient.py +10 -3
  13. rucio/client/importclient.py +4 -1
  14. rucio/client/lifetimeclient.py +48 -31
  15. rucio/client/lockclient.py +22 -7
  16. rucio/client/metaconventionsclient.py +59 -21
  17. rucio/client/pingclient.py +3 -1
  18. rucio/client/replicaclient.py +213 -96
  19. rucio/client/requestclient.py +124 -16
  20. rucio/client/rseclient.py +385 -160
  21. rucio/client/ruleclient.py +147 -51
  22. rucio/client/scopeclient.py +35 -10
  23. rucio/client/subscriptionclient.py +60 -27
  24. rucio/client/touchclient.py +16 -7
  25. rucio/common/constants.py +14 -17
  26. rucio/common/utils.py +18 -2
  27. rucio/core/permission/generic.py +40 -1
  28. rucio/core/replica.py +6 -6
  29. rucio/core/request.py +2 -2
  30. rucio/core/rule.py +5 -3
  31. rucio/core/transfer.py +4 -5
  32. rucio/daemons/conveyor/throttler.py +2 -1
  33. rucio/daemons/judge/evaluator.py +1 -1
  34. rucio/db/sqla/constants.py +3 -3
  35. rucio/db/sqla/migrate_repo/versions/13d4f70c66a9_introduce_transfer_limits.py +1 -1
  36. rucio/db/sqla/models.py +1 -1
  37. rucio/gateway/replica.py +129 -41
  38. rucio/gateway/request.py +177 -103
  39. rucio/gateway/subscription.py +90 -108
  40. rucio/rse/rsemanager.py +2 -2
  41. rucio/vcsversion.py +3 -3
  42. rucio/web/rest/flaskapi/v1/accountlimits.py +22 -22
  43. rucio/web/rest/flaskapi/v1/accounts.py +157 -157
  44. rucio/web/rest/flaskapi/v1/archives.py +10 -10
  45. rucio/web/rest/flaskapi/v1/auth.py +106 -106
  46. rucio/web/rest/flaskapi/v1/config.py +37 -37
  47. rucio/web/rest/flaskapi/v1/credentials.py +25 -25
  48. rucio/web/rest/flaskapi/v1/dids.py +381 -381
  49. rucio/web/rest/flaskapi/v1/dirac.py +8 -8
  50. rucio/web/rest/flaskapi/v1/export.py +6 -6
  51. rucio/web/rest/flaskapi/v1/heartbeats.py +14 -14
  52. rucio/web/rest/flaskapi/v1/identities.py +25 -25
  53. rucio/web/rest/flaskapi/v1/import.py +19 -19
  54. rucio/web/rest/flaskapi/v1/lifetime_exceptions.py +54 -54
  55. rucio/web/rest/flaskapi/v1/locks.py +60 -60
  56. rucio/web/rest/flaskapi/v1/meta_conventions.py +29 -29
  57. rucio/web/rest/flaskapi/v1/nongrid_traces.py +4 -4
  58. rucio/web/rest/flaskapi/v1/ping.py +4 -4
  59. rucio/web/rest/flaskapi/v1/redirect.py +17 -17
  60. rucio/web/rest/flaskapi/v1/replicas.py +282 -282
  61. rucio/web/rest/flaskapi/v1/requests.py +424 -229
  62. rucio/web/rest/flaskapi/v1/rses.py +427 -427
  63. rucio/web/rest/flaskapi/v1/rules.py +129 -129
  64. rucio/web/rest/flaskapi/v1/scopes.py +21 -21
  65. rucio/web/rest/flaskapi/v1/subscriptions.py +122 -122
  66. rucio/web/rest/flaskapi/v1/traces.py +18 -18
  67. rucio/web/rest/flaskapi/v1/vos.py +32 -32
  68. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/rucio.cfg.template +0 -1
  69. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -1
  70. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/requirements.server.txt +1 -1
  71. {rucio-37.3.0.dist-info → rucio-37.5.0.dist-info}/METADATA +1 -1
  72. {rucio-37.3.0.dist-info → rucio-37.5.0.dist-info}/RECORD +128 -128
  73. {rucio-37.3.0.dist-info → rucio-37.5.0.dist-info}/WHEEL +1 -1
  74. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/alembic.ini.template +0 -0
  75. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
  76. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
  77. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
  78. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
  79. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
  80. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
  81. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
  82. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
  83. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
  84. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
  85. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
  86. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/tools/bootstrap.py +0 -0
  87. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
  88. {rucio-37.3.0.data → rucio-37.5.0.data}/data/rucio/tools/reset_database.py +0 -0
  89. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio +0 -0
  90. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-abacus-account +0 -0
  91. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-abacus-collection-replica +0 -0
  92. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-abacus-rse +0 -0
  93. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-admin +0 -0
  94. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-atropos +0 -0
  95. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-auditor +0 -0
  96. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-automatix +0 -0
  97. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-bb8 +0 -0
  98. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-cache-client +0 -0
  99. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-cache-consumer +0 -0
  100. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-conveyor-finisher +0 -0
  101. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-conveyor-poller +0 -0
  102. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-conveyor-preparer +0 -0
  103. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-conveyor-receiver +0 -0
  104. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-conveyor-stager +0 -0
  105. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-conveyor-submitter +0 -0
  106. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-conveyor-throttler +0 -0
  107. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-dark-reaper +0 -0
  108. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-dumper +0 -0
  109. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-follower +0 -0
  110. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-hermes +0 -0
  111. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-judge-cleaner +0 -0
  112. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-judge-evaluator +0 -0
  113. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-judge-injector +0 -0
  114. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-judge-repairer +0 -0
  115. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-kronos +0 -0
  116. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-minos +0 -0
  117. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
  118. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-necromancer +0 -0
  119. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-oauth-manager +0 -0
  120. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-reaper +0 -0
  121. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-replica-recoverer +0 -0
  122. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-rse-decommissioner +0 -0
  123. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-storage-consistency-actions +0 -0
  124. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-transmogrifier +0 -0
  125. {rucio-37.3.0.data → rucio-37.5.0.data}/scripts/rucio-undertaker +0 -0
  126. {rucio-37.3.0.dist-info → rucio-37.5.0.dist-info}/licenses/AUTHORS.rst +0 -0
  127. {rucio-37.3.0.dist-info → rucio-37.5.0.dist-info}/licenses/LICENSE +0 -0
  128. {rucio-37.3.0.dist-info → rucio-37.5.0.dist-info}/top_level.txt +0 -0
@@ -32,87 +32,87 @@ class Subscription(ErrorHandlingMethodView):
32
32
  """
33
33
  ---
34
34
  summary: Get Subscription
35
- description: Retrieve a subscription.
35
+ description: "Retrieve a subscription."
36
36
  tags:
37
37
  - Replicas
38
38
  parameters:
39
39
  - name: account
40
40
  in: path
41
- description: The account name.
41
+ description: "The account name."
42
42
  schema:
43
43
  type: string
44
44
  style: simple
45
45
  - name: name
46
46
  in: path
47
- description: The subscription name.
47
+ description: "The subscription name."
48
48
  schema:
49
49
  type: string
50
50
  style: simple
51
51
  responses:
52
52
  200:
53
- description: OK
53
+ description: "OK"
54
54
  content:
55
55
  application/x-json-stream:
56
56
  schema:
57
- description: A list of subscriptions.
57
+ description: "A list of subscriptions."
58
58
  type: array
59
59
  items:
60
- description: A subscription.
60
+ description: "A subscription."
61
61
  type: object
62
62
  properties:
63
63
  id:
64
- description: The id of the subscription.
64
+ description: "The id of the subscription."
65
65
  type: string
66
66
  name:
67
- description: The name of the subscription.
67
+ description: "The name of the subscription."
68
68
  type: string
69
69
  filter:
70
- description: The filter for the subscription.
70
+ description: "The filter for the subscription."
71
71
  type: string
72
72
  replication_rules:
73
- description: The replication rules for the subscription.
73
+ description: "The replication rules for the subscription."
74
74
  type: string
75
75
  policyid:
76
- description: The policyid for the subscription.
76
+ description: "The policyid for the subscription."
77
77
  type: integer
78
78
  state:
79
- description: The state of the subscription.
79
+ description: "The state of the subscription."
80
80
  type: string
81
81
  enum: ["A", "I", "N", "U", "B"]
82
82
  last_processed:
83
- description: The time the subscription was processed last.
83
+ description: "The time the subscription was processed last."
84
84
  type: string
85
85
  format: date-time
86
86
  account:
87
- description: The account for the subscription.
87
+ description: "The account for the subscription."
88
88
  type: string
89
89
  lifetime:
90
- description: The lifetime for the subscription.
90
+ description: "The lifetime for the subscription."
91
91
  type: string
92
92
  format: date-time
93
93
  comments:
94
- description: The comments for the subscription.
94
+ description: "The comments for the subscription."
95
95
  type: string
96
96
  retroactive:
97
- description: If the subscription is retroactive.
97
+ description: "If the subscription is retroactive."
98
98
  type: boolean
99
99
  expired_at:
100
- description: The date-time of the expiration for the subscription.
100
+ description: "The date-time of the expiration for the subscription."
101
101
  type: string
102
102
  format: date-time
103
103
  401:
104
- description: Invalid Auth Token
104
+ description: "Invalid Auth Token"
105
105
  404:
106
- description: Subscription Not found
106
+ description: "Subscription Not found"
107
107
  406:
108
- description: Not acceptable
108
+ description: "Not acceptable"
109
109
  """
110
110
  try:
111
111
  def generate(vo):
112
112
  for subscription in list_subscriptions(name=name, account=account, vo=vo):
113
113
  yield render_json(**subscription) + '\n'
114
114
 
115
- return try_stream(generate(vo=request.environ.get('vo')))
115
+ return try_stream(generate(vo=request.environ['vo']))
116
116
  except SubscriptionNotFound as error:
117
117
  return generate_http_error_flask(404, error)
118
118
 
@@ -120,20 +120,20 @@ class Subscription(ErrorHandlingMethodView):
120
120
  """
121
121
  ---
122
122
  summary: Update subscription
123
- description: Update an existing subscription.
123
+ description: "Update an existing subscription."
124
124
  tags:
125
125
  - Replicas
126
126
  parameters:
127
127
  - name: account
128
128
  in: path
129
- description: The account name.
129
+ description: "The account name."
130
130
  schema:
131
131
  type: string
132
132
  style: simple
133
133
  required: true
134
134
  - name: name
135
135
  in: path
136
- description: The subscription name.
136
+ description: "The subscription name."
137
137
  schema:
138
138
  type: string
139
139
  style: simple
@@ -147,37 +147,37 @@ class Subscription(ErrorHandlingMethodView):
147
147
  - options
148
148
  properties:
149
149
  options:
150
- description: The values for the new subscription.
150
+ description: "The values for the new subscription."
151
151
  type: object
152
152
  properties:
153
153
  filter:
154
- description: The filter for the subscription.
154
+ description: "The filter for the subscription."
155
155
  type: string
156
156
  replication_rules:
157
- description: The replication rules for the subscription.
157
+ description: "The replication rules for the subscription."
158
158
  type: string
159
159
  comments:
160
- description: The comments for the subscription.
160
+ description: "The comments for the subscription."
161
161
  type: string
162
162
  lifetime:
163
- description: The lifetime for the subscription.
163
+ description: "The lifetime for the subscription."
164
164
  type: string
165
165
  format: date-time
166
166
  retroactive:
167
- description: If the retroactive is activated for a subscription.
167
+ description: "If the retroactive is activated for a subscription."
168
168
  type: boolean
169
169
  priority:
170
- description: The priority/policyid for the subscription. Stored as policyid.
170
+ description: "The priority/policyid for the subscription. Stored as policyid."
171
171
  type: integer
172
172
  responses:
173
173
  201:
174
- description: OK
174
+ description: "OK"
175
175
  400:
176
- description: Cannot decode json parameter list.
176
+ description: "Cannot decode json parameter list."
177
177
  401:
178
- description: Invalid Auth Token
178
+ description: "Invalid Auth Token"
179
179
  404:
180
- description: Not found
180
+ description: "Not found"
181
181
  """
182
182
  parameters = json_parameters()
183
183
  options = param_get(parameters, 'options')
@@ -193,7 +193,7 @@ class Subscription(ErrorHandlingMethodView):
193
193
  metadata[keyword] = param_get(options, keyword, default=metadata[keyword])
194
194
 
195
195
  try:
196
- update_subscription(name=name, account=account, metadata=metadata, issuer=request.environ.get('issuer'), vo=request.environ.get('vo'))
196
+ update_subscription(name=name, account=account, metadata=metadata, issuer=request.environ['issuer'], vo=request.environ['vo'])
197
197
  except (InvalidObject, TypeError) as error:
198
198
  return generate_http_error_flask(400, InvalidObject.__name__, error.args[0])
199
199
  except AccessDenied as error:
@@ -207,20 +207,20 @@ class Subscription(ErrorHandlingMethodView):
207
207
  """
208
208
  ---
209
209
  summary: Create subscription
210
- description: Create a new subscription
210
+ description: "Create a new subscription"
211
211
  tags:
212
212
  - Replicas
213
213
  parameters:
214
214
  - name: account
215
215
  in: path
216
- description: The account name.
216
+ description: "The account name."
217
217
  schema:
218
218
  type: string
219
219
  style: simple
220
220
  required: true
221
221
  - name: name
222
222
  in: path
223
- description: The subscription name.
223
+ description: "The subscription name."
224
224
  schema:
225
225
  type: string
226
226
  style: simple
@@ -234,7 +234,7 @@ class Subscription(ErrorHandlingMethodView):
234
234
  - options
235
235
  properties:
236
236
  options:
237
- description: The values for the new subscription.
237
+ description: "The values for the new subscription."
238
238
  type: object
239
239
  required:
240
240
  - filter
@@ -244,44 +244,44 @@ class Subscription(ErrorHandlingMethodView):
244
244
  - retroactive
245
245
  properties:
246
246
  filter:
247
- description: The filter for the subscription.
247
+ description: "The filter for the subscription."
248
248
  type: string
249
249
  replication_rules:
250
- description: The replication rules for the subscription.
250
+ description: "The replication rules for the subscription."
251
251
  type: string
252
252
  comments:
253
- description: The comments for the subscription.
253
+ description: "The comments for the subscription."
254
254
  type: string
255
255
  lifetime:
256
- description: The lifetime for the subscription.
256
+ description: "The lifetime for the subscription."
257
257
  type: string
258
258
  format: date-time
259
259
  retroactive:
260
- description: If the retroactive is activated for a subscription.
260
+ description: "If the retroactive is activated for a subscription."
261
261
  type: boolean
262
262
  priority:
263
- description: The priority/policyid for the subscription. Stored as policyid.
263
+ description: "The priority/policyid for the subscription. Stored as policyid."
264
264
  type: integer
265
265
  dry_run:
266
- description: The priority/policyid for the subscription. Stored as policyid.
266
+ description: "The priority/policyid for the subscription. Stored as policyid."
267
267
  type: boolean
268
268
  default: false
269
269
  responses:
270
270
  200:
271
- description: OK
271
+ description: "OK"
272
272
  content:
273
273
  application/json:
274
274
  schema:
275
- description: The subscription Id for the new subscription.
275
+ description: "The subscription Id for the new subscription."
276
276
  type: string
277
277
  400:
278
- description: Cannot decode json parameter list.
278
+ description: "Cannot decode json parameter list."
279
279
  401:
280
- description: Invalid Auth Token
280
+ description: "Invalid Auth Token"
281
281
  404:
282
- description: Not found
282
+ description: "Not found"
283
283
  406:
284
- description: Not acceptable
284
+ description: "Not acceptable"
285
285
  """
286
286
  parameters = json_parameters()
287
287
  options = param_get(parameters, 'options')
@@ -306,8 +306,8 @@ class Subscription(ErrorHandlingMethodView):
306
306
  retroactive=retroactive,
307
307
  dry_run=dry_run,
308
308
  priority=priority,
309
- issuer=request.environ.get('issuer'),
310
- vo=request.environ.get('vo'),
309
+ issuer=request.environ['issuer'],
310
+ vo=request.environ['vo'],
311
311
  )
312
312
  except (InvalidObject, TypeError) as error:
313
313
  return generate_http_error_flask(400, InvalidObject.__name__, error.args[0])
@@ -326,81 +326,81 @@ class SubscriptionName(ErrorHandlingMethodView):
326
326
  """
327
327
  ---
328
328
  summary: Get Subscription by Name
329
- description: Retrieve a subscription by name.
329
+ description: "Retrieve a subscription by name."
330
330
  tags:
331
331
  - Replicas
332
332
  parameters:
333
333
  - name: name
334
334
  in: path
335
- description: The subscription name.
335
+ description: "The subscription name."
336
336
  schema:
337
337
  type: string
338
338
  style: simple
339
339
  responses:
340
340
  200:
341
- description: OK
341
+ description: "OK"
342
342
  content:
343
343
  application/x-json-stream:
344
344
  schema:
345
- description: A list of subscriptions.
345
+ description: "A list of subscriptions."
346
346
  type: array
347
347
  items:
348
- description: A subscription.
348
+ description: "A subscription."
349
349
  type: object
350
350
  properties:
351
351
  id:
352
- description: The id of the subscription.
352
+ description: "The id of the subscription."
353
353
  type: string
354
354
  name:
355
- description: The name of the subscription.
355
+ description: "The name of the subscription."
356
356
  type: string
357
357
  filter:
358
- description: The filter for the subscription.
358
+ description: "The filter for the subscription."
359
359
  type: string
360
360
  replication_rules:
361
- description: The replication rules for the subscription.
361
+ description: "The replication rules for the subscription."
362
362
  type: string
363
363
  policyid:
364
- description: The policyid for the subscription.
364
+ description: "The policyid for the subscription."
365
365
  type: integer
366
366
  state:
367
- description: The state of the subscription.
367
+ description: "The state of the subscription."
368
368
  type: string
369
369
  enum: ["A", "I", "N", "U", "B"]
370
370
  last_processed:
371
- description: The time the subscription was processed last.
371
+ description: "The time the subscription was processed last."
372
372
  type: string
373
373
  format: date-time
374
374
  account:
375
- description: The account for the subscription.
375
+ description: "The account for the subscription."
376
376
  type: string
377
377
  lifetime:
378
- description: The lifetime for the subscription.
378
+ description: "The lifetime for the subscription."
379
379
  type: string
380
380
  format: date-time
381
381
  comments:
382
- description: The comments for the subscription.
382
+ description: "The comments for the subscription."
383
383
  type: string
384
384
  retroactive:
385
- description: If the subscription is retroactive.
385
+ description: "If the subscription is retroactive."
386
386
  type: boolean
387
387
  expired_at:
388
- description: The date-time of the expiration for the subscription.
388
+ description: "The date-time of the expiration for the subscription."
389
389
  type: string
390
390
  format: date-time
391
391
  401:
392
- description: Invalid Auth Token
392
+ description: "Invalid Auth Token"
393
393
  404:
394
- description: Not found
394
+ description: "Not found"
395
395
  406:
396
- description: Not acceptable
396
+ description: "Not acceptable"
397
397
  """
398
398
  try:
399
399
  def generate(vo):
400
400
  for subscription in list_subscriptions(name=name, vo=vo):
401
401
  yield render_json(**subscription) + '\n'
402
402
 
403
- return try_stream(generate(vo=request.environ.get('vo')))
403
+ return try_stream(generate(vo=request.environ['vo']))
404
404
  except SubscriptionNotFound as error:
405
405
  return generate_http_error_flask(404, error)
406
406
 
@@ -412,49 +412,49 @@ class Rules(ErrorHandlingMethodView):
412
412
  """
413
413
  ---
414
414
  summary: Get Replication Rules
415
- description: Return all rules of a given subscription id.
415
+ description: "Return all rules of a given subscription id."
416
416
  tags:
417
417
  - Replicas
418
418
  parameters:
419
419
  - name: account
420
420
  in: path
421
- description: The account name.
421
+ description: "The account name."
422
422
  schema:
423
423
  type: string
424
424
  style: simple
425
425
  required: true
426
426
  - name: name
427
427
  in: path
428
- description: The subscription name.
428
+ description: "The subscription name."
429
429
  schema:
430
430
  type: string
431
431
  style: simple
432
432
  required: true
433
433
  - name: state
434
434
  in: query
435
- description: The subscription state to filter for.
435
+ description: "The subscription state to filter for."
436
436
  schema:
437
437
  type: string
438
438
  responses:
439
439
  200:
440
- description: OK
440
+ description: "OK"
441
441
  content:
442
442
  application/x-json-stream:
443
443
  schema:
444
- description: A list with the associated replication rules.
444
+ description: "A list with the associated replication rules."
445
445
  type: array
446
446
  items:
447
- description: A subscription rule.
447
+ description: "A subscription rule."
448
448
  401:
449
- description: Invalid Auth Token
449
+ description: "Invalid Auth Token"
450
450
  404:
451
- description: Rule or Subscription not found
451
+ description: "Rule or Subscription not found"
452
452
  406:
453
- description: Not acceptable
453
+ description: "Not acceptable"
454
454
  """
455
455
  state = request.args.get('state', default=None)
456
456
  try:
457
- subscriptions = [subscription['id'] for subscription in list_subscriptions(name=name, account=account, vo=request.environ.get('vo'))]
457
+ subscriptions = [subscription['id'] for subscription in list_subscriptions(name=name, account=account, vo=request.environ['vo'])]
458
458
 
459
459
  def generate(vo):
460
460
  if len(subscriptions) > 0:
@@ -465,7 +465,7 @@ class Rules(ErrorHandlingMethodView):
465
465
  for rule in list_replication_rules({'subscription_id': subscriptions[0]}, vo=vo):
466
466
  yield render_json(**rule) + '\n'
467
467
 
468
- return try_stream(generate(vo=request.environ.get('vo')))
468
+ return try_stream(generate(vo=request.environ['vo']))
469
469
  except (RuleNotFound, SubscriptionNotFound) as error:
470
470
  return generate_http_error_flask(404, error)
471
471
 
@@ -477,59 +477,59 @@ class States(ErrorHandlingMethodView):
477
477
  """
478
478
  ---
479
479
  summary: Get states
480
- description: Return a summary of the states of all rules of a given subscription id.
480
+ description: "Return a summary of the states of all rules of a given subscription id."
481
481
  tags:
482
482
  - Replicas
483
483
  parameters:
484
484
  - name: account
485
485
  in: path
486
- description: The account name.
486
+ description: "The account name."
487
487
  schema:
488
488
  type: string
489
489
  style: simple
490
490
  required: true
491
491
  - name: name
492
492
  in: path
493
- description: The subscription name.
493
+ description: "The subscription name."
494
494
  schema:
495
495
  type: string
496
496
  style: simple
497
497
  responses:
498
498
  200:
499
- description: OK
499
+ description: "OK"
500
500
  content:
501
501
  application/x-json-stream:
502
502
  schema:
503
- description: A list of rule states with counts for each subscription.
503
+ description: "A list of rule states with counts for each subscription."
504
504
  type: array
505
505
  items:
506
506
  type: object
507
507
  properties:
508
508
  account:
509
- description: The account for the subscription.
509
+ description: "The account for the subscription."
510
510
  type: string
511
511
  name:
512
- description: The name of the subscription.
512
+ description: "The name of the subscription."
513
513
  type: string
514
514
  state:
515
- description: The state of the rules.
515
+ description: "The state of the rules."
516
516
  type: string
517
517
  enum: ["R", "O", "S", "U", "W", "I"]
518
518
  count:
519
- description: The number of rules with that state.
519
+ description: "The number of rules with that state."
520
520
  type: integer
521
521
  401:
522
- description: Invalid Auth Token
522
+ description: "Invalid Auth Token"
523
523
  404:
524
- description: Not found
524
+ description: "Not found"
525
525
  406:
526
- description: Not acceptable
526
+ description: "Not acceptable"
527
527
  """
528
528
  def generate(vo):
529
529
  for row in list_subscription_rule_states(name=name, account=account, vo=vo):
530
530
  yield dumps(row, cls=APIEncoder) + '\n'
531
531
 
532
- return try_stream(generate(vo=request.environ.get('vo')))
532
+ return try_stream(generate(vo=request.environ['vo']))
533
533
 
534
534
 
535
535
  class SubscriptionId(ErrorHandlingMethodView):
@@ -539,75 +539,75 @@ class SubscriptionId(ErrorHandlingMethodView):
539
539
  """
540
540
  ---
541
541
  summary: Get Subscription from ID
542
- description: Retrieve a subscription matching the given subscription id.
542
+ description: "Retrieve a subscription matching the given subscription id."
543
543
  tags:
544
544
  - Replicas
545
545
  parameters:
546
546
  - name: subscription_id
547
547
  in: path
548
- description: The subscription id.
548
+ description: "The subscription id."
549
549
  schema:
550
550
  type: string
551
551
  style: simple
552
552
  required: true
553
553
  responses:
554
554
  200:
555
- description: OK
555
+ description: "OK"
556
556
  content:
557
557
  application/json:
558
558
  schema:
559
- description: The subscription.
559
+ description: "The subscription."
560
560
  type: object
561
561
  properties:
562
562
  id:
563
- description: The id of the subscription.
563
+ description: "The id of the subscription."
564
564
  type: string
565
565
  name:
566
- description: The name of the subscription.
566
+ description: "The name of the subscription."
567
567
  type: string
568
568
  filter:
569
- description: The filter for the subscription.
569
+ description: "The filter for the subscription."
570
570
  type: string
571
571
  replication_rules:
572
- description: The replication rules for the subscription.
572
+ description: "The replication rules for the subscription."
573
573
  type: string
574
574
  policyid:
575
- description: The policyid for the subscription.
575
+ description: "The policyid for the subscription."
576
576
  type: integer
577
577
  state:
578
- description: The state of the subscription.
578
+ description: "The state of the subscription."
579
579
  type: string
580
580
  enum: ["A", "I", "N", "U", "B"]
581
581
  last_processed:
582
- description: The time the subscription was processed last.
582
+ description: "The time the subscription was processed last."
583
583
  type: string
584
584
  format: date-time
585
585
  account:
586
- description: The account for the subscription.
586
+ description: "The account for the subscription."
587
587
  type: string
588
588
  lifetime:
589
- description: The lifetime for the subscription.
589
+ description: "The lifetime for the subscription."
590
590
  type: string
591
591
  format: date-time
592
592
  comments:
593
- description: The comments for the subscription.
593
+ description: "The comments for the subscription."
594
594
  type: string
595
595
  retroactive:
596
- description: If the subscription is retroactive.
596
+ description: "If the subscription is retroactive."
597
597
  type: boolean
598
598
  expired_at:
599
- description: The date-time of the expiration for the subscription.
599
+ description: "The date-time of the expiration for the subscription."
600
600
  type: string
601
601
  format: date-time
602
602
  401:
603
- description: Invalid Auth Token
603
+ description: "Invalid Auth Token"
604
604
  404:
605
- description: Subscription not found
605
+ description: "Subscription not found"
606
606
  406:
607
- description: Not acceptable
607
+ description: "Not acceptable"
608
608
  """
609
609
  try:
610
- subscription = get_subscription_by_id(subscription_id, vo=request.environ.get('vo'))
610
+ subscription = get_subscription_by_id(subscription_id, vo=request.environ['vo'])
611
611
  except SubscriptionNotFound as error:
612
612
  return generate_http_error_flask(404, error)
613
613