Merge branch '8784-dir-listings'
[arvados.git] / doc / sdk / python / example.html.textile.liquid
1 ---
2 layout: default
3 navsection: sdk
4 navmenu: Python
5 title: Examples
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 In these examples, the site prefix is @aaaaa@.
14
15 h2.  Initialize SDK
16
17 <pre>
18 import arvados
19 api = arvados.api("v1")
20 </pre>
21
22 h2. create
23
24 <pre>
25 result = api.collection().create(body={"collection": {"name": "create example"}}).execute()
26 </pre>
27
28 h2. delete
29
30 <pre>
31 result = api.collections().delete(uuid="aaaaa-4zz18-ccccccccccccccc").execute()
32 </pre>
33
34 h2. get
35
36 <pre>
37 result = api.collections().get(uuid="aaaaa-4zz18-ccccccccccccccc").execute()
38 </pre>
39
40 h2. list
41
42 <pre>
43 result = api.collections().list(filters=[["uuid", "=", "aaaaa-bbbbb-ccccccccccccccc"]]).execute()
44 </pre>
45
46 h2. update
47
48 <pre>
49 result = api.collections().update(uuid="aaaaa-4zz18-ccccccccccccccc", body={"collection": {"name": "update example"}}).execute()
50 </pre>
51
52 h2. Get current user
53
54 <pre>
55 result = api.users().current().execute()
56 </pre>