glance.registry.api.v1.members module

class glance.registry.api.v1.members.Controller[source]

Bases: object

default(req, *args, **kwargs)[source]

This will cover the missing ‘show’ and ‘create’ actions

delete(req, image_id, id)[source]

Removes a membership from the image.

index(req, image_id)[source]

Get the members of an image.

index_shared_images(req, id)[source]

Retrieves images shared with the given member.

is_image_sharable(context, image)[source]

Return True if the image can be shared to others in this context.

update(req, image_id, id, body=None)[source]

Adds a membership to the image, or updates an existing one. If a body is present, it is a dict with the following format:

{'member': {
    'can_share': [True|False]

If can_share is provided, the member’s ability to share is set accordingly. If it is not provided, existing memberships remain unchanged and new memberships default to False.

update_all(req, image_id, body)[source]

Replaces the members of the image with those specified in the body. The body is a dict with the following format:

{'memberships': [
    {'member_id': <MEMBER_ID>,
     ['can_share': [True|False]]}, ...

Image members resource factory method.

glance.registry.api.v1.members.make_member_list(members, **attr_map)[source]

Create a dict representation of a list of members which we can use to serialize the members list. Keyword arguments map the names of optional attributes to include to the database attribute.