rucio-clients 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-clients might be problematic. Click here for more details.
- rucio/cli/rule.py +1 -1
- rucio/client/accountclient.py +205 -60
- rucio/client/accountlimitclient.py +84 -25
- rucio/client/baseclient.py +85 -48
- rucio/client/client.py +49 -41
- rucio/client/configclient.py +36 -13
- rucio/client/credentialclient.py +16 -6
- rucio/client/didclient.py +321 -133
- rucio/client/diracclient.py +13 -6
- rucio/client/downloadclient.py +435 -165
- rucio/client/exportclient.py +8 -2
- rucio/client/fileclient.py +10 -3
- rucio/client/importclient.py +4 -1
- rucio/client/lifetimeclient.py +48 -31
- rucio/client/lockclient.py +22 -7
- rucio/client/metaconventionsclient.py +59 -21
- rucio/client/pingclient.py +3 -1
- rucio/client/replicaclient.py +213 -96
- rucio/client/requestclient.py +124 -16
- rucio/client/rseclient.py +385 -160
- rucio/client/ruleclient.py +147 -51
- rucio/client/scopeclient.py +35 -10
- rucio/client/subscriptionclient.py +60 -27
- rucio/client/touchclient.py +16 -7
- rucio/common/constants.py +14 -17
- rucio/common/utils.py +18 -2
- rucio/rse/rsemanager.py +2 -2
- rucio/vcsversion.py +3 -3
- {rucio_clients-37.3.0.data → rucio_clients-37.5.0.data}/data/etc/rucio.cfg.template +0 -1
- {rucio_clients-37.3.0.dist-info → rucio_clients-37.5.0.dist-info}/METADATA +1 -1
- {rucio_clients-37.3.0.dist-info → rucio_clients-37.5.0.dist-info}/RECORD +41 -41
- {rucio_clients-37.3.0.dist-info → rucio_clients-37.5.0.dist-info}/WHEEL +1 -1
- {rucio_clients-37.3.0.data → rucio_clients-37.5.0.data}/data/etc/rse-accounts.cfg.template +0 -0
- {rucio_clients-37.3.0.data → rucio_clients-37.5.0.data}/data/etc/rucio.cfg.atlas.client.template +0 -0
- {rucio_clients-37.3.0.data → rucio_clients-37.5.0.data}/data/requirements.client.txt +0 -0
- {rucio_clients-37.3.0.data → rucio_clients-37.5.0.data}/data/rucio_client/merge_rucio_configs.py +0 -0
- {rucio_clients-37.3.0.data → rucio_clients-37.5.0.data}/scripts/rucio +0 -0
- {rucio_clients-37.3.0.data → rucio_clients-37.5.0.data}/scripts/rucio-admin +0 -0
- {rucio_clients-37.3.0.dist-info → rucio_clients-37.5.0.dist-info}/licenses/AUTHORS.rst +0 -0
- {rucio_clients-37.3.0.dist-info → rucio_clients-37.5.0.dist-info}/licenses/LICENSE +0 -0
- {rucio_clients-37.3.0.dist-info → rucio_clients-37.5.0.dist-info}/top_level.txt +0 -0
rucio/client/didclient.py
CHANGED
|
@@ -45,14 +45,21 @@ class DIDClient(BaseClient):
|
|
|
45
45
|
"""
|
|
46
46
|
List all data identifiers in a scope which match a given pattern.
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
Parameters
|
|
49
|
+
----------
|
|
50
|
+
scope :
|
|
51
|
+
The scope name.
|
|
52
|
+
filters :
|
|
53
|
+
A nested dictionary of key/value pairs like [{'key1': 'value1', 'key2.lte': 'value2'}, {'key3.gte, 'value3'}].
|
|
54
|
+
Keypairs in the same dictionary are AND'ed together, dictionaries are OR'ed together. Keys should be suffixed
|
|
55
|
+
like <key>.<operation>, e.g. key1 >= value1 is equivalent to {'key1.gte': value}, where <operation> belongs to one
|
|
56
|
+
of the set {'lte', 'gte', 'gt', 'lt', 'ne' or ''}. Equivalence doesn't require an operator.
|
|
57
|
+
did_type :
|
|
58
|
+
The type of the did: 'all'(container, dataset or file)|'collection'(dataset or container)|'dataset'|'container'|'file'
|
|
59
|
+
long :
|
|
60
|
+
Long format option to display more information for each DID.
|
|
61
|
+
recursive :
|
|
62
|
+
Recursively list DIDs content.
|
|
56
63
|
"""
|
|
57
64
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), 'dids', 'search'])
|
|
58
65
|
|
|
@@ -103,15 +110,27 @@ class DIDClient(BaseClient):
|
|
|
103
110
|
"""
|
|
104
111
|
Add data identifier for a dataset or container.
|
|
105
112
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
Parameters
|
|
114
|
+
----------
|
|
115
|
+
scope :
|
|
116
|
+
The scope name.
|
|
117
|
+
name :
|
|
118
|
+
The data identifier name.
|
|
119
|
+
did_type :
|
|
120
|
+
The data identifier type (dataset|container).
|
|
121
|
+
statuses :
|
|
122
|
+
Dictionary with statuses, e.g. {'monotonic':True}.
|
|
123
|
+
meta :
|
|
124
|
+
Meta-data associated with the data identifier is represented using key/value pairs in a dictionary.
|
|
125
|
+
rules :
|
|
126
|
+
Replication rules associated with the data identifier. A list of dictionaries,
|
|
127
|
+
e.g., [{'copies': 2, 'rse_expression': 'TIERS1'}, ].
|
|
128
|
+
lifetime :
|
|
129
|
+
DID's lifetime (in seconds).
|
|
130
|
+
dids :
|
|
131
|
+
The content.
|
|
132
|
+
rse :
|
|
133
|
+
The RSE name when registering replicas.
|
|
115
134
|
"""
|
|
116
135
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name)])
|
|
117
136
|
url = build_url(choice(self.list_hosts), path=path)
|
|
@@ -163,14 +182,25 @@ class DIDClient(BaseClient):
|
|
|
163
182
|
"""
|
|
164
183
|
Add data identifier for a dataset.
|
|
165
184
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
185
|
+
Parameters
|
|
186
|
+
----------
|
|
187
|
+
scope :
|
|
188
|
+
The scope name.
|
|
189
|
+
name :
|
|
190
|
+
The data identifier name.
|
|
191
|
+
statuses :
|
|
192
|
+
Dictionary with statuses, e.g. {'monotonic':True}.
|
|
193
|
+
meta :
|
|
194
|
+
Meta-data associated with the data identifier is represented using key/value pairs in a dictionary.
|
|
195
|
+
rules :
|
|
196
|
+
Replication rules associated with the data identifier. A list of dictionaries,
|
|
197
|
+
e.g., [{'copies': 2, 'rse_expression': 'TIERS1'}, ].
|
|
198
|
+
lifetime :
|
|
199
|
+
DID's lifetime (in seconds).
|
|
200
|
+
files :
|
|
201
|
+
The content.
|
|
202
|
+
rse :
|
|
203
|
+
The RSE name when registering replicas.
|
|
174
204
|
"""
|
|
175
205
|
return self.add_did(scope=scope, name=name, did_type='DATASET',
|
|
176
206
|
statuses=statuses, meta=meta, rules=rules,
|
|
@@ -180,7 +210,10 @@ class DIDClient(BaseClient):
|
|
|
180
210
|
"""
|
|
181
211
|
Bulk add datasets.
|
|
182
212
|
|
|
183
|
-
|
|
213
|
+
Parameters
|
|
214
|
+
----------
|
|
215
|
+
dsns :
|
|
216
|
+
A list of datasets.
|
|
184
217
|
"""
|
|
185
218
|
return self.add_dids(dids=[dict(list(dsn.items()) + [('type', 'DATASET')]) for dsn in dsns])
|
|
186
219
|
|
|
@@ -196,12 +229,21 @@ class DIDClient(BaseClient):
|
|
|
196
229
|
"""
|
|
197
230
|
Add data identifier for a container.
|
|
198
231
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
232
|
+
Parameters
|
|
233
|
+
----------
|
|
234
|
+
scope :
|
|
235
|
+
The scope name.
|
|
236
|
+
name :
|
|
237
|
+
The data identifier name.
|
|
238
|
+
statuses :
|
|
239
|
+
Dictionary with statuses, e.g. {'monotonic':True}.
|
|
240
|
+
meta :
|
|
241
|
+
Meta-data associated with the data identifier is represented using key/value pairs in a dictionary.
|
|
242
|
+
rules :
|
|
243
|
+
Replication rules associated with the data identifier. A list of dictionaries,
|
|
244
|
+
e.g., [{'copies': 2, 'rse_expression': 'TIERS1'}, ].
|
|
245
|
+
lifetime :
|
|
246
|
+
DID's lifetime (in seconds).
|
|
205
247
|
"""
|
|
206
248
|
return self.add_did(scope=scope, name=name, did_type='CONTAINER', statuses=statuses, meta=meta, rules=rules, lifetime=lifetime)
|
|
207
249
|
|
|
@@ -209,7 +251,10 @@ class DIDClient(BaseClient):
|
|
|
209
251
|
"""
|
|
210
252
|
Bulk add containers.
|
|
211
253
|
|
|
212
|
-
|
|
254
|
+
Parameters
|
|
255
|
+
----------
|
|
256
|
+
cnts :
|
|
257
|
+
A list of containers.
|
|
213
258
|
"""
|
|
214
259
|
return self.add_dids(dids=[dict(list(cnt.items()) + [('type', 'CONTAINER')]) for cnt in cnts])
|
|
215
260
|
|
|
@@ -223,10 +268,16 @@ class DIDClient(BaseClient):
|
|
|
223
268
|
"""
|
|
224
269
|
Attach data identifier.
|
|
225
270
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
271
|
+
Parameters
|
|
272
|
+
----------
|
|
273
|
+
scope :
|
|
274
|
+
The scope name.
|
|
275
|
+
name :
|
|
276
|
+
The data identifier name.
|
|
277
|
+
dids :
|
|
278
|
+
The content.
|
|
279
|
+
rse :
|
|
280
|
+
The RSE name when registering replicas.
|
|
230
281
|
"""
|
|
231
282
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'dids'])
|
|
232
283
|
url = build_url(choice(self.list_hosts), path=path)
|
|
@@ -247,11 +298,16 @@ class DIDClient(BaseClient):
|
|
|
247
298
|
dids: Optional["Sequence[Mapping[str, Any]]"] = None
|
|
248
299
|
) -> bool:
|
|
249
300
|
"""
|
|
250
|
-
Detach data identifier
|
|
301
|
+
Detach data identifier.
|
|
251
302
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
303
|
+
Parameters
|
|
304
|
+
----------
|
|
305
|
+
scope :
|
|
306
|
+
The scope name.
|
|
307
|
+
name :
|
|
308
|
+
The data identifier name.
|
|
309
|
+
dids :
|
|
310
|
+
The content.
|
|
255
311
|
"""
|
|
256
312
|
|
|
257
313
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'dids'])
|
|
@@ -271,11 +327,14 @@ class DIDClient(BaseClient):
|
|
|
271
327
|
"""
|
|
272
328
|
Add dids to dids.
|
|
273
329
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
330
|
+
Parameters
|
|
331
|
+
----------
|
|
332
|
+
attachments :
|
|
333
|
+
The attachments.
|
|
334
|
+
An attachment contains: "scope", "name", "dids".
|
|
277
335
|
dids is: [{'scope': scope, 'name': name}, ...]
|
|
278
|
-
|
|
336
|
+
ignore_duplicate :
|
|
337
|
+
If True, ignore duplicate entries.
|
|
279
338
|
"""
|
|
280
339
|
path = '/'.join([self.DIDS_BASEURL, 'attachments'])
|
|
281
340
|
url = build_url(choice(self.list_hosts), path=path)
|
|
@@ -295,11 +354,14 @@ class DIDClient(BaseClient):
|
|
|
295
354
|
"""
|
|
296
355
|
Add files to datasets.
|
|
297
356
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
357
|
+
Parameters
|
|
358
|
+
----------
|
|
359
|
+
attachments :
|
|
360
|
+
The attachments.
|
|
361
|
+
An attachment contains: "scope", "name", "dids".
|
|
301
362
|
dids is: [{'scope': scope, 'name': name}, ...]
|
|
302
|
-
|
|
363
|
+
ignore_duplicate :
|
|
364
|
+
If True, ignore duplicate entries.
|
|
303
365
|
"""
|
|
304
366
|
return self.attach_dids_to_dids(attachments=attachments,
|
|
305
367
|
ignore_duplicate=ignore_duplicate)
|
|
@@ -311,9 +373,11 @@ class DIDClient(BaseClient):
|
|
|
311
373
|
"""
|
|
312
374
|
Add datasets_to_containers.
|
|
313
375
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
376
|
+
Parameters
|
|
377
|
+
----------
|
|
378
|
+
attachments :
|
|
379
|
+
The attachments.
|
|
380
|
+
An attachment contains: "scope", "name", "dids".
|
|
317
381
|
dids is: [{'scope': scope, 'name': name}, ...]
|
|
318
382
|
"""
|
|
319
383
|
return self.attach_dids_to_dids(attachments=attachments)
|
|
@@ -325,9 +389,11 @@ class DIDClient(BaseClient):
|
|
|
325
389
|
"""
|
|
326
390
|
Add containers_to_containers.
|
|
327
391
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
392
|
+
Parameters
|
|
393
|
+
----------
|
|
394
|
+
attachments :
|
|
395
|
+
The attachments.
|
|
396
|
+
An attachment contains: "scope", "name", "dids".
|
|
331
397
|
dids is: [{'scope': scope, 'name': name}, ...]
|
|
332
398
|
"""
|
|
333
399
|
return self.attach_dids_to_dids(attachments=attachments)
|
|
@@ -342,10 +408,16 @@ class DIDClient(BaseClient):
|
|
|
342
408
|
"""
|
|
343
409
|
Add files to datasets.
|
|
344
410
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
411
|
+
Parameters
|
|
412
|
+
----------
|
|
413
|
+
scope :
|
|
414
|
+
The scope name.
|
|
415
|
+
name :
|
|
416
|
+
The dataset name.
|
|
417
|
+
files :
|
|
418
|
+
The content.
|
|
419
|
+
rse :
|
|
420
|
+
The RSE name when registering replicas.
|
|
349
421
|
"""
|
|
350
422
|
return self.attach_dids(scope=scope, name=name, dids=files, rse=rse)
|
|
351
423
|
|
|
@@ -358,9 +430,14 @@ class DIDClient(BaseClient):
|
|
|
358
430
|
"""
|
|
359
431
|
Add files to archive.
|
|
360
432
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
433
|
+
Parameters
|
|
434
|
+
----------
|
|
435
|
+
scope :
|
|
436
|
+
The scope name.
|
|
437
|
+
name :
|
|
438
|
+
The dataset name.
|
|
439
|
+
files :
|
|
440
|
+
The content.
|
|
364
441
|
"""
|
|
365
442
|
return self.attach_dids(scope=scope, name=name, dids=files)
|
|
366
443
|
|
|
@@ -373,9 +450,14 @@ class DIDClient(BaseClient):
|
|
|
373
450
|
"""
|
|
374
451
|
Add datasets to container.
|
|
375
452
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
453
|
+
Parameters
|
|
454
|
+
----------
|
|
455
|
+
scope :
|
|
456
|
+
The scope name.
|
|
457
|
+
name :
|
|
458
|
+
The dataset name.
|
|
459
|
+
dsns :
|
|
460
|
+
The content.
|
|
379
461
|
"""
|
|
380
462
|
return self.attach_dids(scope=scope, name=name, dids=dsns)
|
|
381
463
|
|
|
@@ -388,9 +470,14 @@ class DIDClient(BaseClient):
|
|
|
388
470
|
"""
|
|
389
471
|
Add containers to container.
|
|
390
472
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
473
|
+
Parameters
|
|
474
|
+
----------
|
|
475
|
+
scope :
|
|
476
|
+
The scope name.
|
|
477
|
+
name :
|
|
478
|
+
The dataset name.
|
|
479
|
+
cnts :
|
|
480
|
+
The content.
|
|
394
481
|
"""
|
|
395
482
|
return self.attach_dids(scope=scope, name=name, dids=cnts)
|
|
396
483
|
|
|
@@ -402,8 +489,12 @@ class DIDClient(BaseClient):
|
|
|
402
489
|
"""
|
|
403
490
|
List data identifier contents.
|
|
404
491
|
|
|
405
|
-
|
|
406
|
-
|
|
492
|
+
Parameters
|
|
493
|
+
----------
|
|
494
|
+
scope :
|
|
495
|
+
The scope name.
|
|
496
|
+
name :
|
|
497
|
+
The data identifier name.
|
|
407
498
|
"""
|
|
408
499
|
|
|
409
500
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'dids'])
|
|
@@ -422,8 +513,13 @@ class DIDClient(BaseClient):
|
|
|
422
513
|
"""
|
|
423
514
|
List data identifier contents history.
|
|
424
515
|
|
|
425
|
-
|
|
426
|
-
|
|
516
|
+
Parameters
|
|
517
|
+
----------
|
|
518
|
+
scope :
|
|
519
|
+
The scope name.
|
|
520
|
+
name :
|
|
521
|
+
The data identifier name.
|
|
522
|
+
|
|
427
523
|
"""
|
|
428
524
|
|
|
429
525
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'dids', 'history'])
|
|
@@ -443,9 +539,14 @@ class DIDClient(BaseClient):
|
|
|
443
539
|
"""
|
|
444
540
|
List data identifier file contents.
|
|
445
541
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
542
|
+
Parameters
|
|
543
|
+
----------
|
|
544
|
+
scope :
|
|
545
|
+
The scope name.
|
|
546
|
+
name :
|
|
547
|
+
The data identifier name.
|
|
548
|
+
long :
|
|
549
|
+
A boolean to choose if GUID is returned or not.
|
|
449
550
|
"""
|
|
450
551
|
|
|
451
552
|
payload = {}
|
|
@@ -465,7 +566,10 @@ class DIDClient(BaseClient):
|
|
|
465
566
|
"""
|
|
466
567
|
List data identifier file contents.
|
|
467
568
|
|
|
468
|
-
|
|
569
|
+
Parameters
|
|
570
|
+
----------
|
|
571
|
+
dids :
|
|
572
|
+
The list of DIDs.
|
|
469
573
|
"""
|
|
470
574
|
|
|
471
575
|
data = {'dids': dids}
|
|
@@ -489,11 +593,17 @@ class DIDClient(BaseClient):
|
|
|
489
593
|
"""
|
|
490
594
|
Retrieve a single data identifier.
|
|
491
595
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
596
|
+
Parameters
|
|
597
|
+
----------
|
|
598
|
+
scope :
|
|
599
|
+
The scope name.
|
|
600
|
+
name :
|
|
601
|
+
The data identifier name.
|
|
602
|
+
dynamic_depth :
|
|
603
|
+
The DID type ('FILE'/'DATASET') at which to stop the dynamic
|
|
604
|
+
length/bytes calculation. If not set, the size will not be computed dynamically.
|
|
605
|
+
dynamic :
|
|
606
|
+
Deprecated. Same as setting dynamic_depth='FILE'.
|
|
497
607
|
"""
|
|
498
608
|
|
|
499
609
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name)])
|
|
@@ -517,11 +627,16 @@ class DIDClient(BaseClient):
|
|
|
517
627
|
plugin: str = 'DID_COLUMN'
|
|
518
628
|
) -> dict[str, Any]:
|
|
519
629
|
"""
|
|
520
|
-
Get data identifier metadata
|
|
630
|
+
Get data identifier metadata.
|
|
521
631
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
632
|
+
Parameters
|
|
633
|
+
----------
|
|
634
|
+
scope :
|
|
635
|
+
The scope name.
|
|
636
|
+
name :
|
|
637
|
+
The data identifier name.
|
|
638
|
+
plugin :
|
|
639
|
+
Backend Metadata plugin the Rucio server should use to query data.
|
|
525
640
|
"""
|
|
526
641
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'meta'])
|
|
527
642
|
url = build_url(choice(self.list_hosts), path=path)
|
|
@@ -543,9 +658,14 @@ class DIDClient(BaseClient):
|
|
|
543
658
|
) -> "Iterator[dict[str, Any]]":
|
|
544
659
|
"""
|
|
545
660
|
Bulk get data identifier metadata
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
661
|
+
Parameters
|
|
662
|
+
----------
|
|
663
|
+
dids :
|
|
664
|
+
A list of dids.
|
|
665
|
+
inherit :
|
|
666
|
+
A boolean. If set to true, the metadata of the parent are concatenated.
|
|
667
|
+
plugin :
|
|
668
|
+
The metadata plugin to query, 'ALL' for all available plugins
|
|
549
669
|
"""
|
|
550
670
|
data = {'dids': dids, 'inherit': inherit, 'plugin': plugin}
|
|
551
671
|
path = '/'.join([self.DIDS_BASEURL, 'bulkmeta'])
|
|
@@ -565,13 +685,20 @@ class DIDClient(BaseClient):
|
|
|
565
685
|
recursive: bool = False
|
|
566
686
|
) -> bool:
|
|
567
687
|
"""
|
|
568
|
-
Set data identifier metadata
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
688
|
+
Set data identifier metadata.
|
|
689
|
+
|
|
690
|
+
Parameters
|
|
691
|
+
----------
|
|
692
|
+
scope :
|
|
693
|
+
The scope name.
|
|
694
|
+
name :
|
|
695
|
+
The data identifier name.
|
|
696
|
+
key :
|
|
697
|
+
The metadata key.
|
|
698
|
+
value :
|
|
699
|
+
The metadata value.
|
|
700
|
+
recursive :
|
|
701
|
+
Option to propagate the metadata change to content.
|
|
575
702
|
"""
|
|
576
703
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'meta', key])
|
|
577
704
|
url = build_url(choice(self.list_hosts), path=path)
|
|
@@ -593,10 +720,16 @@ class DIDClient(BaseClient):
|
|
|
593
720
|
"""
|
|
594
721
|
Set data identifier metadata in bulk.
|
|
595
722
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
723
|
+
Parameters
|
|
724
|
+
----------
|
|
725
|
+
scope :
|
|
726
|
+
The scope name.
|
|
727
|
+
name :
|
|
728
|
+
The data identifier name.
|
|
729
|
+
meta :
|
|
730
|
+
The metadata key-value pairs.
|
|
731
|
+
recursive :
|
|
732
|
+
Option to propagate the metadata change to content.
|
|
600
733
|
"""
|
|
601
734
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'meta'])
|
|
602
735
|
url = build_url(choice(self.list_hosts), path=path)
|
|
@@ -616,8 +749,13 @@ class DIDClient(BaseClient):
|
|
|
616
749
|
"""
|
|
617
750
|
Set metadata to a list of data identifiers.
|
|
618
751
|
|
|
619
|
-
|
|
620
|
-
|
|
752
|
+
Parameters
|
|
753
|
+
----------
|
|
754
|
+
dids :
|
|
755
|
+
A list of dids including metadata, i.e.
|
|
756
|
+
[{'scope': scope1, 'name': name1, 'meta': {key1: value1, key2: value2}}, ...].
|
|
757
|
+
recursive :
|
|
758
|
+
Option to propagate the metadata update to content.
|
|
621
759
|
"""
|
|
622
760
|
path = '/'.join([self.DIDS_BASEURL, 'bulkdidsmeta'])
|
|
623
761
|
url = build_url(choice(self.list_hosts), path=path)
|
|
@@ -636,11 +774,16 @@ class DIDClient(BaseClient):
|
|
|
636
774
|
**kwargs
|
|
637
775
|
) -> bool:
|
|
638
776
|
"""
|
|
639
|
-
Set data identifier status
|
|
777
|
+
Set data identifier status.
|
|
640
778
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
779
|
+
Parameters
|
|
780
|
+
----------
|
|
781
|
+
scope :
|
|
782
|
+
The scope name.
|
|
783
|
+
name :
|
|
784
|
+
The data identifier name.
|
|
785
|
+
**kwargs
|
|
786
|
+
Keyword arguments of the form status_name=value.
|
|
644
787
|
"""
|
|
645
788
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'status'])
|
|
646
789
|
url = build_url(choice(self.list_hosts), path=path)
|
|
@@ -658,10 +801,14 @@ class DIDClient(BaseClient):
|
|
|
658
801
|
name: str
|
|
659
802
|
) -> bool:
|
|
660
803
|
"""
|
|
661
|
-
|
|
804
|
+
Close dataset/container.
|
|
662
805
|
|
|
663
|
-
|
|
664
|
-
|
|
806
|
+
Parameters
|
|
807
|
+
----------
|
|
808
|
+
scope :
|
|
809
|
+
The scope name.
|
|
810
|
+
name :
|
|
811
|
+
The dataset/container name.
|
|
665
812
|
"""
|
|
666
813
|
return self.set_status(scope=scope, name=name, open=False)
|
|
667
814
|
|
|
@@ -672,11 +819,16 @@ class DIDClient(BaseClient):
|
|
|
672
819
|
key: str
|
|
673
820
|
) -> bool:
|
|
674
821
|
"""
|
|
675
|
-
Delete data identifier metadata
|
|
822
|
+
Delete data identifier metadata.
|
|
676
823
|
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
824
|
+
Parameters
|
|
825
|
+
----------
|
|
826
|
+
scope :
|
|
827
|
+
The scope name.
|
|
828
|
+
name :
|
|
829
|
+
The data identifier name.
|
|
830
|
+
key :
|
|
831
|
+
The metadata key to be deleted.
|
|
680
832
|
"""
|
|
681
833
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'meta'])
|
|
682
834
|
url = build_url(choice(self.list_hosts), path=path, params={'key': key})
|
|
@@ -696,8 +848,12 @@ class DIDClient(BaseClient):
|
|
|
696
848
|
"""
|
|
697
849
|
List the associated rules of a data identifier.
|
|
698
850
|
|
|
699
|
-
|
|
700
|
-
|
|
851
|
+
Parameters
|
|
852
|
+
----------
|
|
853
|
+
scope :
|
|
854
|
+
The scope name.
|
|
855
|
+
name :
|
|
856
|
+
The data identifier name.
|
|
701
857
|
"""
|
|
702
858
|
|
|
703
859
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'rules'])
|
|
@@ -717,8 +873,12 @@ class DIDClient(BaseClient):
|
|
|
717
873
|
"""
|
|
718
874
|
List the associated rules a file is affected from..
|
|
719
875
|
|
|
720
|
-
|
|
721
|
-
|
|
876
|
+
Parameters
|
|
877
|
+
----------
|
|
878
|
+
scope :
|
|
879
|
+
The scope name.
|
|
880
|
+
name :
|
|
881
|
+
The data identifier name.
|
|
722
882
|
"""
|
|
723
883
|
|
|
724
884
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'associated_rules'])
|
|
@@ -733,9 +893,16 @@ class DIDClient(BaseClient):
|
|
|
733
893
|
def get_dataset_by_guid(self, guid: str) -> "Iterator[dict[str, Any]]":
|
|
734
894
|
"""
|
|
735
895
|
Get the parent datasets for a given GUID.
|
|
736
|
-
:param guid: The GUID.
|
|
737
896
|
|
|
738
|
-
|
|
897
|
+
Parameters
|
|
898
|
+
----------
|
|
899
|
+
guid :
|
|
900
|
+
The GUID.
|
|
901
|
+
|
|
902
|
+
Returns
|
|
903
|
+
-------
|
|
904
|
+
|
|
905
|
+
A did
|
|
739
906
|
"""
|
|
740
907
|
|
|
741
908
|
path = '/'.join([self.DIDS_BASEURL, guid, 'guid'])
|
|
@@ -756,9 +923,14 @@ class DIDClient(BaseClient):
|
|
|
756
923
|
"""
|
|
757
924
|
List data identifiers in a scope.
|
|
758
925
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
926
|
+
Parameters
|
|
927
|
+
----------
|
|
928
|
+
scope :
|
|
929
|
+
The scope name.
|
|
930
|
+
name :
|
|
931
|
+
The data identifier name.
|
|
932
|
+
recursive :
|
|
933
|
+
boolean, True or False.
|
|
762
934
|
"""
|
|
763
935
|
|
|
764
936
|
payload = {}
|
|
@@ -784,8 +956,12 @@ class DIDClient(BaseClient):
|
|
|
784
956
|
"""
|
|
785
957
|
List parent dataset/containers of a did.
|
|
786
958
|
|
|
787
|
-
|
|
788
|
-
|
|
959
|
+
Parameters
|
|
960
|
+
----------
|
|
961
|
+
scope :
|
|
962
|
+
The scope.
|
|
963
|
+
name :
|
|
964
|
+
The name,
|
|
789
965
|
"""
|
|
790
966
|
|
|
791
967
|
path = '/'.join([self.DIDS_BASEURL, quote_plus(scope), quote_plus(name), 'parents'])
|
|
@@ -809,12 +985,18 @@ class DIDClient(BaseClient):
|
|
|
809
985
|
"""
|
|
810
986
|
Create a sample from an input collection.
|
|
811
987
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
988
|
+
Parameters
|
|
989
|
+
----------
|
|
990
|
+
input_scope :
|
|
991
|
+
The scope of the input DID.
|
|
992
|
+
input_name :
|
|
993
|
+
The name of the input DID.
|
|
994
|
+
output_scope :
|
|
995
|
+
The scope of the output dataset.
|
|
996
|
+
output_name :
|
|
997
|
+
The name of the output dataset.
|
|
998
|
+
nbfiles :
|
|
999
|
+
The number of files to register in the output dataset.
|
|
818
1000
|
"""
|
|
819
1001
|
path = '/'.join([self.DIDS_BASEURL, 'sample'])
|
|
820
1002
|
data = dumps({
|
|
@@ -836,7 +1018,10 @@ class DIDClient(BaseClient):
|
|
|
836
1018
|
"""
|
|
837
1019
|
Resurrect a list of dids.
|
|
838
1020
|
|
|
839
|
-
|
|
1021
|
+
Parameters
|
|
1022
|
+
----------
|
|
1023
|
+
dids :
|
|
1024
|
+
A list of dids [{'scope': scope, 'name': name}, ...]
|
|
840
1025
|
"""
|
|
841
1026
|
path = '/'.join([self.DIDS_BASEURL, 'resurrect'])
|
|
842
1027
|
url = build_url(choice(self.list_hosts), path=path)
|
|
@@ -854,9 +1039,12 @@ class DIDClient(BaseClient):
|
|
|
854
1039
|
) -> "Iterator[dict[str, Any]]":
|
|
855
1040
|
"""
|
|
856
1041
|
List archive contents.
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
1042
|
+
Parameters
|
|
1043
|
+
----------
|
|
1044
|
+
scope :
|
|
1045
|
+
The scope name.
|
|
1046
|
+
name :
|
|
1047
|
+
The data identifier name.
|
|
860
1048
|
"""
|
|
861
1049
|
path = '/'.join([self.ARCHIVES_BASEURL, quote_plus(scope), quote_plus(name), 'files'])
|
|
862
1050
|
url = build_url(choice(self.list_hosts), path=path)
|