add versioning
diff --git a/openstack/storage/v1/accounts/accounts.go b/openstack/storage/v1/accounts/accounts.go
new file mode 100644
index 0000000..cb72072
--- /dev/null
+++ b/openstack/storage/v1/accounts/accounts.go
@@ -0,0 +1,27 @@
+package accounts
+
+import (
+ "strings"
+)
+
+type UpdateOpts struct {
+ Metadata map[string]string
+ Headers map[string]string
+}
+
+type GetOpts struct {
+ Headers map[string]string
+}
+
+// GetMetadata is a function that takes a GetResult (of type *perigee.Response)
+// and returns the custom metatdata associated with the account.
+func GetMetadata(gr GetResult) map[string]string {
+ metadata := make(map[string]string)
+ for k, v := range gr.HttpResponse.Header {
+ if strings.HasPrefix(k, "X-Account-Meta-") {
+ key := strings.TrimPrefix(k, "X-Account-Meta-")
+ metadata[key] = v[0]
+ }
+ }
+ return metadata
+}
diff --git a/openstack/storage/v1/accounts/requests.go b/openstack/storage/v1/accounts/requests.go
new file mode 100644
index 0000000..08f1f3c
--- /dev/null
+++ b/openstack/storage/v1/accounts/requests.go
@@ -0,0 +1,50 @@
+package accounts
+
+import (
+ "github.com/racker/perigee"
+ storage "github.com/rackspace/gophercloud/openstack/storage/v1"
+)
+
+type GetResult *perigee.Response
+
+// Update is a function that creates, updates, or deletes an account'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-Account-Meta-"+k] = v
+ }
+
+ url := c.GetAccountURL()
+ _, err = perigee.Request("POST", url, perigee.Options{
+ MoreHeaders: h,
+ OkCodes: []int{204},
+ })
+ return err
+}
+
+// Get is a function that retrieves an account's metadata. 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.GetAccountURL()
+ resp, err := perigee.Request("HEAD", url, perigee.Options{
+ MoreHeaders: h,
+ OkCodes: []int{204},
+ })
+ return resp, err
+}