import "github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots"
Package snapshots provides information and interaction with the snapshot API resource for the Rackspace Block Storage service.
func Delete(client *gophercloud.ServiceClient, id string) os.DeleteResult
Delete will delete the existing Snapshot with the provided ID.
func ExtractSnapshots(page pagination.Page) ([]Snapshot, error)
ExtractSnapshots extracts and returns Snapshots. It is used while iterating over a snapshots.List call.
func List(client *gophercloud.ServiceClient) pagination.Pager
List returns Snapshots.
type CreateOpts struct { // REQUIRED VolumeID string // OPTIONAL Description string // OPTIONAL Force bool // OPTIONAL Name string }
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.
func (opts CreateOpts) ToSnapshotCreateMap() (map[string]interface{}, error)
ToSnapshotCreateMap assembles a request body based on the contents of a CreateOpts.
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateResult struct { os.CreateResult }
CreateResult represents the result of a create operation
func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult
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 (r CreateResult) Extract() (*Snapshot, error)
Extract will get the Snapshot object out of the CreateResult object.
GetResult represents the result of a get operation
func Get(client *gophercloud.ServiceClient, id string) GetResult
Get retrieves the Snapshot with the provided ID. To extract the Snapshot object from the response, call the Extract method on the GetResult.
Extract will get the Snapshot object out of the GetResult object.
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"` }
Snapshot is the Rackspace representation of an external block storage device.
func (snapshot Snapshot) WaitUntilComplete(c *gophercloud.ServiceClient, timeout int) error
WaitUntilComplete will continually poll a snapshot until it successfully transitions to a specified state. It will do this for at most the number of seconds specified.
func (snapshot Snapshot) WaitUntilDeleted(c *gophercloud.ServiceClient, timeout int) error
WaitUntilDeleted will continually poll a snapshot until it has been successfully deleted, i.e. returns a 404 status.
Status is the type used to represent a snapshot's status
const ( Creating Status = "CREATING" Available Status = "AVAILABLE" Deleting Status = "DELETING" Error Status = "ERROR" DeleteError Status = "ERROR_DELETING" )
Constants to use for supported statuses
UpdateOpts is the common options struct used in this package's Update operation.
func (opts UpdateOpts) ToSnapshotUpdateMap() (map[string]interface{}, error)
ToSnapshotUpdateMap casts a UpdateOpts struct to a map.
UpdateOptsBuilder is the interface options structs have to satisfy in order to be used in the main Update operation in this package. Since many extensions decorate or modify the common logic, it is useful for them to satisfy a basic interface in order for them to be used.
type UpdateResult struct { gophercloud.Result }
UpdateResult represents the result of an update operation
func Update(c *gophercloud.ServiceClient, snapshotID string, opts UpdateOptsBuilder) UpdateResult
Update accepts a UpdateOpts struct and updates an existing snapshot using the values provided.
func (r UpdateResult) Extract() (*Snapshot, error)
Extract will get the Snapshot object out of the UpdateResult object.
Package snapshots imports 5 packages (graph) and is imported by 1 packages. Updated 2016-07-23. Refresh now. Tools for package owners.