databases

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 flavors provides information and interaction with the database API resource in the OpenStack Database service.

A database, when referred to here, refers to the database engine running on an instance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCreate

func HandleCreate(t *testing.T)

func HandleDelete

func HandleDelete(t *testing.T)

func HandleList

func HandleList(t *testing.T)

func List

func List(client *gophercloud.ServiceClient, instanceID string) pagination.Pager

List will list all of the databases for a specified instance. Note: this operation will only return user-defined databases; it will exclude system databases like "mysql", "information_schema", "lost+found" etc.

Types

type BatchCreateOpts

type BatchCreateOpts []CreateOpts

BatchCreateOpts allows for multiple databases to created and modified.

func (BatchCreateOpts) ToDBCreateMap

func (opts BatchCreateOpts) ToDBCreateMap() (map[string]interface{}, error)

ToDBCreateMap renders a JSON map for creating DBs.

type CreateOpts

type CreateOpts struct {
	// [REQUIRED] Specifies the name of the database. Valid names can be composed
	// of the following characters: letters (either case); numbers; these
	// characters '@', '?', '#', ' ' but NEVER beginning a name string; '_' is
	// permitted anywhere. Prohibited characters that are forbidden include:
	// single quotes, double quotes, back quotes, semicolons, commas, backslashes,
	// and forward slashes.
	Name string

	// [OPTIONAL] Set of symbols and encodings. The default character set is
	// "utf8". See http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html for
	// supported character sets.
	CharSet string

	// [OPTIONAL] Set of rules for comparing characters in a character set. The
	// default value for collate is "utf8_general_ci". See
	// http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html for supported
	// collations.
	Collate string
}

DatabaseOpts is the struct responsible for configuring a database; often in the context of an instance.

func (CreateOpts) ToMap

func (opts CreateOpts) ToMap() (map[string]string, error)

ToMap is a helper function to convert individual DB create opt structures into sub-maps.

type CreateOptsBuilder

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

CreateOptsBuilder builds create options

type CreateResult

type CreateResult struct {
	gophercloud.ErrResult
}

CreateResult represents the result of a Create operation.

func Create

func Create(client *gophercloud.ServiceClient, instanceID string, opts CreateOptsBuilder) CreateResult

Create will create a new database within the specified instance. If the specified instance does not exist, a 404 error will be returned.

type DBPage

type DBPage struct {
	pagination.LinkedPageBase
}

DBPage represents a single page of a paginated DB collection.

func (DBPage) IsEmpty

func (page DBPage) IsEmpty() (bool, error)

IsEmpty checks to see whether the collection is empty.

func (DBPage) NextPageURL

func (page DBPage) NextPageURL() (string, error)

NextPageURL will retrieve the next page URL.

type Database

type Database struct {
	// Specifies the name of the MySQL database.
	Name string

	// Set of symbols and encodings. The default character set is utf8.
	CharSet string

	// Set of rules for comparing characters in a character set. The default
	// value for collate is utf8_general_ci.
	Collate string
}

Database represents a Database API resource.

func ExtractDBs

func ExtractDBs(page pagination.Page) ([]Database, error)

ExtractDBs will convert a generic pagination struct into a more relevant slice of DB structs.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult represents the result of a Delete operation.

func Delete

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

Delete will permanently delete the database within a specified instance. All contained data inside the database will also be permanently deleted.

Jump to

Keyboard shortcuts

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