21388: Modernize RPM install instructions
[arvados.git] / doc / api / methods / groups.html.textile.liquid
1 ---
2 layout: default
3 navsection: api
4 navmenu: API Methods
5 title: "groups"
6 ...
7 {% comment %}
8 Copyright (C) The Arvados Authors. All rights reserved.
9
10 SPDX-License-Identifier: CC-BY-SA-3.0
11 {% endcomment %}
12
13 API endpoint base: @https://{{ site.arvados_api_host }}/arvados/v1/groups@
14
15 Object type: @j7d0g@
16
17 Example UUID: @zzzzz-j7d0g-0123456789abcde@
18
19 h2. Resource
20
21 Groups provides a way to apply the same permissions to a set of Arvados objects.  See "permission model":{{site.baseurl}}/api/permission-model.html for details.
22
23 Each Group has, in addition to the "Common resource fields":{{site.baseurl}}/api/resources.html:
24
25 table(table table-bordered table-condensed).
26 |_. Attribute|_. Type|_. Description|_. Example|
27 |name|string|||
28 |group_class|string|Type of group. @project@ and @filter@ indicate that the group should be displayed by Workbench and arv-mount as a project for organizing and naming objects. @role@ is used as part of the "permission system":{{site.baseurl}}/api/permission-model.html. |@"filter"@
29 @"project"@
30 @"role"@|
31 |description|text|||
32 |properties|hash|User-defined metadata, may be used in queries using "subproperty filters":{{site.baseurl}}/api/methods.html#subpropertyfilters ||
33 |writable_by|array|(Deprecated) List of UUID strings identifying Users and other Groups that have write permission for this Group.  Users who are allowed to administer the Group will receive a list of user/group UUIDs that have permission via explicit permission links; permissions via parent/ancestor groups are not taken into account.  Other users will receive a partial list including only the Group's owner_uuid and (if applicable) their own user UUID.||
34 |can_write|boolean|True if the current user has write permission on this group.||
35 |can_manage|boolean|True if the current user has manage permission on this group.||
36 |trash_at|datetime|If @trash_at@ is non-null and in the past, this group and all objects directly or indirectly owned by the group will be hidden from API calls.  May be untrashed.||
37 |delete_at|datetime|If @delete_at@ is non-null and in the past, the group and all objects directly or indirectly owned by the group may be permanently deleted.||
38 |is_trashed|datetime|True if @trash_at@ is in the past, false if not.||
39 |frozen_by_uuid|string|For a frozen project, indicates the user who froze the project; null in all other cases. When a project is frozen, no further changes can be made to the project or its contents, even by admins. Attempting to add new items or modify, rename, move, trash, or delete the project or its contents, including any subprojects, will return an error.||
40
41 h3(#frozen). Frozen projects
42
43 A user with @manage@ permission can set the @frozen_by_uuid@ attribute of a @project@ group to their own user UUID. Once this is done, no further changes can be made to the project or its contents, including subprojects.
44
45 The @frozen_by_uuid@ attribute can be cleared by an admin user. It can also be cleared by a user with @manage@ permission, unless the @API.UnfreezeProjectRequiresAdmin@ configuration setting is active.
46
47 The optional @API.FreezeProjectRequiresDescription@ and @API.FreezeProjectRequiresProperties@ configuration settings can be used to prevent users from freezing projects that have empty @description@ and/or specified @properties@ entries.
48
49 h3(#filter). Filter groups
50
51 @filter@ groups are virtual groups; they can not own other objects. Filter groups have a special @properties@ field named @filters@, which must be an array of filter conditions. See "list method filters":{{site.baseurl}}/api/methods.html#filters for details on the syntax of valid filters, but keep in mind that the attributes must include the object type (@collections@, @container_requests@, @groups@, @workflows@), separated with a dot from the field to be filtered on.
52
53 Filters are applied with an implied *and* between them, but each filter only applies to the object type specified. The results are subject to the usual access controls - they are a subset of all objects the user can see. Here is an example:
54
55 <pre>
56  "properties":{
57   "filters":[
58    [
59     "groups.name",
60     "like",
61     "Public%"
62    ]
63   ]
64  },
65 </pre>
66
67 This @filter@ group will return all groups (projects) that have a name starting with the word @Public@ and are visible to the user issuing the query. Because groups can contain many types of object, it will also return all objects of other types that the user can see.
68
69 The 'is_a' filter operator is of particular interest to limit the @filter@ group 'content' to the desired object(s). When the 'is_a' operator is used, the attribute must be 'uuid'. The operand may be a string or an array which means objects of either type will match the filter. This example will return all groups (projects) that have a name starting with the word @Public@, as well as all collections that are in the project with uuid @zzzzz-j7d0g-0123456789abcde@.
70
71 <pre>
72  "properties":{
73   "filters":[
74    [
75     "groups.name",
76     "like",
77     "Public%"
78    ],
79    [
80     "collections.owner_uuid",
81     "=",
82     "zzzzz-j7d0g-0123456789abcde"
83    ],
84    [
85     "uuid",
86     "is_a",
87     [
88      "arvados#group",
89      "arvados#collection"
90     ]
91    ]
92   ]
93  },
94  </pre>
95
96 h2. Methods
97
98 See "Common resource methods":{{site.baseurl}}/api/methods.html for more information about @create@, @delete@, @get@, @list@, and @update@.
99
100 Required arguments are displayed in %{background:#ccffcc}green%.
101
102 h3(#contents). contents
103
104 Retrieve a list of items owned by the group or user.  Use "recursive" to list objects within subprojects as well.
105
106 Arguments:
107
108 table(table table-bordered table-condensed).
109 |_. Argument |_. Type |_. Description |_. Location |_. Example |
110 {background:#ccffcc}.|uuid|string|The UUID of the group or user to enumerate. If this is a user UUID, this method returns the contents of that user's home project.|path||
111 |limit|integer (default 100)|Maximum number of items to return.|query||
112 |order|array|Attributes to use as sort keys to determine the order resources are returned, each optionally followed by @asc@ or @desc@ to indicate ascending or descending order. Sort within a resource type by prefixing the attribute with the resource name and a period.|query|@["collections.modified_at desc"]@|
113 |filters|array|Conditions for filtering items.|query|@[["uuid", "is_a", "arvados#job"]]@|
114 |recursive|boolean (default false)|Include items owned by subprojects.|query|@true@|
115 |exclude_home_project|boolean (default false)|Only return items which are visible to the user but not accessible within the user's home project.  Use this to get a list of items that are shared with the user.  Uses the logic described under the "shared" endpoint.|query|@true@|
116 |include|array|Look up objects referenced by the indicated fields and include them in the response. Only "owner_uuid" and "container_uuid" are supported. If "owner_uuid" is given, the parent project or user will be returned. If "container_uuid" is given and container requests are returned in the response, the corresponding container records will also be returned. These referenced objects will be returned in the "included" field of the response. For compatibility, a string @"owner_uuid"@ is accepted as equivalent to @["owner_uuid"]@.|query|@"owner_uuid"@
117 @["owner_uuid","container_uuid"]@|
118 |include_trash|boolean (default false)|Include trashed objects.|query|@true@|
119 |include_old_versions|boolean (default false)|Include past versions of the collections being listed.|query|@true@|
120 |select|array|Attributes of each object to return in the response. Specify an unqualified name like @uuid@ to select that attribute on all object types, or a qualified name like @collections.name@ to select that attribute on objects of the specified type. By default, all available attributes are returned, except on collections, where @manifest_text@ is not returned and cannot be selected due to an implementation limitation. This limitation may be removed in the future.|query|@["uuid", "collections.name"]@|
121
122 Notes:
123
124 Because adding access tokens to manifests can be computationally expensive, the @manifest_text@ field is not included in listed collections.  If you need it, request a "list of collections":{{site.baseurl}}/api/methods/collections.html with the filter @["owner_uuid", "=", GROUP_UUID]@, and @"manifest_text"@ listed in the select parameter.
125
126 Use filters with the attribute format @<item type>.<field name>@ to filter items of a specific type. For example: @["container_requests.state", "=", "Final"]@ to filter @container_requests@ where @state@ is @Final@. All other types of items owned by this group will be unimpacted by this filter and will still be included.
127
128 When called with “include=owner_uuid”, the @included@ field of the response is populated with users, projects, or other groups that own the objects returned in @items@.  This can be used to fetch an object and its parent with a single API call.
129
130 When called with “include=container_uuid”, the @included@ field of the response is populated with the container associated with each container request in the response.
131
132
133 h3. create
134
135 Create a new Group.
136
137 Arguments:
138
139 table(table table-bordered table-condensed).
140 |_. Argument |_. Type |_. Description |_. Location |_. Example |
141 |group|object||query||
142 |async|boolean (default false)|Defer the permissions graph update by a configured number of seconds. (By default, @async_permissions_update_interval@ is 20 seconds). On success, the response is 202 (Accepted).|query|@true@|
143
144 h3. delete
145
146 Put a Group in the trash.  This sets the @trash_at@ field to @now@ and @delete_at@ field to @now@ + token TTL.  A trashed group is invisible to most API calls unless the @include_trash@ parameter is true.  All objects directly or indirectly owned by the Group are considered trashed as well.
147
148 Arguments:
149
150 table(table table-bordered table-condensed).
151 |_. Argument |_. Type |_. Description |_. Location |_. Example |
152 {background:#ccffcc}.|uuid|string|The UUID of the Group in question.|path||
153
154 h3. get
155
156 Gets a Group's metadata by UUID.
157
158 Arguments:
159
160 table(table table-bordered table-condensed).
161 |_. Argument |_. Type |_. Description |_. Location |_. Example |
162 {background:#ccffcc}.|uuid|string|The UUID of the Group in question.|path||
163
164 h3. list
165
166 List groups.
167
168 See "common resource list method.":{{site.baseurl}}/api/methods.html#index
169
170 h3. show
171
172 show groups
173
174 Arguments:
175
176 table(table table-bordered table-condensed).
177 |_. Argument |_. Type |_. Description |_. Location |_. Example |
178 {background:#ccffcc}.|uuid|string||path||
179
180 h3. update
181
182 Update attributes of an existing Group.
183
184 Arguments:
185
186 table(table table-bordered table-condensed).
187 |_. Argument |_. Type |_. Description |_. Location |_. Example |
188 {background:#ccffcc}.|uuid|string|The UUID of the Group in question.|path||
189 |group|object||query||
190 |async|boolean (default false)|Defer the permissions graph update by a configured number of seconds. (By default, @async_permissions_update_interval@ is 20 seconds). On success, the response is 202 (Accepted).|query|@true@|
191
192 h3. untrash
193
194 Remove a Group from the trash.  This sets the @trash_at@ and @delete_at@ fields to @null@.
195
196 Arguments:
197
198 table(table table-bordered table-condensed).
199 |_. Argument |_. Type |_. Description |_. Location |_. Example |
200 {background:#ccffcc}.|uuid|string|The UUID of the Group to untrash.|path||
201 |ensure_unique_name|boolean (default false)|Rename project uniquely if untrashing it would fail with a unique name conflict.|query||
202
203 h3(#shared). shared
204
205 This endpoint returns the toplevel set of groups to which access is granted through a chain of one or more permission links rather than through direct ownership by the current user account.  This is useful for clients which wish to browse the list of projects the user has permission to read which are not part of the "home" project tree.  Similar behavior is also available with the @exclude_home_project@ option of the "contents" endpoint.
206
207 Specifically, the logic is:
208
209 <pre>
210 select groups that are readable by current user AND
211     (the owner_uuid is a user (but not the current user) OR
212      the owner_uuid is not readable by the current user OR
213      the owner_uuid is a group but group_class is not a project)
214 </pre>
215
216 table(table table-bordered table-condensed).
217 |_. Argument |_. Type |_. Description |_. Location |_. Example |
218 |include|string|If provided with the value "owner_uuid", this will return owner objects in the @included@ field of the response.|query||
219
220 Notes:
221
222 When called with “include=owner_uuid”, the @included@ field of the response is populated with users and non-project groups that own the objects returned in @items@.
223
224 In addition to the "include" parameter this endpoint also supports the same parameters as the "list method.":{{site.baseurl}}/api/methods.html#index