17119: add documentation.
[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@ means FIXME. |@"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|List of UUID strings identifying Users and other Groups that have write permission for this Group.  Only users who are allowed to administer the Group will receive a full list.  Other users will receive a partial list that includes the Group's owner_uuid and (if applicable) their own user UUID.||
34 |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.||
35 |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.||
36 |is_trashed|datetime|True if @trash_at@ is in the past, false if not.||
37
38 @filter@ groups have a special @properties@ field named @filters@, which must be an array of arrays with 3 elements, each describing a filter. @filter@ groups are virtual groups; they can not own other objects. Filter attributes must include the object type (@collections@, @container_requests@, @groups@, @workflows@), separated with a dot from the field to be filtered on. 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:
39
40 <pre>
41  "properties":{
42   "filters":[
43    [
44     "groups.name",
45     "like",
46     "Public%"
47    ]
48   ]
49  },
50 </pre>
51
52 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.
53
54 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@.
55
56 <pre>
57  "properties":{
58   "filters":[
59    [
60     "groups.name",
61     "like",
62     "Public%"
63    ],
64    [
65     "collections.owner_uuid",
66     "=",
67     "zzzzz-j7d0g-0123456789abcde"
68    ],
69    [
70     "uuid",
71     "is_a",
72     [
73      "arvados#group",
74      "arvados#collection"
75     ]
76    ]
77   ]
78  },
79  </pre>
80
81 h2. Methods
82
83 See "Common resource methods":{{site.baseurl}}/api/methods.html for more information about @create@, @delete@, @get@, @list@, and @update@.
84
85 Required arguments are displayed in %{background:#ccffcc}green%.
86
87 h3. contents
88
89 Retrieve a list of items owned by the group.  Use "recursive" to list objects within subprojects as well.
90
91 Arguments:
92
93 table(table table-bordered table-condensed).
94 |_. Argument |_. Type |_. Description |_. Location |_. Example |
95 {background:#ccffcc}.|uuid|string|The UUID of the group in question.|path||
96 |limit|integer (default 100)|Maximum number of items to return.|query||
97 |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"]@|
98 |filters|array|Conditions for filtering items.|query|@[["uuid", "is_a", "arvados#job"]]@|
99 |recursive|boolean (default false)|Include items owned by subprojects.|query|@true@|
100 |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@|
101 |include|string|If provided with the value "owner_uuid", this will return owner objects in the "included" field of the response.|query||
102 |include_trash|boolean (default false)|Include trashed objects.|query|@true@|
103 |include_old_versions|boolean (default false)|Include past versions of the collections being listed.|query|@true@|
104
105 Notes:
106
107 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.
108
109 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.
110
111 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.
112
113
114 h3. create
115
116 Create a new Group.
117
118 Arguments:
119
120 table(table table-bordered table-condensed).
121 |_. Argument |_. Type |_. Description |_. Location |_. Example |
122 |group|object||query||
123 |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@|
124
125 h3. delete
126
127 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.
128
129 Arguments:
130
131 table(table table-bordered table-condensed).
132 |_. Argument |_. Type |_. Description |_. Location |_. Example |
133 {background:#ccffcc}.|uuid|string|The UUID of the Group in question.|path||
134
135 h3. get
136
137 Gets a Group's metadata by UUID.
138
139 Arguments:
140
141 table(table table-bordered table-condensed).
142 |_. Argument |_. Type |_. Description |_. Location |_. Example |
143 {background:#ccffcc}.|uuid|string|The UUID of the Group in question.|path||
144
145 h3. list
146
147 List groups.
148
149 See "common resource list method.":{{site.baseurl}}/api/methods.html#index
150
151 h3. show
152
153 show groups
154
155 Arguments:
156
157 table(table table-bordered table-condensed).
158 |_. Argument |_. Type |_. Description |_. Location |_. Example |
159 {background:#ccffcc}.|uuid|string||path||
160
161 h3. update
162
163 Update attributes of an existing Group.
164
165 Arguments:
166
167 table(table table-bordered table-condensed).
168 |_. Argument |_. Type |_. Description |_. Location |_. Example |
169 {background:#ccffcc}.|uuid|string|The UUID of the Group in question.|path||
170 |group|object||query||
171 |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@|
172
173 h3. untrash
174
175 Remove a Group from the trash.  This sets the @trash_at@ and @delete_at@ fields to @null@.
176
177 Arguments:
178
179 table(table table-bordered table-condensed).
180 |_. Argument |_. Type |_. Description |_. Location |_. Example |
181 {background:#ccffcc}.|uuid|string|The UUID of the Group to untrash.|path||
182 |ensure_unique_name|boolean (default false)|Rename project uniquely if untrashing it would fail with a unique name conflict.|query||
183
184 h3. shared
185
186 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.
187
188 Specifically, the logic is:
189
190 <pre>
191 select groups that are readable by current user AND
192     (the owner_uuid is a user (but not the current user) OR
193      the owner_uuid is not readable by the current user OR
194      the owner_uuid is a group but group_class is not a project)
195 </pre>
196
197 table(table table-bordered table-condensed).
198 |_. Argument |_. Type |_. Description |_. Location |_. Example |
199 |include|string|If provided with the value "owner_uuid", this will return owner objects in the @included@ field of the response.|query||
200
201 Notes:
202
203 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@.
204
205 In addition to the "include" parameter this endpoint also supports the same parameters as the "list method.":{{site.baseurl}}/api/methods.html#index