backups

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2016 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package backups provides information and interaction with the backup API resource in the Rackspace Database service.

A backup is a copy of a database instance that can be used to restore it to some defined point in history.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List will list all the saved backups for all database instances.

Types

type Backup

type Backup struct {
	Description string
	ID          string
	InstanceID  string `json:"instance_id" mapstructure:"instance_id"`
	LocationRef string
	Name        string
	ParentID    string `json:"parent_id" mapstructure:"parent_id"`
	Size        float64
	Status      Status
	Created     time.Time `mapstructure:"-"`
	Updated     time.Time `mapstructure:"-"`
	Datastore   datastores.DatastorePartial
}

Backup represents a Backup API resource.

func ExtractBackups

func ExtractBackups(page pagination.Page) ([]Backup, error)

ExtractBackups will retrieve a slice of Backup structs from a paginated collection.

type BackupPage

type BackupPage struct {
	pagination.SinglePageBase
}

BackupPage represents a page of backups.

func (BackupPage) IsEmpty

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

IsEmpty checks whether an BackupPage struct is empty.

type CreateOpts

type CreateOpts struct {
	// [REQUIRED] The name of the backup. The only restriction is the name must
	// be less than 64 characters long.
	Name string

	// [REQUIRED] The ID of the instance being backed up.
	InstanceID string

	// [OPTIONAL] A human-readable explanation of the backup.
	Description string
}

CreateOpts is responsible for configuring newly provisioned backups.

func (CreateOpts) ToBackupCreateMap

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

ToBackupCreateMap will create a JSON map for the Create operation.

type CreateOptsBuilder

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

CreateOptsBuilder is the top-level interface for creating JSON maps.

type CreateResult

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

CreateResult represents the result of a create operation.

func Create

Create asynchronously creates a new backup for a specified database instance. During the backup process, write access on MyISAM databases will be temporarily disabled; innoDB databases will be unaffected. During this time, you will not be able to add or delete databases or users; nor delete, stop or reboot the instance itself. Only one backup is permitted at once.

Backups are not deleted when database instances are deleted; you must manually delete any backups created using Delete(). Backups are saved to your Cloud Files account in a new container called z_CLOUDDB_BACKUPS. It is strongly recommended you do not alter this container or its contents; usual storage costs apply.

func (CreateResult) Extract

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

Extract will retrieve a Backup struct from an operation's result.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult represents the result of a delete operation.

func Delete

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

Delete will permanently delete a backup.

type GetResult

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

GetResult represents the result of a get operation.

func Get

func Get(client *gophercloud.ServiceClient, id string) GetResult

Get will retrieve details for a particular backup based on its unique ID.

func (GetResult) Extract

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

Extract will retrieve a Backup struct from an operation's result.

type ListOpts

type ListOpts struct {
	// The type of datastore by which to filter.
	Datastore string `q:"datastore"`
}

ListOpts allows you to refine a list search by certain parameters.

func (ListOpts) ToBackupListQuery

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

ToBackupListQuery converts a ListOpts struct into a query string.

type ListOptsBuilder

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

ListOptsBuilder is the top-level interface for creating query strings.

type Status

type Status string

Status represents the various states a Backup can be in.

const (
	StatusNew          Status = "NEW"
	StatusBuilding     Status = "BUILDING"
	StatusCompleted    Status = "COMPLETED"
	StatusFailed       Status = "FAILED"
	StatusDeleteFailed Status = "DELETE_FAILED"
)

Enum types for the status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL