diff --git a/rackspace/objectstorage/v1/cdncontainers/delegate.go b/rackspace/objectstorage/v1/cdncontainers/delegate.go
index d7eef20..89adb83 100644
--- a/rackspace/objectstorage/v1/cdncontainers/delegate.go
+++ b/rackspace/objectstorage/v1/cdncontainers/delegate.go
@@ -1,8 +1,6 @@
 package cdncontainers
 
 import (
-	"strconv"
-
 	"github.com/rackspace/gophercloud"
 	os "github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers"
 	"github.com/rackspace/gophercloud/pagination"
@@ -38,34 +36,3 @@
 func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager {
 	return os.List(c, opts)
 }
-
-// Get is a function that retrieves the metadata of a container. To extract just
-// the custom metadata, pass the GetResult response to the ExtractMetadata
-// function.
-func Get(c *gophercloud.ServiceClient, containerName string) os.GetResult {
-	return os.Get(c, containerName)
-}
-
-// UpdateOpts is a structure that holds parameters for updating, creating, or
-// deleting a container's metadata.
-type UpdateOpts struct {
-	CDNEnabled   bool `h:"X-Cdn-Enabled"`
-	LogRetention bool `h:"X-Log-Retention"`
-	TTL          int  `h:"X-Ttl"`
-}
-
-// ToContainerUpdateMap formats a CreateOpts into a map of headers.
-func (opts UpdateOpts) ToContainerUpdateMap() (map[string]string, error) {
-	h, err := gophercloud.BuildHeaders(opts)
-	if err != nil {
-		return nil, err
-	}
-	h["X-Cdn-Enabled"] = strconv.FormatBool(opts.CDNEnabled)
-	return h, nil
-}
-
-// Update is a function that creates, updates, or deletes a container's
-// metadata.
-func Update(c *gophercloud.ServiceClient, containerName string, opts os.UpdateOptsBuilder) os.UpdateResult {
-	return os.Update(c, containerName, opts)
-}
diff --git a/rackspace/objectstorage/v1/cdncontainers/requests.go b/rackspace/objectstorage/v1/cdncontainers/requests.go
index 0567833..05b1939 100644
--- a/rackspace/objectstorage/v1/cdncontainers/requests.go
+++ b/rackspace/objectstorage/v1/cdncontainers/requests.go
@@ -1,6 +1,8 @@
 package cdncontainers
 
 import (
+	"strconv"
+
 	"github.com/racker/perigee"
 	"github.com/rackspace/gophercloud"
 )
@@ -56,3 +58,100 @@
 	res.Err = err
 	return res
 }
