All existing image memberships may be revoked and replaced in a single operation.

Continuing from the example above, in order to replace the membership list of the image with ID 1 with two entries--the first allowing 'tenant1' to access the image, and the second allowing 'tenant2' to access and further share the image, we can use the following code

from glance.client import Client

c = Client("glance.example.com", 9292)

[Note]Note

The first argument to Client.replace_members() is the opaque identifier of the image; the remaining arguments are dictionaries with the keys `member_id` (mapping to a tenant name) and `can_share`. Note that `can_share` may be omitted, in which case any existing membership for the specified member will be preserved through the replace operation.

The return value of Client.replace_members() is not significant.



loading table of contents...