gophercloud: github.com/rackspace/gophercloud/openstack/db/v1/databases Index | Files

package databases

import "github.com/rackspace/gophercloud/openstack/db/v1/databases"

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

Package Files

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

func List Uses

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.

type BatchCreateOpts Uses

type BatchCreateOpts []CreateOpts

BatchCreateOpts allows for multiple databases to created and modified.

func (BatchCreateOpts) ToDBCreateMap Uses

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

ToDBCreateMap renders a JSON map for creating DBs.

type CreateOpts Uses

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 Uses

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 Uses

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

CreateOptsBuilder builds create options

type CreateResult Uses

type CreateResult struct {
    gophercloud.ErrResult
}

CreateResult represents the result of a Create operation.

func Create Uses

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 Uses

type DBPage struct {
    pagination.LinkedPageBase
}

DBPage represents a single page of a paginated DB collection.

func (DBPage) IsEmpty Uses

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

IsEmpty checks to see whether the collection is empty.

func (DBPage) NextPageURL Uses

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

NextPageURL will retrieve the next page URL.

type Database Uses

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 Uses

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

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

type DeleteResult Uses

type DeleteResult struct {
    gophercloud.ErrResult
}

DeleteResult represents the result of a Delete operation.

func Delete Uses

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.

Package databases imports 4 packages (graph) and is imported by 5 packages. Updated 2018-07-02. Refresh now. Tools for package owners.