Objectstore Documentation

This page contains the Objectstore Package documentation.

The bucket Module

Simple object store using Blobs and JSON files on disk.

class nova.objectstore.bucket.Bucket(name)

Bases: object

static all()
list of all buckets
static create(bucket_name, context)

Create a new bucket owned by a project.

@bucket_name: a string representing the name of the bucket to create @context: a nova.auth.api.ApiContext object representing who owns the bucket.

Raises:
NotAuthorized: if the bucket is already exists or has invalid name
delete()
is_authorized(context)
list_keys(prefix='', marker=None, max_keys=1000, terse=False)
metadata
dictionary of metadata around bucket, keys are ‘Name’ and ‘CreationDate’
owner_id

The handler Module

Implementation of an S3-like storage server based on local files.

Useful to test features that will eventually run on S3, or if you want to run something locally that was once running on S3.

We don’t support all the features of S3, but it does work with the standard S3 client for the most basic semantics. To use the standard S3 client with this module:

c = S3.AWSAuthConnection("", "", server="localhost", port=8888,
                         is_secure=False)
c.create_bucket("mybucket")
c.put("mybucket", "mykey", "a value")
print c.get("mybucket", "mykey").body
class nova.objectstore.handler.BucketResource(name)

Bases: twisted.web.resource.Resource

getChild(name, request)
render_DELETE(request)
render_GET(request)
render_PUT(request)
class nova.objectstore.handler.ImageResource

Bases: twisted.web.resource.Resource

getChild(name, request)
render_DELETE(request)
delete a registered image
render_GET(request)
returns a json listing of all images that a user has permissions to see
render_POST(request)
update image attributes: public/private
render_PUT(request)
create a new registered image
class nova.objectstore.handler.ObjectResource(bucket, name)

Bases: twisted.web.resource.Resource

render_DELETE(request)
render_GET(request)
render_PUT(request)
class nova.objectstore.handler.S3

Bases: twisted.web.resource.Resource

Implementation of an S3-like storage server based on local files.

getChild(name, request)
render_GET(request)
nova.objectstore.handler.finish(request, content=None)
nova.objectstore.handler.get_application()
nova.objectstore.handler.get_argument(request, key, default_value)
nova.objectstore.handler.get_context(request)
nova.objectstore.handler.render_xml(request, value)

The image Module

Take uploaded bucket contents and register them as disk images (AMIs). Requires decryption using keys in the manifest.

class nova.objectstore.image.Image(image_id)

Bases: object

static add(src, description, kernel=None, ramdisk=None, public=True)

adds an image to imagestore

@type src: str @param src: location of the partition image on disk

@type description: str @param description: string describing the image contents

@type kernel: bool or str @param kernel: either TRUE meaning this partition is a kernel image or

a string of the image id for the kernel

@type ramdisk: bool or str @param ramdisk: either TRUE meaning this partition is a ramdisk image or

a string of the image id for the ramdisk

@type public: bool @param public: determine if this is a public image or private

@rtype: str @return: a string with the image id

static all()
static decrypt_image(encrypted_filename, encrypted_key, encrypted_iv, cloud_private_key, decrypted_filename)
delete()
image_path
is_authorized(context)
metadata
owner_id
static register_aws_image(image_id, image_location, context)
set_public(state)
static untarzip_image(path, filename)

The stored Module

Properties of an object stored within a bucket.

class nova.objectstore.stored.Object(bucket, key)

Bases: object

delete()
deletes the file
file
return a file object for the key
md5
computes the MD5 of the contents of file
mtime
mtime of file
read()
read all contents of key into memory and return

The objectstore_unittest Module

class nova.tests.objectstore_unittest.ObjectStoreTestCase(methodName='runTest')

Bases: nova.test.BaseTestCase

setUp()
tearDown()
test_buckets()
test_images()

Table Of Contents

Previous topic

Volume Documentation

Next topic

Auth Documentation

This Page