instances

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List added in v0.4.0

List will list all database instances

Types

type ActionResult

type ActionResult struct {
	gophercloud.ErrResult
}

ActionResult represents result of database instance action

func Action

func Action(client *gophercloud.ServiceClient, id string, opts OptsBuilder) (r ActionResult)

Action performs request to perform an action on the database instance

func DetachReplica

func DetachReplica(client *gophercloud.ServiceClient, id string, opts OptsBuilder) (r ActionResult)

DetachReplica performs request to detach replica of database instance

func UpdateAutoExpand

func UpdateAutoExpand(client *gophercloud.ServiceClient, id string, opts OptsBuilder) (r ActionResult)

UpdateAutoExpand performs request to update database instance autoresize parameters

type ApplyCapabilityOpts

type ApplyCapabilityOpts struct {
	ApplyCapability struct {
		Capabilities []CapabilityOpts `json:"capabilities"`
	} `json:"apply_capability"`
}

ApplyCapabilityOpts is used to send request to apply capability to database instance

func (*ApplyCapabilityOpts) Map

func (opts *ApplyCapabilityOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type AttachConfigurationGroupOpts

type AttachConfigurationGroupOpts struct {
	RestartConfirmed *bool `json:"restart_confirmed"`
	Instance         struct {
		Configuration string `json:"configuration"`
	} `json:"instance"`
}

AttachConfigurationGroupOpts represents parameters of configuration group to be attached to database instance

func (*AttachConfigurationGroupOpts) Map

func (opts *AttachConfigurationGroupOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type AutoExpandOpts

type AutoExpandOpts struct {
	AutoExpand  bool
	MaxDiskSize int `mapstructure:"max_disk_size"`
}

AutoExpandOpts represents autoresize parameters of volume of database instance

type BackupSchedule

type BackupSchedule struct {
	Name          string `json:"name"`
	StartHours    int    `json:"start_hours"`
	StartMinutes  int    `json:"start_minutes"`
	IntervalHours int    `json:"interval_hours"`
	KeepCount     int    `json:"keep_count"`
}

func (*BackupSchedule) Map

func (opts *BackupSchedule) Map() (map[string]interface{}, error)

type BackupScheduleOpts

type BackupScheduleOpts struct {
	BackupSchedule *BackupSchedule `json:"backup_schedule"`
}

type CapabilityOpts

type CapabilityOpts struct {
	Name   string            `json:"name"`
	Params map[string]string `json:"params,omitempty" mapstructure:"settings"`
}

CapabilityOpts represents parameters of database instance capabilities

type Configuration

type Configuration struct {
	ID    string  `json:"id"`
	Links *[]Link `json:"links"`
	Name  string  `json:"name"`
}

configuration represents database instance configuration

type ConfigurationResult

type ConfigurationResult struct {
	gophercloud.ErrResult
}

ConfigurationResult represents result of configuration attach and detach

func AttachConfigurationGroup

func AttachConfigurationGroup(client *gophercloud.ServiceClient, id string, opts OptsBuilder) (r ConfigurationResult)

AttachConfigurationGroup performs request to attach configuration group to database instance

func DetachConfigurationGroup

func DetachConfigurationGroup(client *gophercloud.ServiceClient, id string, opts OptsBuilder) (r ConfigurationResult)

DetachConfigurationGroup performs request to detach configuration group from database instance

type CreateOpts

type CreateOpts struct {
	FlavorRef              string                     `json:"flavorRef,omitempty"`
	Volume                 *Volume                    `json:"volume" required:"true"`
	Name                   string                     `json:"name" required:"true"`
	Configuration          string                     `json:"configuration,omitempty"`
	Datastore              *datastores.DatastoreShort `json:"datastore" required:"true"`
	Nics                   []NetworkOpts              `json:"nics" required:"true"`
	ReplicaOf              string                     `json:"replica_of,omitempty"`
	AvailabilityZone       string                     `json:"availability_zone,omitempty"`
	FloatingIPEnabled      bool                       `json:"allow_remote_access,omitempty"`
	Keypair                string                     `json:"key_name,omitempty"`
	AutoExpand             *int                       `json:"volume_autoresize_enabled,omitempty"`
	MaxDiskSize            int                        `json:"volume_autoresize_max_size,omitempty"`
	Walvolume              *WalVolume                 `json:"wal_volume,omitempty"`
	Capabilities           []CapabilityOpts           `json:"capabilities,omitempty"`
	RestorePoint           *RestorePoint              `json:"restorePoint,omitempty"`
	BackupSchedule         *BackupSchedule            `json:"backup_schedule,omitempty"`
	CloudMonitoringEnabled bool                       `json:"cloud_monitoring_enabled,omitempty"`
	SecurityGroups         []string                   `json:"security_groups,omitempty"`
}

CreateOpts represents parameters of creation of database instance

type CreateResult

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

func Create

func Create(client *gophercloud.ServiceClient, opts OptsBuilder) (r CreateResult)

Create performs request to create database instance

func (CreateResult) Extract

func (r CreateResult) Extract() (*InstanceShortResp, error)

type CreateRootUserResult

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

CreateRootUserResult represents result of root user create

func RootUserEnable

func RootUserEnable(client *gophercloud.ServiceClient, id string, opts OptsBuilder) (r CreateRootUserResult)

RootUserEnable performs request to enable root user on database instance

func (CreateRootUserResult) Extract

func (r CreateRootUserResult) Extract() (*RootUserResp, error)

Extract is used to extract result into response struct

type DatabaseCapability

type DatabaseCapability struct {
	Name   string            `json:"name"`
	Params map[string]string `json:"params,omitempty"`
	Status string            `json:"status"`
}

DatabaseCapability represents capability info from dbaas

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult represents result of database instance delete

func Delete

func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult)

Delete performs request to delete database instance

type DeleteRootUserResult

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

DeleteRootUserResult represents result of root user delete

func RootUserDisable

func RootUserDisable(client *gophercloud.ServiceClient, id string) (r DeleteRootUserResult)

RootUserDisable performs request to disable root user on database instance

type DetachConfigurationGroupOpts

type DetachConfigurationGroupOpts struct {
	RestartConfirmed *bool `json:"restart_confirmed"`
	Instance         struct {
		Configuration string `json:"configuration"`
	} `json:"instance"`
}

DetachConfigurationGroupOpts represents parameters of configuration group to be detached from database instance

func (*DetachConfigurationGroupOpts) Map

func (opts *DetachConfigurationGroupOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type DetachReplicaOpts

type DetachReplicaOpts struct {
	Instance struct {
		ReplicaOf string `json:"replica_of,omitempty"`
	} `json:"instance"`
}

DetachReplicaOpts represents parameters of request to detach replica of database instance

func (*DetachReplicaOpts) Map

func (opts *DetachReplicaOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type GetBackupScheduleResult

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

func GetBackupSchedule

func GetBackupSchedule(client *gophercloud.ServiceClient, id string) (r GetBackupScheduleResult)

func (GetBackupScheduleResult) Extract

func (r GetBackupScheduleResult) Extract() (*BackupSchedule, error)

type GetCapabilitiesResult

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

func GetCapabilities

func GetCapabilities(client *gophercloud.ServiceClient, id string) (r GetCapabilitiesResult)

func (GetCapabilitiesResult) Extract

func (r GetCapabilitiesResult) Extract() ([]DatabaseCapability, error)

type GetCapabilityOpts

type GetCapabilityOpts struct {
	Capabilities []DatabaseCapability `json:"capabilities"`
}

type GetResult

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

GetResult represents result of database instance get

func Get

func Get(client *gophercloud.ServiceClient, id string) (r GetResult)

Get performs request to get database instance

func (GetResult) Extract

func (r GetResult) Extract() (*InstanceResp, error)

Extract is used to extract result into response struct

type Instance

type Instance struct {
	Instance *CreateOpts `json:"instance" required:"true"`
}

Instance is used to send request to create database instance

func (*Instance) Map

func (opts *Instance) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type InstanceResp

type InstanceResp struct {
	ComputeInstanceID string                     `json:"compute_instance_id"`
	Configuration     *Configuration             `json:"configuration"`
	ConfigurationID   string                     `json:"configuration_id"`
	ID                string                     `json:"id"`
	Created           db.DateTimeWithoutTZFormat `json:"created"`
	Updated           db.DateTimeWithoutTZFormat `json:"updated"`
	DataStore         *datastores.DatastoreShort `json:"datastore"`
	Flavor            *Links                     `json:"flavor"`
	GaVersion         string                     `json:"ga_version"`
	HealthStatus      string                     `json:"health_status"`
	IP                *[]string                  `json:"ip"`
	Links             *[]Link                    `json:"links"`
	Name              string                     `json:"name"`
	Region            string                     `json:"region"`
	Status            string                     `json:"status"`
	Volume            *Volume                    `json:"volume"`
	ReplicaOf         *Links                     `json:"replica_of"`
	AutoExpand        int                        `json:"volume_autoresize_enabled"`
	MaxDiskSize       int                        `json:"volume_autoresize_max_size"`
	WalVolume         *WalVolume                 `json:"wal_volume"`
}

InstanceResp represents result of database instance get

func ExtractInstances added in v0.4.0

func ExtractInstances(r pagination.Page) ([]InstanceResp, error)

ExtractInstances retrieves a slice of database instanceResp structs from a paginated collection.

type InstanceRespOpts

type InstanceRespOpts struct {
	Instance *InstanceResp `json:"instance"`
}

InstanceRespOpts is used to get instance response

type InstanceShortResp

type InstanceShortResp struct {
	ID     string `json:"id"`
	Status string `json:"status"`
}

type InstanceShortRespOpts

type InstanceShortRespOpts struct {
	Instance *InstanceShortResp `json:"instance"`
}

type IsRootUserEnabledResult

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

IsRootUserEnabledResult represents result of getting root user status

func RootUserGet

func RootUserGet(client *gophercloud.ServiceClient, id string) (r IsRootUserEnabledResult)

RootUserGet performs request to get root user of database instance

func (IsRootUserEnabledResult) Extract

func (r IsRootUserEnabledResult) Extract() (bool, error)

Extract is used to extract result into response struct

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

link represents database instance link

type Links struct {
	ID    string  `json:"id"`
	Links *[]Link `json:"links"`
}

links represents database instance links

type NetworkOpts

type NetworkOpts struct {
	UUID      string `json:"net-id,omitempty"`
	Port      string `json:"port-id,omitempty"`
	V4FixedIP string `json:"v4-fixed-ip,omitempty" mapstructure:"fixed_ip_v4"`
	SubnetID  string `json:"subnet-id,omitempty" mapstructure:"subnet_id"`
}

NetworkOpts represents network parameters of database instance

type OptsBuilder

type OptsBuilder interface {
	Map() (map[string]interface{}, error)
}

type Page added in v0.4.0

type Page struct {
	pagination.SinglePageBase
}

Page represents a page of database instances

func (Page) IsEmpty added in v0.4.0

func (r Page) IsEmpty() (bool, error)

IsEmpty indicates whether a database instance collection is empty.

type ResizeOpts

type ResizeOpts struct {
	Resize struct {
		FlavorRef string `json:"flavorRef"`
	} `json:"resize"`
}

ResizeOpts represents database instance resize parameters

func (*ResizeOpts) Map

func (opts *ResizeOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type ResizeVolumeOpts

type ResizeVolumeOpts struct {
	Resize struct {
		Volume struct {
			Size int `json:"size"`
		} `json:"volume"`
	} `json:"resize"`
}

ResizeVolumeOpts represents database instance volume resize parameters

func (*ResizeVolumeOpts) Map

func (opts *ResizeVolumeOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type ResizeWalVolumeOpts

type ResizeWalVolumeOpts struct {
	Resize struct {
		Volume struct {
			Size int    `json:"size"`
			Kind string `json:"kind"`
		} `json:"volume"`
	} `json:"resize"`
}

ResizeWalVolumeOpts represents database instance wal volume resize parameters

func (*ResizeWalVolumeOpts) Map

func (opts *ResizeWalVolumeOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type RestorePoint

type RestorePoint struct {
	BackupRef string `json:"backupRef" required:"true" mapstructure:"backup_id"`
	Target    string `json:"target,omitempty"`
}

type RootUserEnableOpts

type RootUserEnableOpts struct {
	Password string `json:"password,omitempty"`
}

RootUserEnableOpts represents parameters of request to enable root user for database instance

func (*RootUserEnableOpts) Map

func (opts *RootUserEnableOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type RootUserResp

type RootUserResp struct {
	Password string `json:"password"`
	Name     string `json:"name"`
}

RootUserResp represents parameters of root user response

type RootUserRespOpts

type RootUserRespOpts struct {
	User *RootUserResp `json:"user"`
}

RootUserRespOpts is used to get root user response

type UpdateAutoExpandOpts

type UpdateAutoExpandOpts struct {
	Instance struct {
		VolumeAutoresizeEnabled int `json:"volume_autoresize_enabled"`
		VolumeAutoresizeMaxSize int `json:"volume_autoresize_max_size"`
	} `json:"instance"`
}

UpdateAutoExpandOpts represents parameters of request to update autoresize properties of volume of database instance

func (*UpdateAutoExpandOpts) Map

func (opts *UpdateAutoExpandOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type UpdateAutoExpandWalOpts

type UpdateAutoExpandWalOpts struct {
	Instance struct {
		WalVolume struct {
			VolumeAutoresizeEnabled int `json:"autoresize_enabled"`
			VolumeAutoresizeMaxSize int `json:"autoresize_max_size"`
		} `json:"wal_volume"`
	} `json:"instance"`
}

UpdateAutoExpandWalOpts represents parameters of request to update autoresize properties of wal volume of database instance

func (*UpdateAutoExpandWalOpts) Map

func (opts *UpdateAutoExpandWalOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type UpdateBackupScheduleResult

type UpdateBackupScheduleResult struct {
	gophercloud.ErrResult
}

func UpdateBackupSchedule

func UpdateBackupSchedule(client *gophercloud.ServiceClient, id string, opts OptsBuilder) (r UpdateBackupScheduleResult)

type UpdateCloudMonitoringOpts

type UpdateCloudMonitoringOpts struct {
	CloudMonitoring struct {
		Enable bool `json:"enable"`
	} `json:"cloud_monitoring"`
}

UpdateCloudMonitoringOpts represents parameters of request to update cloud monitoring options

func (*UpdateCloudMonitoringOpts) Map

func (opts *UpdateCloudMonitoringOpts) Map() (map[string]interface{}, error)

Map converts opts to a map (for a request body)

type Volume

type Volume struct {
	Size       *int     `json:"size" required:"true"`
	Used       *float32 `json:"used,omitempty"`
	VolumeID   string   `json:"volume_id,,omitempty"`
	VolumeType string   `json:"type,,omitempty" required:"true"`
}

volume represents database instance volume

type WalVolume

type WalVolume struct {
	Size        *int     `json:"size" required:"true"`
	Used        *float32 `json:"used,omitempty"`
	VolumeID    string   `json:"volume_id,,omitempty"`
	VolumeType  string   `json:"type,,omitempty" required:"true"`
	AutoExpand  int      `json:"autoresize_enabled,omitempty"`
	MaxDiskSize int      `json:"autoresize_max_size,omitempty"`
}

walVolume represents database instance wal volume

type WalVolumeOpts

type WalVolumeOpts struct {
	Size       int
	VolumeType string `mapstructure:"volume_type"`
}

WalVolumeOpts represents parameters for creation of database instance wal volume

Jump to

Keyboard shortcuts

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