pyrax
Python Bindings for the Rackspace Cloud
 All Classes Namespaces Files Functions Variables Properties
Public Member Functions | Static Public Attributes
ImageClient Class Reference

This is the primary class for interacting with Images. More...

Inheritance diagram for ImageClient:
BaseClient FakeImageClient

List of all members.

Public Member Functions

def list
 Returns a list of resource objects.
def list_all
 Returns all of the images in one call, rather than in paginated batches.
def update
 Accepts an image reference (object or ID) and dictionary of key/value pairs, where the key is an attribute of the image, and the value is the desired new value for that image.
def change_image_name
 Image name can be changed via the update() method.
def list_image_members
 Returns a list of members (users) of the specified image.
def get_image_member
 Returns the ImageMember object representing the specified member for the specified image.
def add_image_member
 Adds the project (tenant) represented by the project_id as a member of the specified image.
def delete_image_member
 Removes the project (tenant) represented by the project_id as a member of the specified image.
def update_image_member
 Updates the image whose ID is given with the status specified.
def add_image_tag
 Adds the tag to the specified image.
def delete_image_tag
 Deletes the tag from the specified image.
def list_tasks
 Returns a list of all tasks.
def get_task
 Returns the ImageTask object for the supplied ID.
def export_task
 Creates a task to export the specified image to the swift container named in the 'cont' parameter.
def import_task
 Creates a task to import the specified image from the swift container named in the 'cont' parameter.
def get_images_schema
 Returns a json-schema document that represents an image members entity, which is a container of image member entities.
def get_image_schema
 Returns a json-schema document that represents a single image entity.
def get_image_members_schema
 Returns a json-schema document that represents an image members entity (a container of member entities).
def get_image_member_schema
 Returns a json-schema document that represents an image member entity.
def get_image_tasks_schema
 Returns a json-schema document that represents a container of tasks entities.
def get_image_task_schema
 Returns a json-schema document that represents an task entity.

Static Public Attributes

string name = "Images"

Detailed Description

This is the primary class for interacting with Images.


Member Function Documentation

def add_image_member (   self,
  img,
  project_id 
)

Adds the project (tenant) represented by the project_id as a member of the specified image.

def add_image_tag (   self,
  img,
  tag 
)

Adds the tag to the specified image.

def change_image_name (   self,
  img,
  newname 
)

Image name can be changed via the update() method.

This is simply a convenience method.

def delete_image_member (   self,
  img,
  project_id 
)

Removes the project (tenant) represented by the project_id as a member of the specified image.

def delete_image_tag (   self,
  img,
  tag 
)

Deletes the tag from the specified image.

def export_task (   self,
  img,
  cont 
)

Creates a task to export the specified image to the swift container named in the 'cont' parameter.

If the container does not exist, a NoSuchContainer exception is raised.

The 'img' parameter can be either an Image object or the ID of an image. If these do not correspond to a valid image, a NotFound exception is raised.

def get_image_member (   self,
  img,
  member 
)

Returns the ImageMember object representing the specified member for the specified image.

def get_image_member_schema (   self)

Returns a json-schema document that represents an image member entity.

(a container of member entities).

def get_image_members_schema (   self)

Returns a json-schema document that represents an image members entity (a container of member entities).

def get_image_schema (   self)

Returns a json-schema document that represents a single image entity.

def get_image_task_schema (   self)

Returns a json-schema document that represents an task entity.

def get_image_tasks_schema (   self)

Returns a json-schema document that represents a container of tasks entities.

def get_images_schema (   self)

Returns a json-schema document that represents an image members entity, which is a container of image member entities.

def get_task (   self,
  task 
)

Returns the ImageTask object for the supplied ID.

def import_task (   self,
  img,
  cont,
  img_format = None,
  img_name = None 
)

Creates a task to import the specified image from the swift container named in the 'cont' parameter.

The new image will be named the same as the object in the container unless you specify a value for the 'img_name' parameter.

By default it is assumed that the image is in 'vhd' format; if it is another format, you must specify that in the 'img_format' parameter.

def list (   self,
  limit = None,
  marker = None,
  name = None,
  visibility = None,
  member_status = None,
  owner = None,
  tag = None,
  status = None,
  size_min = None,
  size_max = None,
  sort_key = None,
  sort_dir = None 
)

Returns a list of resource objects.

Pagination is supported through the optional 'marker' and 'limit' parameters. Filtering the returned value is possible by specifying values for any of the other parameters.

def list_all (   self,
  name = None,
  visibility = None,
  member_status = None,
  owner = None,
  tag = None,
  status = None,
  size_min = None,
  size_max = None,
  sort_key = None,
  sort_dir = None 
)

Returns all of the images in one call, rather than in paginated batches.

The same filtering options available in list() apply here, with the obvious exception of limit and marker.

def list_image_members (   self,
  img 
)

Returns a list of members (users) of the specified image.

def list_tasks (   self)

Returns a list of all tasks.

def update (   self,
  img,
  value_dict 
)

Accepts an image reference (object or ID) and dictionary of key/value pairs, where the key is an attribute of the image, and the value is the desired new value for that image.

def update_image_member (   self,
  img_id,
  status 
)

Updates the image whose ID is given with the status specified.

This must be called by the user whose project_id is in the members for the image; that is, the user with whom the image is being shared. If called by the owner of the image, an `InvalidImageMember` exception will be raised.

Valid values for 'status' include: pending accepted rejected

Any other value will result in an `InvalidImageMemberStatus` exception being raised.


Member Data Documentation

string name = "Images" [static]

Reimplemented from BaseClient.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties