gophercloud: Index | Files

package snapshots

import ""

Package snapshots provides information and interaction with the snapshot API resource for the Rackspace Block Storage service.


Package Files

delegate.go doc.go results.go

func Delete Uses

func Delete(client *gophercloud.ServiceClient, id string) os.DeleteResult

Delete will delete the existing Snapshot with the provided ID.

func ExtractSnapshots Uses

func ExtractSnapshots(page pagination.Page) ([]Snapshot, error)

ExtractSnapshots extracts and returns Snapshots. It is used while iterating over a snapshots.List call.

func List Uses

func List(client *gophercloud.ServiceClient) pagination.Pager

List returns Snapshots.

type CreateOpts Uses

type CreateOpts struct {
    VolumeID string
    Description string
    Force bool
    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 (CreateOpts) ToSnapshotCreateMap Uses

func (opts CreateOpts) ToSnapshotCreateMap() (map[string]interface{}, error)

ToSnapshotCreateMap assembles a request body based on the contents of a CreateOpts.

type CreateOptsBuilder Uses

type CreateOptsBuilder interface {
    ToSnapshotCreateMap() (map[string]interface{}, error)

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult Uses

type CreateResult struct {

CreateResult represents the result of a create operation

func Create Uses

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 (CreateResult) Extract Uses

func (r CreateResult) Extract() (*Snapshot, error)

Extract will get the Snapshot object out of the CreateResult object.

type GetResult Uses

type GetResult struct {

GetResult represents the result of a get operation

func Get Uses

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.

func (GetResult) Extract Uses

func (r GetResult) Extract() (*Snapshot, error)

Extract will get the Snapshot object out of the GetResult object.

type Snapshot Uses

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) WaitUntilComplete Uses

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) WaitUntilDeleted Uses

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.

type Status Uses

type Status string

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

type UpdateOpts Uses

type UpdateOpts struct {
    Name        string
    Description string

UpdateOpts is the common options struct used in this package's Update operation.

func (UpdateOpts) ToSnapshotUpdateMap Uses

func (opts UpdateOpts) ToSnapshotUpdateMap() (map[string]interface{}, error)

ToSnapshotUpdateMap casts a UpdateOpts struct to a map.

type UpdateOptsBuilder Uses

type UpdateOptsBuilder interface {
    ToSnapshotUpdateMap() (map[string]interface{}, error)

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 Uses

type UpdateResult struct {

UpdateResult represents the result of an update operation

func Update Uses

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 (UpdateResult) Extract Uses

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.