X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c10e9e5f3398d40a3346c7d7c1f84bf50262b8ec..44c95f99098fa6c6acbfa82d4b6cbc6015eb6e39:/doc/sdk/python/example.html.textile.liquid diff --git a/doc/sdk/python/example.html.textile.liquid b/doc/sdk/python/example.html.textile.liquid index 7ae5e58f8a..f3cc106760 100644 --- a/doc/sdk/python/example.html.textile.liquid +++ b/doc/sdk/python/example.html.textile.liquid @@ -2,8 +2,22 @@ layout: default navsection: sdk navmenu: Python -title: Python SDK examples +title: Examples ... +{% comment %} +Copyright (C) The Arvados Authors. All rights reserved. + +SPDX-License-Identifier: CC-BY-SA-3.0 +{% endcomment %} + +In these examples, the site prefix is @aaaaa@. + +h2. Initialize SDK + +
+import arvados
+api = arvados.api("v1")
+
h2. create @@ -14,23 +28,29 @@ result = api.collection().create(body={"collection": {"name": "create example"}} h2. delete
-result = api.collection().delete(uuid="aaaaa-bbbbb-ccccccccccccccc").execute()
+result = api.collections().delete(uuid="aaaaa-4zz18-ccccccccccccccc").execute()
 
h2. get
-result = api.collection().get(uuid="aaaaa-bbbbb-ccccccccccccccc").execute()
+result = api.collections().get(uuid="aaaaa-4zz18-ccccccccccccccc").execute()
 
h2. list
-result = api.collection().list(filters=[["uuid", "=", "aaaaa-bbbbb-ccccccccccccccc"]]).execute()
+result = api.collections().list(filters=[["uuid", "=", "aaaaa-bbbbb-ccccccccccccccc"]]).execute()
 
h2. update
-result = api.collection().update(uuid="aaaaa-bbbbb-ccccccccccccccc", body={"collection": {"name": "update example"}}).execute()
+result = api.collections().update(uuid="aaaaa-4zz18-ccccccccccccccc", body={"collection": {"name": "update example"}}).execute()
+
+ +h2. Get current user + +
+result = api.users().current().execute()