openstack object storage v02.0
diff --git a/openstack/storage/objects/objects.go b/openstack/storage/objects/objects.go
new file mode 100644
index 0000000..20228e5
--- /dev/null
+++ b/openstack/storage/objects/objects.go
@@ -0,0 +1,102 @@
+package objects
+
+import (
+	"bytes"
+	"encoding/json"
+	"strings"
+)
+
+type Object struct {
+	Name          string
+	Hash          string
+	Bytes         int
+	Content_type  string
+	Last_modified string
+}
+
+type ListOpts struct {
+	Container string
+	Full      bool
+	Params    map[string]string
+}
+
+type DownloadOpts struct {
+	Container string
+	Name      string
+	Headers   map[string]string
+	Params    map[string]string
+}
+
+type CreateOpts struct {
+	Container string
+	Name      string
+	Content   *bytes.Buffer
+	Metadata  map[string]string
+	Headers   map[string]string
+	Params    map[string]string
+}
+
+type CopyOpts struct {
+	Container    string
+	Name         string
+	NewContainer string
+	NewName      string
+	Metadata     map[string]string
+	Headers      map[string]string
+}
+
+type DeleteOpts struct {
+	Container string
+	Name      string
+	Params    map[string]string
+}
+
+type GetOpts struct {
+	Container string
+	Name      string
+	Headers   map[string]string
+	Params    map[string]string
+}
+
+type UpdateOpts struct {
+	Container string
+	Name      string
+	Metadata  map[string]string
+	Headers   map[string]string
+}
+
+// GetInfo is a function that takes a ListResult (of type *perigee.Response)
+// and returns the objects' information.
+func GetInfo(lr ListResult) ([]Object, error) {
+	var oi []Object
+	err := json.Unmarshal(lr.JsonResult, &oi)
+	return oi, err
+}
+
+// GetNames is a function that takes a ListResult (of type *perigee.Response)
+// and returns the objects' names.
+func GetNames(lr ListResult) []string {
+	jr := string(lr.JsonResult)
+	ons := strings.Split(jr, "\n")
+	ons = ons[:len(ons)-1]
+	return ons
+}
+
+// GetContent is a function that takes a DownloadResult (of type *perigee.Response)
+// and returns the object's content.
+func GetContent(dr DownloadResult) []byte {
+	return dr.JsonResult
+}
+
+// GetMetadata is a function that takes a GetResult (of type *perifee.Response)
+// and returns the custom metadata associated with the object.
+func GetMetadata(gr GetResult) map[string]string {
+	metadata := make(map[string]string)
+	for k, v := range gr.HttpResponse.Header {
+		if strings.HasPrefix(k, "X-Object-Meta-") {
+			key := strings.TrimPrefix(k, "X-Object-Meta-")
+			metadata[key] = v[0]
+		}
+	}
+	return metadata
+}
diff --git a/openstack/storage/objects/requests.go b/openstack/storage/objects/requests.go
new file mode 100644
index 0000000..8f645fc
--- /dev/null
+++ b/openstack/storage/objects/requests.go
@@ -0,0 +1,182 @@
+package objects
+
+import (
+	"fmt"
+
+	"github.com/racker/perigee"
+	"github.com/rackspace/gophercloud/openstack/storage"
+	"github.com/rackspace/gophercloud/openstack/utils"
+)
+
+type ListResult *perigee.Response
+type DownloadResult *perigee.Response
+type GetResult *perigee.Response
+
+// List is a function that retrieves all objects in a container. It also returns the details
+// for the container. To extract only the object information or names, pass the ListResult
+// response to the GetInfo or GetNames function, respectively.
+func List(c *storage.Client, opts ListOpts) (ListResult, error) {
+	contentType := ""
+
+	h, err := c.GetHeaders()
+	if err != nil {
+		return nil, err
+	}
+
+	query := utils.BuildQuery(opts.Params)
+
+	if !opts.Full {
+		contentType = "text/plain"
+	}
+
+	url := c.GetContainerURL(opts.Container) + query
+	resp, err := perigee.Request("GET", url, perigee.Options{
+		Results:     true,
+		MoreHeaders: h,
+		OkCodes:     []int{200, 204},
+		Accept:      contentType,
+	})
+	return resp, err
+}
+
+// Download is a function that retrieves the content and metadata for an object.
+// To extract just the content, pass the DownloadResult response to the GetContent
+// function.
+func Download(c *storage.Client, opts DownloadOpts) (DownloadResult, error) {
+	h, err := c.GetHeaders()
+	if err != nil {
+		return nil, err
+	}
+
+	for k, v := range opts.Headers {
+		h[k] = v
+	}
+
+	query := utils.BuildQuery(opts.Params)
+
+	url := c.GetObjectURL(opts.Container, opts.Name) + query
+	resp, err := perigee.Request("GET", url, perigee.Options{
+		Results:     true,
+		MoreHeaders: h,
+		OkCodes:     []int{200},
+	})
+	return resp, err
+}
+
+// Create is a function that creates a new object or replaces an existing object.
+func Create(c *storage.Client, opts CreateOpts) error {
+	var reqBody []byte
+
+	h, err := c.GetHeaders()
+	if err != nil {
+		return err
+	}
+
+	for k, v := range opts.Headers {
+		h[k] = v
+	}
+
+	for k, v := range opts.Metadata {
+		h["X-Object-Meta-"+k] = v
+	}
+
+	query := utils.BuildQuery(opts.Params)
+
+	content := opts.Content
+	if content != nil {
+		reqBody = make([]byte, content.Len())
+		_, err = content.Read(reqBody)
+		if err != nil {
+			return err
+		}
+	}
+
+	url := c.GetObjectURL(opts.Container, opts.Name) + query
+	_, err = perigee.Request("PUT", url, perigee.Options{
+		ReqBody:     reqBody,
+		MoreHeaders: h,
+		OkCodes:     []int{201},
+	})
+	return err
+}
+
+// Copy is a function that copies one object to another.
+func Copy(c *storage.Client, opts CopyOpts) error {
+	h, err := c.GetHeaders()
+	if err != nil {
+		return err
+	}
+
+	for k, v := range opts.Metadata {
+		h["X-Object-Meta-"+k] = v
+	}
+
+	h["Destination"] = fmt.Sprintf("/%s/%s", opts.NewContainer, opts.NewName)
+
+	url := c.GetObjectURL(opts.Container, opts.Name)
+	_, err = perigee.Request("COPY", url, perigee.Options{
+		MoreHeaders: h,
+		OkCodes:     []int{201},
+	})
+	return err
+}
+
+// Delete is a function that deletes an object.
+func Delete(c *storage.Client, opts DeleteOpts) error {
+	h, err := c.GetHeaders()
+	if err != nil {
+		return err
+	}
+
+	query := utils.BuildQuery(opts.Params)
+
+	url := c.GetObjectURL(opts.Container, opts.Name) + query
+	_, err = perigee.Request("DELETE", url, perigee.Options{
+		MoreHeaders: h,
+		OkCodes:     []int{204},
+	})
+	return err
+}
+
+// Get is a function that retrieves the metadata of an object. To extract just the custom
+// metadata, pass the GetResult response to the GetMetadata function.
+func Get(c *storage.Client, opts GetOpts) (GetResult, error) {
+	h, err := c.GetHeaders()
+	if err != nil {
+		return nil, err
+	}
+
+	for k, v := range opts.Headers {
+		h[k] = v
+	}
+
+	url := c.GetObjectURL(opts.Container, opts.Name)
+	resp, err := perigee.Request("HEAD", url, perigee.Options{
+		MoreHeaders: h,
+		OkCodes:     []int{204},
+	})
+	return resp, err
+}
+
+// Update is a function that creates, updates, or deletes an object's metadata.
+func Update(c *storage.Client, opts UpdateOpts) error {
+	h, err := c.GetHeaders()
+	if err != nil {
+		return err
+	}
+
+	for k, v := range opts.Headers {
+		h[k] = v
+	}
+
+	for k, v := range opts.Metadata {
+		h["X-Object-Meta-"+k] = v
+	}
+
+	url := c.GetObjectURL(opts.Container, opts.Name)
+	_, err = perigee.Request("POST", url, perigee.Options{
+		MoreHeaders: h,
+		OkCodes:     []int{202, 204},
+	})
+	return err
+}