+
+// Get is a function that retrieves the metadata of a container. To extract just
+// the custom metadata, pass the GetResult response to the ExtractMetadata
+// function.
+func Get(c *gophercloud.ServiceClient, containerName string) GetResult {
+	var res GetResult
+	resp, err := perigee.Request("HEAD", getURL(c, containerName), perigee.Options{
+		MoreHeaders: c.AuthenticatedHeaders(),
+		OkCodes:     []int{200, 204},
+	})
+	res.Header = resp.HttpResponse.Header
+	res.Err = err
+	return res
+}
+
+// State is the state of an option. It is a pointer to a boolean to enable checking for
+// a zero-value of nil instead of false, which is a valid option.
+type State *bool
+
+var (
+	iTrue  = true
+	iFalse = false
+
+	// Enabled is used for a true value for options in request bodies.
+	Enabled State = &iTrue
+	// Disabled is used for a false value for options in request bodies.
+	Disabled State = &iFalse
+)
+
+// UpdateOptsBuilder allows extensions to add additional parameters to the
+// Update request.
+type UpdateOptsBuilder interface {
+	ToContainerUpdateMap() (map[string]string, error)
+}
+
+// UpdateOpts is a structure that holds parameters for updating, creating, or
+// deleting a container's metadata.
+type UpdateOpts struct {
+	// Whether or not to CDN-enable a container. Prefer using XCDNEnabled, which
+	// is of type *bool underneath.
+	// TODO v2.0: change type to Enabled/Disabled (*bool)
+	CDNEnabled bool `h:"X-Cdn-Enabled"`
+	// Whether or not to enable log retention. Prefer using XLogRetention, which
+	// is of type *bool underneath.
+	// TODO v2.0: change type to Enabled/Disabled (*bool)
+	LogRetention  bool `h:"X-Log-Retention"`
+	XCDNEnabled   *bool
+	XLogRetention *bool
+	TTL           int `h:"X-Ttl"`
+}
+
+// ToContainerUpdateMap formats a CreateOpts into a map of headers.
+func (opts UpdateOpts) ToContainerUpdateMap() (map[string]string, error) {
+	h, err := gophercloud.BuildHeaders(opts)
+	if err != nil {
+		return nil, err
+	}
+	h["X-Cdn-Enabled"] = strconv.FormatBool(opts.CDNEnabled)
+	h["X-Log-Retention"] = strconv.FormatBool(opts.LogRetention)
+
+	if opts.XCDNEnabled != nil {
+		h["X-Cdn-Enabled"] = strconv.FormatBool(*opts.XCDNEnabled)
+	}
+
+	if opts.XLogRetention != nil {
+		h["X-Log-Retention"] = strconv.FormatBool(*opts.XLogRetention)
+	}
+
+	return h, nil
+}
+
+// Update is a function that creates, updates, or deletes a container's
+// metadata.
+func Update(c *gophercloud.ServiceClient, containerName string, opts UpdateOptsBuilder) UpdateResult {
+	var res UpdateResult
+	h := c.AuthenticatedHeaders()
+
+	if opts != nil {
+		headers, err := opts.ToContainerUpdateMap()
+		if err != nil {
+			res.Err = err
+			return res
+		}
+
+		for k, v := range headers {
+			h[k] = v
+		}
+	}
+
+	resp, err := perigee.Request("POST", updateURL(c, containerName), perigee.Options{
+		MoreHeaders: h,
+		OkCodes:     []int{202, 204},
+	})
+	res.Header = resp.HttpResponse.Header
+	res.Err = err
+	return res
+}
diff --git a/rackspace/objectstorage/v1/cdncontainers/results.go b/rackspace/objectstorage/v1/cdncontainers/results.go
index a5097ca..cb0ad30 100644
--- a/rackspace/objectstorage/v1/cdncontainers/results.go
+++ b/rackspace/objectstorage/v1/cdncontainers/results.go
@@ -1,8 +1,149 @@
 package cdncontainers
 
-import "github.com/rackspace/gophercloud"
+import (
+	"strings"
+	"time"
 
-// EnableResult represents the result of a get operation.
+	"github.com/rackspace/gophercloud"
+)
+
+// EnableHeader represents the headers returned in the response from an Enable request.
+type EnableHeader struct {
+	CDNIosURI       string    `mapstructure:"X-Cdn-Ios-Uri"`
+	CDNSslURI       string    `mapstructure:"X-Cdn-Ssl-Uri"`
+	CDNStreamingURI string    `mapstructure:"X-Cdn-Streaming-Uri"`
+	CDNUri          string    `mapstructure:"X-Cdn-Uri"`
+	ContentLength   int       `mapstructure:"Content-Length"`
+	ContentType     string    `mapstructure:"Content-Type"`
+	Date            time.Time `mapstructure:"-"`
+	TransID         string    `mapstructure:"X-Trans-Id"`
+}
+
+// EnableResult represents the result of an Enable operation.
 type EnableResult struct {
 	gophercloud.HeaderResult
 }
