Merge branch '8784-dir-listings'
[arvados.git] / doc / user / tutorials / tutorial-keep-collection-lifecycle.html.textile.liquid
1 ---
2 layout: default
3 navsection: userguide
4 title: "Keep collection lifecycle"
5 ...
6 {% comment %}
7 Copyright (C) The Arvados Authors. All rights reserved.
8
9 SPDX-License-Identifier: CC-BY-SA-3.0
10 {% endcomment %}
11
12 During it's lifetime, a keep collection can be in various states. These states are *persisted*, *expiring*, *trashed*  and *permanently deleted*.
13
14 A collection is *expiring* when it has a *trash_at* time in the future. An expiring collection can be accessed as normal, but is scheduled to be trashed automatically at the *trash_at* time.
15
16 A collection is *trashed* when it has a *trash_at* time in the past. The *is_trashed* attribute will also be "true". The delete operation immediately puts the collection in the trash by setting the *trash_at* time to "now". Once trashed, the collection is no longer readable through normal data access APIs. The collection will have *delete_at* set to some time in the future. The trashed collection is recoverable until the delete_at time passes, at which point the collection is permanently deleted.
17
18 # "*Collection lifecycle attributes*":#collection_attributes
19 # "*Deleting / trashing collections*":#delete-collection
20 # "*Recovering trashed collections*":#trash-recovery
21
22 {% include 'tutorial_expectations' %}
23
24 h2(#collection_attributes). Collection lifecycle attributes
25
26 As listed above the attributes that are used to manage a collection lifecycle are it's *is_trashed*, *trash_at*, and *delete_at*. The table below lists the values of these attributes and how they influence the state of a collection and it's accessibility.
27
28 table(table table-bordered table-condensed).
29 |_. collection state|_. is_trashed|_. trash_at|_. delete_at|_. get|_. list|_. list?include_trash=true|_. can be modified|
30 |persisted collection|false |null |null |yes |yes |yes |yes |
31 |expiring collection|false |future |future |yes  |yes |yes |yes |
32 |trashed collection|true |past |future |no |no |yes |only is_trashed, trash_at and delete_at attribtues|
33 |deleted collection|true|past |past |no |no |no |no |
34
35 h2(#delete-collection). Deleting / trashing collections
36
37 A collection can be deleted using either the arv command line tool or the workbench.
38
39 h3. Trashing a collection using arv command line tool
40
41 <pre>
42 arv collection delete --uuid=qr1hi-4zz18-xxxxxxxxxxxxxxx
43 </pre>
44
45 h3. Trashing a collection using workbench
46
47 To trash a collection using workbench, go to the Data collections tab in the project, and use the trash icon for this collection row.
48
49 h2(#trash-recovery). Recovering trashed collections
50
51 A collection can be un-trashed / recovered using either the arv command line tool or the workbench.
52
53 h3. Un-trashing a collection using arv command line tool
54
55 You can list the trashed collections using the list command.
56
57 <pre>
58 arv collection list --include-trash=true --filters '[["is_trashed", "=", "true"]]'
59 </pre>
60
61 You can then untrash a particular collection using arv using it's uuid.
62
63 <pre>
64 arv collection untrash --uuid=qr1hi-4zz18-xxxxxxxxxxxxxxx
65 </pre>
66
67 h3. Un-trashing a collection using workbench
68
69 To untrash a collection using workbench, go to trash page on workbench by clicking on the "Trash" icon in the top navigation in workbench and use the recycle icon or selection dropdown option.
70
71 !{display: block;margin-left: 25px;margin-right: auto;border:1px solid lightgray;}{{ site.baseurl }}/images/trash-button-topnav.png!