Documentation ¶
Index ¶
- Constants
- type Backup
- type CreateBackupParameters
- type CreateDatabaseParameters
- type CreateInstanceParameters
- type DBContainer
- type Database
- type DatabasesContainer
- type Datastore
- type Flavor
- type FlavorContainer
- type FlavorsContainer
- type Instance
- type InstanceContainer
- type InstanceDetail
- type InstanceDetailContainer
- type InstancesContainer
- type Link
- type LocalStorage
- type NetworkInterface
- type RestoreBackupParameters
- type RestorePoint
- type Service
- func (databaseService Service) Backup(backupID string) (Backup, error)
- func (databaseService Service) Backups() ([]Backup, error)
- func (databaseService Service) CreateBackup(params CreateBackupParameters) (Backup, error)
- func (databaseService Service) CreateDatabases(instanceID string, params ...CreateDatabaseParameters) error
- func (databaseService Service) CreateInstance(params CreateInstanceParameters) (InstanceDetail, error)
- func (databaseService Service) CreateUser(instanceID string, params ...UserParameter) error
- func (databaseService Service) Databases(instanceID string) ([]Database, error)
- func (databaseService Service) DeleteBackup(backupID string) (err error)
- func (databaseService Service) DeleteDatabase(instanceID string, databaseName string) (err error)
- func (databaseService Service) DeleteInstance(instanceID string) (err error)
- func (databaseService Service) DeleteUser(instanceID string, userName string) (err error)
- func (databaseService Service) EnableRoot(instanceID string) (UserParameter, error)
- func (databaseService Service) Flavor(flavorID string) (Flavor, error)
- func (databaseService Service) Flavors() ([]Flavor, error)
- func (databaseService Service) Instance(instanceID string) (InstanceDetail, error)
- func (databaseService Service) Instances() ([]Instance, error)
- func (databaseService Service) RestoreBackupInstance(params RestoreBackupParameters) (InstanceDetail, error)
- func (databaseService Service) Users(instanceID string) ([]User, error)
- type User
- type UserContainer
- type UserParameter
- type UsersContainer
- type VolumeSize
Constants ¶
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 LocalStorage ¶
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) 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) DeleteBackup ¶
DeleteBackup will issue a delete query to delete the specified backup.
func (Service) DeleteDatabase ¶
DeleteDatabase will issue a delete query to delete the database.
func (Service) DeleteInstance ¶
DeleteInstance will issue a delete query to delete the specified database instance.
func (Service) DeleteUser ¶
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) Instance ¶
func (databaseService Service) Instance(instanceID string) (InstanceDetail, error)
Instance will issue a GET request to retrieve the specified database instance.
func (Service) RestoreBackupInstance ¶
func (databaseService Service) RestoreBackupInstance(params RestoreBackupParameters) (InstanceDetail, error)
RestoreBackupInstance will issue a POST request to create a new Backup .
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.