database

package
v0.0.0-...-d1703da Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2015 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildStatus           = "BUILD"
	RebootStatus          = "REBOOT"
	ActiveStatus          = "ACTIVE"
	FailedStatus          = "FAILED"
	BackupStatus          = "BACKUP"
	BlockedStatus         = "BLOCKED"
	ResizeStatus          = "RESIZE"
	RestartRequiredStatus = "RESTART_REQUIRED"
	ShutdownStatus        = "SHUTDOWN"
	ErrorStatus           = "ERROR"
)

Database instance status.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backup

type Backup struct {
	Created     misc.RFC8601DateTime `json:"created,omitempty"`
	Description string               `json:"description,omitempty"`
	Datastore   Datastore            `json:"datastore,omitempty"`
	ID          string               `json:"id,omitempty"`
	InstanceID  string               `json:"instance_id"`
	LocationRef string               `json:"locationRef,omitempty"`
	Name        string               `json:"name"`
	ParentID    string               `json:"parent_id,omitempty"`
	Size        int                  `json:"size,omitempty"`
	Status      string               `json:"status,omitempty"`
	Updated     misc.RFC8601DateTime `json:"updated,omitempty"`
}

Backup contains properties of an backed up instance.

type CreateBackupParameters

type CreateBackupParameters struct {
	Name        string `json:"name,omitempty"`
	InstanceID  string `json:"instance"`
	Description string `json:"description,omitempty"`
}

CreateBackupParameters has properties for creating a backup of a trove database instance.

type CreateDatabaseParameters

type CreateDatabaseParameters struct {
	CharacterSet string `json:"character_set,omitempty"`
	Collate      string `json:"collate,omitempty"`
	Name         string `json:"name"`
}

CreateDatabaseParameters has properties for used when creating a database instance.

type CreateInstanceParameters

type CreateInstanceParameters struct {
	Databases         []CreateDatabaseParameters `json:"databases,omitempty"`
	FlavorRef         string                     `json:"flavorRef"`
	Name              string                     `json:"name,omitempty"`
	Users             []UserParameter            `json:"users,omitempty"`
	Volume            *VolumeSize                `json:"volume,omitempty"`
	NetworkInterfaces []NetworkInterface         `json:"nics,omitempty"`
}

CreateInstanceParameters has properties for creating a trove database instance.

type DBContainer

type DBContainer struct {
	Database Database `json:"database"`
}

DBContainer contains information for a database.

type Database

type Database struct {
	Name string `json:"name"`
}

Database contains information of OpenStack trove database

type DatabasesContainer

type DatabasesContainer struct {
	Databases []Database `json:"databases"`
}

DatabasesContainer contains information for databases.

type Datastore

type Datastore struct {
	Version   string `json:"version"`
	Type      string `json:"type"`
	VersionID string `json:"version_id"`
}

Datastore contains information of OpenStack trove datastore

type Flavor

type Flavor struct {
	ID    int32  `json:"id"`
	Links []Link `json:"links"`
	Name  string `json:"name,omitempty"`
}

Flavor contains information of OpenStack trove flavor TODO: we need to consider consolidating the two Flavor structs (one in compute, and one in database)

since these two structs are only slightly different: ID in one is string while ID is int32 in the other.

type FlavorContainer

type FlavorContainer struct {
	Flavor Flavor `json:"flavor"`
}

FlavorContainer contains information for a flavor.

type FlavorsContainer

type FlavorsContainer struct {
	Flavors []Flavor `json:"flavors"`
}

FlavorsContainer contains information for flavors.

type Instance

type Instance struct {
	Status    string         `json:"status"`
	Name      string         `json:"name"`
	Links     []compute.Link `json:"links"`
	IP        []string       `json:"ip"`
	ID        string         `json:"id"`
	Flavor    compute.Flavor `json:"flavor"`
	Datastore Datastore      `json:"datastore"`
}

Instance contains information of an OpenStack trove database instance

type InstanceContainer

type InstanceContainer struct {
	Instance Instance `json:"instance"`
}

InstanceContainer is a container of information of a database instance.

type InstanceDetail

type InstanceDetail struct {
	Status       string               `json:"status"`
	Updated      misc.RFC8601DateTime `json:"updated"`
	Name         string               `json:"name"`
	Links        []compute.Link       `json:"links"`
	Created      misc.RFC8601DateTime `json:"created"`
	IP           []string             `json:"ip"`
	LocalStorage LocalStorage         `json:"local_storage"`
	ID           string               `json:"id"`
	Flavor       compute.Flavor       `json:"flavor"`
	Datastore    Datastore            `json:"datastore"`
}

InstanceDetail contains detailed information of an OpenStack trove database instance

type InstanceDetailContainer

type InstanceDetailContainer struct {
	Instance InstanceDetail `json:"instance"`
}

InstanceDetailContainer is a container of detailed information for a database instance.

type InstancesContainer

