3 Copyright (C) The Arvados Authors. All rights reserved.
5 SPDX-License-Identifier: CC-BY-SA-3.0
8 import arvados.util as util
10 old_uuid = 'zzzzz-tpzed-xxxxxxxxxxxxxxx'
11 new_uuid = 'zzzzz-tpzed-yyyyyyyyyyyyyyy'
14 filters = [['properties.responsible_person_uuid', '=', '{}'.format(old_uuid)]]
15 cols = util.list_all(api.collections().list, filters=filters, select=['uuid', 'properties'])
17 print('Found {} collections'.format(len(cols)))
19 print('Updating collection {}'.format(c['uuid']))
20 props = c['properties']
21 props['responsible_person_uuid'] = new_uuid
22 api.collections().update(uuid=c['uuid'], body={'properties': props}).execute()