Bump loofah from 2.2.3 to 2.3.1 in /apps/workbench
[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 {% codeblock as python %}
18 import arvados
19 api = arvados.api("v1")
20 {% endcodeblock %}
21
22 h2. create
23
24 {% codeblock as python %}
25 result = api.collections().create(body={"collection": {"name": "create example"}}).execute()
26 {% endcodeblock %}
27
28 h2. delete
29
30 {% codeblock as python %}
31 result = api.collections().delete(uuid="aaaaa-4zz18-ccccccccccccccc").execute()
32 {% endcodeblock %}
33
34 h2. get
35
36 {% codeblock as python %}
37 result = api.collections().get(uuid="aaaaa-4zz18-ccccccccccccccc").execute()
38 {% endcodeblock %}
39
40 h2. list
41
42 {% codeblock as python %}
43 result = api.collections().list(filters=[["uuid", "=", "aaaaa-bbbbb-ccccccccccccccc"]]).execute()
44 {% endcodeblock %}
45
46 h2. update
47
48 {% codeblock as python %}
49 result = api.collections().update(uuid="aaaaa-4zz18-ccccccccccccccc", body={"collection": {"name": "update example"}}).execute()
50 {% endcodeblock %}
51
52 h2. Get current user
53
54 {% codeblock as python %}
55 result = api.users().current().execute()
56 {% endcodeblock %}