type InstancesContainer struct {
	Instances []Instance `json:"instances"`
}

InstancesContainer is a container of information of database instances.

type Link struct {
	HRef string `json:"href"`
	Rel  string `json:"rel"`
}

Link contains information of a link

type LocalStorage

type LocalStorage struct {
	Size uint    `json:"size,omitempty"`
	Used float64 `json:"used"`
}

LocalStorage contains information of OpenStack trove local storage

type NetworkInterface

type NetworkInterface struct {
	NetID string `json:"net-id"`
}

NetworkInterface represents a network interface to Trove

type RestoreBackupParameters

type RestoreBackupParameters struct {
	FlavorRef    string       `json:"flavorRef"`
	RestorePoint RestorePoint `json:"restorePoint"`
	Name         string       `json:"name,omitempty"`
	Volume       *VolumeSize  `json:"volume,omitempty"`
}

RestoreBackupParameters has properties for restoring a backup to a trove database instance.

type RestorePoint

type RestorePoint struct {
	BackupRef string `json:"backupRef"`
}

RestorePoint has the reference to the backup to restore to.

type Service

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

Service is a client service that can make requests against a OpenStack database v1 service.

func NewService

func NewService(authenticator common.Authenticator) Service

NewService a new Database service client

func (Service) Backup

func (databaseService Service) Backup(backupID string) (Backup, error)

Backup will issue a GET request to retrieve the specified backup.

func (Service) Backups

func (databaseService Service) Backups() ([]Backup, error)

Backups will issue a GET request to retrieve all backups.

func (Service) CreateBackup

func (databaseService Service) CreateBackup(params CreateBackupParameters) (Backup, error)

CreateBackup will issue a POST request to create a new Backup.

func (Service) CreateDatabases

func (databaseService Service) CreateDatabases(instanceID string, params ...CreateDatabaseParameters) error

CreateDatabases will issue a POST request to create the specified databases.

func (Service) CreateInstance

func (databaseService Service) CreateInstance(params CreateInstanceParameters) (InstanceDetail, error)

CreateInstance will issue a POST request to create the specified database instance.

func (Service) CreateUser

func (databaseService Service) CreateUser(instanceID string, params ...UserParameter) error

CreateUser will issue a POST request to create users for the instance.

func (Service) Databases

func (databaseService Service) Databases(instanceID string) ([]Database, error)

Databases will issue a GET request to retrieve all databases.

func (Service) DeleteBackup

func (databaseService Service) DeleteBackup(backupID string) (err error)

DeleteBackup will issue a delete query to delete the specified backup.

func (Service) DeleteDatabase

func (databaseService Service) DeleteDatabase(instanceID string, databaseName string) (err error)

DeleteDatabase will issue a delete query to delete the database.

func (Service) DeleteInstance

func (databaseService Service) DeleteInstance(instanceID string) (err error)

DeleteInstance will issue a delete query to delete the specified database instance.

func (Service) DeleteUser

func (databaseService Service) DeleteUser(instanceID string, userName string) (err error)

DeleteUser will issue a delete query to delete the database.

func (Service) EnableRoot

func (databaseService Service) EnableRoot(instanceID string) (UserParameter, error)

EnableRoot will issue a delete query to delete the specified database instance.

func (Service) Flavor

func (databaseService Service) Flavor(flavorID string) (Flavor, error)

Flavor will issue a GET request to retrieve the specified flavor.

func (Service) Flavors

func (databaseService Service) Flavors() ([]Flavor, error)

Flavors will issue a GET request to retrieve all flavors.

func (Service) Instance

func (databaseService Service) Instance(instanceID string) (InstanceDetail, error)

Instance will issue a GET request to retrieve the specified database instance.

func (Service) Instances

func (databaseService Service) Instances() ([]Instance, error)

Instances will issue a GET request to retrieve all database instances.

func (Service) RestoreBackupInstance

func (databaseService Service) RestoreBackupInstance(params RestoreBackupParameters) (InstanceDetail, error)

RestoreBackupInstance will issue a POST request to create a new Backup .

func (Service) Users

func (databaseService Service) Users(instanceID string) ([]User, error)

Users will issue a GET request to retrieve information of all users.

type User

type User struct {
	Databases []Database `json:"database"`
	Name      string     `json:"name"`
}

User contains information of OpenStack trove database user

type UserContainer

type UserContainer struct {
	User User `json:"user"`
}

UserContainer contains information for a user.

type UserParameter

type UserParameter struct {
	Name      string     `json:"name"`
	Password  string     `json:"password"`
	Databases []Database `json:"databases,omitempty"`
}

UserParameter has properties for a database user.

type UsersContainer

type UsersContainer struct {
	Users []User `json:"users"`
}

UsersContainer contains information for users.

type VolumeSize

type VolumeSize struct {
	Size int `json:"size"`
}

VolumeSize has properties to set the volume of a database instance.

Jump to

Keyboard shortcuts

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