+
+// Extract will return extract an EnableHeader from the response to an Enable
+// request. To obtain a map of headers, call the ExtractHeader method on the EnableResult.
+func (er EnableResult) Extract() (EnableHeader, error) {
+	var eh EnableHeader
+	if er.Err != nil {
+		return eh, er.Err
+	}
+
+	if err := gophercloud.DecodeHeader(er.Header, &eh); err != nil {
+		return eh, err
+	}
+
+	if date, ok := er.Header["Date"]; ok && len(date) > 0 {
+		t, err := time.Parse(time.RFC1123, er.Header["Date"][0])
+		if err != nil {
+			return eh, err
+		}
+		eh.Date = t
+	}
+
+	return eh, nil
+}
+
+// GetHeader represents the headers returned in the response from a Get request.
+type GetHeader struct {
+	CDNEnabled      bool      `mapstructure:"X-Cdn-Enabled"`
+	CDNIosURI       string    `mapstructure:"X-Cdn-Ios-Uri"`
+	CDNSslURI       string    `mapstructure:"X-Cdn-Ssl-Uri"`
+	CDNStreamingURI string    `mapstructure:"X-Cdn-Streaming-Uri"`
+	CDNUri          string    `mapstructure:"X-Cdn-Uri"`
+	ContentLength   int       `mapstructure:"Content-Length"`
+	ContentType     string    `mapstructure:"Content-Type"`
+	Date            time.Time `mapstructure:"-"`
+	LogRetention    bool      `mapstructure:"X-Log-Retention"`
+	TransID         string    `mapstructure:"X-Trans-Id"`
+	TTL             int       `mapstructure:"X-Ttl"`
+}
+
+// GetResult represents the result of a Get operation.
+type GetResult struct {
+	gophercloud.HeaderResult
+}
+
+// Extract will return a struct of headers returned from a call to Get. To obtain
+// a map of headers, call the ExtractHeader method on the GetResult.
+func (gr GetResult) Extract() (GetHeader, error) {
+	var gh GetHeader
+	if gr.Err != nil {
+		return gh, gr.Err
+	}
+
+	if err := gophercloud.DecodeHeader(gr.Header, &gh); err != nil {
+		return gh, err
+	}
+
+	if date, ok := gr.Header["Date"]; ok && len(date) > 0 {
+		t, err := time.Parse(time.RFC1123, gr.Header["Date"][0])
+		if err != nil {
+			return gh, err
+		}
+		gh.Date = t
+	}
+
+	return gh, nil
+}
+
+// ExtractMetadata is a function that takes a GetResult (of type *http.Response)
+// and returns the custom metadata associated with the container.
+func (gr GetResult) ExtractMetadata() (map[string]string, error) {
+	if gr.Err != nil {
+		return nil, gr.Err
+	}
+	metadata := make(map[string]string)
+	for k, v := range gr.Header {
+		if strings.HasPrefix(k, "X-Container-Meta-") {
+			key := strings.TrimPrefix(k, "X-Container-Meta-")
+			metadata[key] = v[0]
+		}
+	}
+	return metadata, nil
+}
+
+// UpdateHeader represents the headers returned in the response from a Update request.
+type UpdateHeader struct {
+	CDNIosURI       string    `mapstructure:"X-Cdn-Ios-Uri"`
+	CDNSslURI       string    `mapstructure:"X-Cdn-Ssl-Uri"`
+	CDNStreamingURI string    `mapstructure:"X-Cdn-Streaming-Uri"`
+	CDNUri          string    `mapstructure:"X-Cdn-Uri"`
+	ContentLength   int       `mapstructure:"Content-Length"`
+	ContentType     string    `mapstructure:"Content-Type"`
+	Date            time.Time `mapstructure:"-"`
+	TransID         string    `mapstructure:"X-Trans-Id"`
+}
+
+// UpdateResult represents the result of an update operation. To extract the
+// the headers from the HTTP response, you can invoke the 'ExtractHeader'
+// method on the result struct.
+type UpdateResult struct {
+	gophercloud.HeaderResult
+}
+
+// Extract will return a struct of headers returned from a call to Update. To obtain
+// a map of headers, call the ExtractHeader method on the UpdateResult.
+func (ur UpdateResult) Extract() (UpdateHeader, error) {
+	var uh UpdateHeader
+	if ur.Err != nil {
+		return uh, ur.Err
+	}
+
+	if err := gophercloud.DecodeHeader(ur.Header, &uh); err != nil {
+		return uh, err
+	}
+
+	if date, ok := ur.Header["Date"]; ok && len(date) > 0 {
+		t, err := time.Parse(time.RFC1123, ur.Header["Date"][0])
+		if err != nil {
+			return uh, err
+		}
+		uh.Date = t
+	}
+
+	return uh, nil
+}
diff --git a/rackspace/objectstorage/v1/cdncontainers/urls.go b/rackspace/objectstorage/v1/cdncontainers/urls.go
index 80653f2..541249a 100644
--- a/rackspace/objectstorage/v1/cdncontainers/urls.go
+++ b/rackspace/objectstorage/v1/cdncontainers/urls.go
@@ -5,3 +5,11 @@
 func enableURL(c *gophercloud.ServiceClient, containerName string) string {
 	return c.ServiceURL(containerName)
 }
+
+func getURL(c *gophercloud.ServiceClient, container string) string {
+	return c.ServiceURL(container)
+}
+
+func updateURL(c *gophercloud.ServiceClient, container string) string {
+	return getURL(c, container)
+}
