19792: Add overview sentence to PySDK cookbook introduction
[arvados.git] / doc / sdk / python / cookbook.html.textile.liquid
index 598bdceeb86a649d6e8adf2c485373cb1465b9ae..2804f13dd1429a3dbd4edbffc47d2b5c7f54957e 100644 (file)
@@ -46,7 +46,7 @@ SPDX-License-Identifier: CC-BY-SA-3.0
 
 h2(#introduction). Introduction
 
-This page assumes you've already read the "API client documentation":{{ site.baseurl }}/sdk/python/api-client.html and understand the basics of using the Python SDK client. You don't have to have the details of every API method memorized, but you should at least be comfortable with the pattern of calling a resource type, API method, and @execute()@, as well as the dictionaries these methods return.
+This page provides example code to perform various high-level tasks using Arvados' Python SDK. This page assumes you've already read the "API client documentation":{{ site.baseurl }}/sdk/python/api-client.html and understand the basics of using the Python SDK client. You don't have to have the details of every API method memorized, but you should at least be comfortable with the pattern of calling a resource type, API method, and @execute()@, as well as the dictionaries these methods return.
 
 The code examples assume you've built the @arv_client@ object by doing something like:
 
@@ -176,7 +176,7 @@ permission = arv_client.links().create(
 
 h3(#modify-permission). Modify permission on an object
 
-To modify an existing permission—for example, to change its access level—find the existing link object for the permission, then update it with the new values you want. This example shows making all permissions on a specific collection read-only. Adjust the filters appropriately to find the permission(s) you want to modify.
+To modify an existing permission—for example, to change its access level—find the existing link object for the permission, then update it with the new values you want. This example shows changing all read-write permissions on a specific collection to read-only. Adjust the filters appropriately to find the permission(s) you want to modify.
 
 {% codeblock as python %}
 import arvados.util
@@ -187,11 +187,8 @@ for permission in arvados.util.keyset_list_all(
         # You should use this filter for all permission searches,
         # to exclude other kinds of links.
         ['link_class', '=', 'permission'],
-        # In this example, we do not want to *increase* the access level of
-        # no-permission links, and updating read-permission links would be a
-        # noop. Exclude both here.
-        ['name', 'not in', ['none', 'can_read']],
         # Add other filters as desired.
+        ['name', '=', 'can_write'],
         ['head_uuid', '=', 'zzzzz-4zz18-12345abcde67890'],
         ...,
     ],
@@ -221,7 +218,7 @@ for permission in arvados.util.keyset_list_all(
         ['link_class', '=', 'permission'],
         # Add other filters as desired.
         ['name', '=', 'can_login'],
-        ['head_uuid', '=', 'zzzzz-tpzed-12345abcde67890'],
+        ['tail_uuid', '=', 'zzzzz-tpzed-12345abcde67890'],
         ...,
     ],
 ):