Adding initial delegates for block storage
diff --git a/rackspace/blockstorage/snapshots/delegate.go b/rackspace/blockstorage/snapshots/delegate.go
new file mode 100644
index 0000000..b835136
--- /dev/null
+++ b/rackspace/blockstorage/snapshots/delegate.go
@@ -0,0 +1,77 @@
+package snapshots
+
+import (
+ "fmt"
+
+ "github.com/rackspace/gophercloud"
+ "github.com/rackspace/gophercloud/pagination"
+
+ os "github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots"
+)
+
+// CreateOptsBuilder allows extensions to add additional parameters to the
+// Create request.
+type CreateOptsBuilder interface {
+ ToSnapshotCreateMap() (map[string]interface{}, error)
+}
+
+// CreateOpts contains options for creating a Snapshot. This object is passed to
+// the snapshots.Create function. For more information about these parameters,
+// see the Snapshot object.
+type CreateOpts struct {
+ // REQUIRED
+ VolumeID string
+ // OPTIONAL
+ Description string
+ // OPTIONAL
+ Force bool
+ // OPTIONAL
+ Name string
+}
+
+// ToSnapshotCreateMap assembles a request body based on the contents of a
+// CreateOpts.
+func (opts CreateOpts) ToSnapshotCreateMap() (map[string]interface{}, error) {
+ s := make(map[string]interface{})
+
+ if opts.VolumeID == "" {
+ return nil, fmt.Errorf("Required CreateOpts field 'VolumeID' not set.")
+ }
+
+ s["volume_id"] = opts.VolumeID
+
+ if opts.Description != "" {
+ s["display_description"] = opts.Description
+ }
+ if opts.Name != "" {
+ s["display_name"] = opts.Name
+ }
+ if opts.Force == true {
+ s["force"] = opts.Force
+ }
+
+ return map[string]interface{}{"snapshot": s}, nil
+}
+
+// Create will create a new Snapshot based on the values in CreateOpts. To
+// extract the Snapshot object from the response, call the Extract method on the
+// CreateResult.
+func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult {
+ return CreateResult{Common: os.Create(client, opts)}
+}
+
+// Delete will delete the existing Snapshot with the provided ID.
+func Delete(client *gophercloud.ServiceClient, id string) error {
+ return os.Delete(client, id)
+}
+
+// Get retrieves the Snapshot with the provided ID. To extract the Snapshot
+// object from the response, call the Extract method on the GetResult.
+func Get(client *gophercloud.ServiceClient, id string) GetResult {
+ return GetResult{Common: os.Get(client, id)}
+}
+
+// List returns Snapshots.
+func List(client *gophercloud.ServiceClient) pagination.Pager {
+ return os.List(client, os.ListOpts{})
+}
diff --git a/rackspace/blockstorage/snapshots/delegate_test.go b/rackspace/blockstorage/snapshots/delegate_test.go
new file mode 100644
index 0000000..1e77fbd
--- /dev/null
+++ b/rackspace/blockstorage/snapshots/delegate_test.go
@@ -0,0 +1 @@
+package snapshots
diff --git a/rackspace/blockstorage/snapshots/results.go b/rackspace/blockstorage/snapshots/results.go
new file mode 100644
index 0000000..5fc4986
--- /dev/null
+++ b/rackspace/blockstorage/snapshots/results.go
@@ -0,0 +1,68 @@
+package snapshots
+
+import (
+ "github.com/rackspace/gophercloud"
+ os "github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots"
+)
+
+// Status is the type used to represent a snapshot's status
+type Status string
+
+// Constants to use for supported statuses
+const (
+ Creating Status = "CREATING"
+ Available Status = "AVAILABLE"
+ Deleting Status = "DELETING"
+ Error Status = "ERROR"
+ DeleteError Status = "ERROR_DELETING"
+)
+
+// Snapshot is the Rackspace representation of an external block storage device.
+type Snapshot struct {
+ // The timestamp when this snapshot was created.
+ CreatedAt string `mapstructure:"created_at"`
+
+ // The human-readable description for this snapshot.
+ Description string `mapstructure:"display_description"`
+
+ // The human-readable name for this snapshot.
+ Name string `mapstructure:"display_name"`
+
+ // The UUID for this snapshot.
+ ID string `mapstructure:"id"`
+
+ // The random metadata associated with this snapshot. Note: unlike standard
+ // OpenStack snapshots, this cannot actually be set.
+ Metadata map[string]string `mapstructure:"metadata"`
+
+ // Indicates the current progress of the snapshot's backup procedure.
+ Progress string `mapstructure:"os-extended-snapshot-attributes:progress"`
+
+ // The project ID.
+ ProjectID string `mapstructure:"os-extended-snapshot-attributes:project_id"`
+
+ // The size of the volume which this snapshot backs up.
+ Size int `mapstructure:"size"`
+
+ // The status of the snapshot.
+ Status Status `mapstructure:"status"`
+
+ // The ID of the volume which this snapshot seeks to back up.
+ VolumeID string `mapstructure:"volume_id"`
+}
+
+type commonResult struct {
+ gophercloud.CommonResult
+}
+
+// CreateResult represents the result of a create operation
+type CreateResult struct {
+ Common os.CreateResult
+ commonResult
+}
+
+// GetResult represents the result of a get operation
+type GetResult struct {
+ Common os.GetResult
+ commonResult
+}