databases

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: Apache-2.0 Imports: 3 Imported by: 3

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 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 {
	// 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 `json:"name" required:"true"`
	// 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 `json:"character_set,omitempty"`
	// 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 `json:"collate,omitempty"`
}

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

func (CreateOpts) ToMap

func (opts CreateOpts) ToMap() (map[string]interface{}, 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) (r 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) (r DeleteResult)

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

Directories

Path Synopsis
db_databases_v1
db_databases_v1

Jump to

Keyboard shortcuts

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