The glance.api.v1.members Module

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

Bases: glance.api.v1.controller.BaseController

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

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

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

Removes a membership from the image.

index(req, image_id)[source]

Return a list of dictionaries indicating the members of the image, i.e., those tenants the image is shared with.

Parameters:
  • req – the Request object coming from the wsgi layer
  • image_id – The opaque image identifier
Returns:

The response body is a mapping of the following form

{'members': [
    {'member_id': <MEMBER>,
     'can_share': <SHARE_PERMISSION>, ...}, ...
]}
index_shared_images(req, id)[source]

Retrieves list of image memberships for the given member.

Parameters:
  • req – the Request object coming from the wsgi layer
  • id – the opaque member identifier
Returns:

The response body is a mapping of the following form

{'shared_images': [
    {'image_id': <IMAGE>,
     'can_share': <SHARE_PERMISSION>, ...}, ...
]}
update(req, *args, **kwargs)[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, *args, **kwargs)[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]]}, ...
]}
glance.api.v1.members.create_resource()[source]

Image members resource factory method

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.