gophercloud: github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots Index | Files

package snapshots

import "github.com/rackspace/gophercloud/openstack/blockstorage/v1/snapshots"

Package snapshots provides information and interaction with snapshots in the OpenStack Block Storage service. A snapshot is a point in time copy of the data contained in an external storage volume, and can be controlled programmatically.

Index

Package Files

doc.go requests.go results.go urls.go util.go

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 IDFromName Uses

func IDFromName(client *gophercloud.ServiceClient, name string) (string, error)

IDFromName is a convienience function that returns a snapshot's ID given its name.

func List Uses

func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

List returns Snapshots optionally limited by the conditions provided in ListOpts.

func WaitForStatus Uses

func WaitForStatus(c *gophercloud.ServiceClient, id, status string, secs int) error

WaitForStatus will continually poll the resource, checking for a particular status. It will do this for the amount of seconds defined.

type CreateOpts Uses

type CreateOpts struct {
    // OPTIONAL
    Description string
    // OPTIONAL
    Force bool
    // OPTIONAL
    Metadata map[string]interface{}
    // OPTIONAL
    Name string
    // REQUIRED
    VolumeID 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 {
    // contains filtered or unexported fields
}

CreateResult contains the response body and error from a Create request.

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 commonResult object.

type DeleteResult Uses

type DeleteResult struct {
    gophercloud.ErrResult
}

DeleteResult contains the response body and error from a Delete request.

func Delete Uses

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

Delete will delete the existing Snapshot with the provided ID.

type GetResult Uses

type GetResult struct {
    // contains filtered or unexported fields
}

GetResult contains the response body and error from a Get request.

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 commonResult object.

type ListOpts Uses

type ListOpts struct {
    Name     string `q:"display_name"`
    Status   string `q:"status"`
    VolumeID string `q:"volume_id"`
}

ListOpts hold options for listing Snapshots. It is passed to the snapshots.List function.

func (ListOpts) ToSnapshotListQuery Uses

func (opts ListOpts) ToSnapshotListQuery() (string, error)

ToSnapshotListQuery formats a ListOpts into a query string.

type ListOptsBuilder Uses

type ListOptsBuilder interface {
    ToSnapshotListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type ListResult Uses

type ListResult struct {
    pagination.SinglePageBase
}

ListResult is a pagination.Pager that is returned from a call to the List function.

func (ListResult) IsEmpty Uses

func (r ListResult) IsEmpty() (bool, error)

IsEmpty returns true if a ListResult contains no Snapshots.

type Snapshot Uses

type Snapshot struct {
    // Currect status of the Snapshot.
    Status string `mapstructure:"status"`

    // Display name.
    Name string `mapstructure:"display_name"`

    // Instances onto which the Snapshot is attached.
    Attachments []string `mapstructure:"attachments"`

    // Logical group.
    AvailabilityZone string `mapstructure:"availability_zone"`

    // Is the Snapshot bootable?
    Bootable string `mapstructure:"bootable"`

    // Date created.
    CreatedAt string `mapstructure:"created_at"`

    // Display description.
    Description string `mapstructure:"display_discription"`

    // See VolumeType object for more information.
    VolumeType string `mapstructure:"volume_type"`

    // ID of the Snapshot from which this Snapshot was created.
    SnapshotID string `mapstructure:"snapshot_id"`

    // ID of the Volume from which this Snapshot was created.
    VolumeID string `mapstructure:"volume_id"`

    // User-defined key-value pairs.
    Metadata map[string]string `mapstructure:"metadata"`

    // Unique identifier.
    ID  string `mapstructure:"id"`

    // Size of the Snapshot, in GB.
    Size int `mapstructure:"size"`
}

Snapshot contains all the information associated with an OpenStack Snapshot.

type UpdateMetadataOpts Uses

type UpdateMetadataOpts struct {
    Metadata map[string]interface{}
}

UpdateMetadataOpts contain options for updating an existing Snapshot. This object is passed to the snapshots.Update function. For more information about the parameters, see the Snapshot object.

func (UpdateMetadataOpts) ToSnapshotUpdateMetadataMap Uses

func (opts UpdateMetadataOpts) ToSnapshotUpdateMetadataMap() (map[string]interface{}, error)

ToSnapshotUpdateMetadataMap assembles a request body based on the contents of an UpdateMetadataOpts.

type UpdateMetadataOptsBuilder Uses

type UpdateMetadataOptsBuilder interface {
    ToSnapshotUpdateMetadataMap() (map[string]interface{}, error)
}

UpdateMetadataOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateMetadataResult Uses

type UpdateMetadataResult struct {
    // contains filtered or unexported fields
}

UpdateMetadataResult contains the response body and error from an UpdateMetadata request.

func UpdateMetadata Uses

func UpdateMetadata(client *gophercloud.ServiceClient, id string, opts UpdateMetadataOptsBuilder) UpdateMetadataResult

UpdateMetadata will update the Snapshot with provided information. To extract the updated Snapshot from the response, call the ExtractMetadata method on the UpdateMetadataResult.

func (UpdateMetadataResult) Extract Uses

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

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

func (UpdateMetadataResult) ExtractMetadata Uses

func (r UpdateMetadataResult) ExtractMetadata() (map[string]interface{}, error)

ExtractMetadata returns the metadata from a response from snapshots.UpdateMetadata.

Package snapshots imports 4 packages (graph) and is imported by 3 packages. Updated 2016-07-23. Refresh now. Tools for package owners.