Image API v1

Image API v1

For details on how to use image, see Using OpenStack Image

The Image v1 Class

The image high-level interface is available through the image member of a Connection object. The image member will only be added if the service is detected.

class openstack.image.v1._proxy.Proxy(session)
upload_image(**attrs)

Upload a new image from attributes

Parameters:attrs (dict) – Keyword arguments which will be used to create a Image, comprised of the properties on the Image class.
Returns:The results of image creation
Return type:Image
delete_image(image, ignore_missing=True)

Delete an image

Parameters:
  • image – The value can be either the ID of an image or a Image instance.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the image does not exist. When set to True, no exception will be set when attempting to delete a nonexistent image.
Returns:

None

find_image(name_or_id, ignore_missing=True)

Find a single image

Parameters:
  • name_or_id – The name or ID of a image.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One Image or None

get_image(image)

Get a single image

Parameters:image – The value can be the ID of an image or a Image instance.
Returns:One Image
Raises:ResourceNotFound when no resource can be found.
images(**query)

Return a generator of images

Parameters:**query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns:A generator of image objects
Return type:Image
update_image(image, **attrs)

Update a image

Parameters:image – Either the ID of a image or a Image instance.
Attrs kwargs:The attributes to update on the image represented by value.
Returns:The updated image
Return type:Image

Image API v2

For details on how to use image, see Using OpenStack Image

The Image v2 Class

The image high-level interface is available through the image member of a Connection object. The image member will only be added if the service is detected.

class openstack.image.v2._proxy.Proxy(session)
upload_image(**attrs)

Upload a new image from attributes

Parameters:attrs (dict) – Keyword arguments which will be used to create a Image, comprised of the properties on the Image class.
Returns:The results of image creation
Return type:Image
delete_image(image, ignore_missing=True)

Delete an image

Parameters:
  • image – The value can be either the ID of an image or a Image instance.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the image does not exist. When set to True, no exception will be set when attempting to delete a nonexistent image.
Returns:

None

find_image(name_or_id, ignore_missing=True)

Find a single image

Parameters:
  • name_or_id – The name or ID of a image.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One Image or None

get_image(image)

Get a single image

Parameters:image – The value can be the ID of a image or a Image instance.
Returns:One Image
Raises:ResourceNotFound when no resource can be found.
images(**query)

Return a generator of images

Parameters:**query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns:A generator of image objects
Return type:Image
update_image(image, **attrs)

Update a image

Parameters:image – Either the ID of a image or a Image instance.
Attrs kwargs:The attributes to update on the image represented by value.
Returns:The updated image
Return type:Image
create_member(**attrs)

Create a new member from attributes

Parameters:attrs (dict) – Keyword arguments which will be used to create a Member, comprised of the properties on the Member class.
Returns:The results of member creation
Return type:Member
delete_member(member, ignore_missing=True)

Delete a member

Parameters:
  • member – The value can be either the ID of a member or a Member instance.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the member does not exist. When set to True, no exception will be set when attempting to delete a nonexistent member.
Returns:

None

find_member(name_or_id, ignore_missing=True)

Find a single member

Parameters:
  • name_or_id – The name or ID of a member.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, None will be returned when attempting to find a nonexistent resource.
Returns:

One Member or None

get_member(member)

Get a single member

Parameters:member – The value can be the ID of a member or a Member instance.
Returns:One Member
Raises:ResourceNotFound when no resource can be found.
members(**query)

Return a generator of members

Parameters:**query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns:A generator of member objects
Return type:Member
update_member(member, **attrs)

Update a member

Parameters:member – Either the ID of a member or a Member instance.
Attrs kwargs:The attributes to update on the member represented by value.
Returns:The updated member
Return type:Member
create_tag(**attrs)

Create a new tag from attributes

Parameters:attrs (dict) – Keyword arguments which will be used to create a Tag, comprised of the properties on the Tag class.
Returns:The results of tag creation
Return type:Tag
delete_tag(tag, ignore_missing=True)

Delete a tag

Parameters:
  • tag – The value can be either the ID of a tag or a Tag instance.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the tag does not exist. When set to True, no exception will be set when attempting to delete a nonexistent tag.
Returns:

None

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.