datastores

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: 4 Imported by: 0

Documentation

Overview

Package datastores provides information and interaction with the datastore API resource in the Rackspace Database service.

Index

Constants

This section is empty.

Variables

View Source
var (
	ListDSResp       = fmt.Sprintf(`{"datastores":[%s]}`, singleDSJSON)
	GetDSResp        = fmt.Sprintf(`{"datastore":%s}`, singleDSJSON)
	ListVersionsResp = fmt.Sprintf(`{%s}`, versionsJSON)
	GetVersionResp   = fmt.Sprintf(`{"version":%s}`, version1JSON)
)
View Source
var ExampleDatastore = Datastore{
	DefaultVersion: "c00000b0-00c0-0c00-00c0-000b000000cc",
	ID:             "10000000-0000-0000-0000-000000000001",
	Links: []gophercloud.Link{
		gophercloud.Link{Rel: "self", Href: "https://10.240.28.38:8779/v1.0/1234/datastores/10000000-0000-0000-0000-000000000001"},
		gophercloud.Link{Rel: "bookmark", Href: "https://10.240.28.38:8779/datastores/10000000-0000-0000-0000-000000000001"},
	},
	Name:     "mysql",
	Versions: ExampleVersions,
}
View Source
var ExampleVersion1 = Version{
	ID: "b00000b0-00b0-0b00-00b0-000b000000bb",
	Links: []gophercloud.Link{
		gophercloud.Link{Rel: "self", Href: "https://10.240.28.38:8779/v1.0/1234/datastores/versions/b00000b0-00b0-0b00-00b0-000b000000bb"},
		gophercloud.Link{Rel: "bookmark", Href: "https://10.240.28.38:8779/datastores/versions/b00000b0-00b0-0b00-00b0-000b000000bb"},
	},
	Name: "5.1",
}
View Source
var ExampleVersions = []Version{ExampleVersion1, exampleVersion2}

Functions

func List

List will list all available datastore types that instances can use.

func ListVersions

func ListVersions(client *gophercloud.ServiceClient, datastoreID string) pagination.Pager

ListVersions will list all of the available versions for a specified datastore type.

Types

type Datastore

type Datastore struct {
	DefaultVersion string `json:"default_version" mapstructure:"default_version"`
	ID             string
	Links          []gophercloud.Link
	Name           string
	Versions       []Version
}

Datastore represents a Datastore API resource.

func ExtractDatastores

func ExtractDatastores(page pagination.Page) ([]Datastore, error)

ExtractDatastores retrieves a slice of datastore structs from a paginated collection.

type DatastorePage

type DatastorePage struct {
	pagination.SinglePageBase
}

DatastorePage represents a page of datastore resources.

func (DatastorePage) IsEmpty

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

IsEmpty indicates whether a Datastore collection is empty.

type DatastorePartial

type DatastorePartial struct {
	Version   string
	Type      string
	VersionID string `json:"version_id" mapstructure:"version_id"`
}

DatastorePartial is a meta structure which is used in various API responses. It is a lightweight and truncated version of a full Datastore resource, offering details of the Version, Type and VersionID only.

type GetResult

type GetResult struct {
	gophercloud.Result
}

GetResult represents the result of a Get operation.

func Get

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

Get will retrieve the details of a specified datastore type.

func (GetResult) Extract

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

Extract retrieves a single Datastore struct from an operation result.

type GetVersionResult

type GetVersionResult struct {
	gophercloud.Result
}

GetVersionResult represents the result of getting a version.

func GetVersion

func GetVersion(client *gophercloud.ServiceClient, datastoreID, versionID string) GetVersionResult

GetVersion will retrieve the details of a specified datastore version.

func (GetVersionResult) Extract

func (r GetVersionResult) Extract() (*Version, error)

Extract retrieves a single Version struct from an operation result.

type Version

type Version struct {
	ID    string
	Links []gophercloud.Link
	Name  string
}

Version represents a version API resource. Multiple versions belong to a Datastore.

func ExtractVersions

func ExtractVersions(page pagination.Page) ([]Version, error)

ExtractVersions retrieves a slice of versions from a paginated collection.

type VersionPage

type VersionPage struct {
	pagination.SinglePageBase
}

DatastorePage represents a page of version resources.

func (VersionPage) IsEmpty

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

IsEmpty indicates whether a collection of version resources is empty.

Jump to

Keyboard shortcuts

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