Help us shape the future of Go! Take the 2026 Go Developer Survey

instances

package
v0.5.13 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateURL added in v0.5.6

func CreateURL(c *golangsdk.ServiceClient) string

func List

func List(client *golangsdk.ServiceClient, opts ListRdsBuilder) pagination.Pager

func ListErrorLog

func ListErrorLog(client *golangsdk.ServiceClient, opts DbErrorlogBuilder, instanceID string) pagination.Pager

func ListSlowLog

func ListSlowLog(client *golangsdk.ServiceClient, opts DbSlowLogBuilder, instanceID string) pagination.Pager

func WaitForJobCompleted added in v0.1.0

func WaitForJobCompleted(client *golangsdk.ServiceClient, secs int, jobID string) error

func WaitForStateAvailable added in v0.1.0

func WaitForStateAvailable(client *golangsdk.ServiceClient, secs int, instanceID string) error

Types

type BackupStrategy

type BackupStrategy struct {
	StartTime string `json:"start_time" required:"true"`
	KeepDays  int    `json:"keep_days,omitempty"`
}

type ChargeInfo

type ChargeInfo struct {
	ChargeMode  string `json:"charge_mode" required:"true"`
	PeriodType  string `json:"period_type,omitempty"`
	PeriodNum   int    `json:"period_num,omitempty"`
	IsAutoRenew string `json:"is_auto_renew,omitempty"`
	IsAutoPay   string `json:"is_auto_pay,omitempty"`
}

type CreateRds

type CreateRds struct {
	Instance Instance `json:"instance"`
	JobId    string   `json:"job_id"`
	OrderId  string   `json:"order_id"`
}

type CreateRdsBuilder

type CreateRdsBuilder interface {
	ToInstancesCreateMap() (map[string]interface{}, error)
}

type CreateRdsOpts

type CreateRdsOpts struct {
	Name                string          `json:"name"  required:"true"`
	Datastore           *Datastore      `json:"datastore" required:"true"`
	Ha                  *Ha             `json:"ha,omitempty"`
	ConfigurationId     string          `json:"configuration_id,omitempty"`
	Port                string          `json:"port,omitempty"`
	Password            string          `json:"password" required:"true"`
	BackupStrategy      *BackupStrategy `json:"backup_strategy,omitempty"`
	EnterpriseProjectId string          `json:"enterprise_project_id,omitempty"`
	DiskEncryptionId    string          `json:"disk_encryption_id,omitempty"`
	FlavorRef           string          `json:"flavor_ref" required:"true"`
	Volume              *Volume         `json:"volume" required:"true"`
	Region              string          `json:"region" required:"true"`
	AvailabilityZone    string          `json:"availability_zone" required:"true"`
	VpcId               string          `json:"vpc_id" required:"true"`
	SubnetId            string          `json:"subnet_id" required:"true"`
	SecurityGroupId     string          `json:"security_group_id" required:"true"`
	ChargeInfo          *ChargeInfo     `json:"charge_info,omitempty"`
	TimeZone            string          `json:"time_zone,omitempty"`
}

func (CreateRdsOpts) ToInstancesCreateMap

func (opts CreateRdsOpts) ToInstancesCreateMap() (map[string]interface{}, error)

type CreateReplicaBuilder

type CreateReplicaBuilder interface {
	ToCreateReplicaMap() (map[string]interface{}, error)
}

type CreateReplicaOpts

type CreateReplicaOpts struct {
	Name                string      `json:"name"  required:"true"`
	ReplicaOfId         string      `json:"replica_of_id" required:"true"`
	EnterpriseProjectId string      `json:"enterprise_project_id,omitempty"`
	DiskEncryptionId    string      `json:"disk_encryption_id,omitempty"`
	FlavorRef           string      `json:"flavor_ref" required:"true"`
	Volume              *Volume     `json:"volume" required:"true"`
	Region              string      `json:"region,omitempty"`
	AvailabilityZone    string      `json:"availability_zone" required:"true"`
	ChargeInfo          *ChargeInfo `json:"charge_info,omitempty"`
}

func (CreateReplicaOpts) ToCreateReplicaMap

func (opts CreateReplicaOpts) ToCreateReplicaMap() (map[string]interface{}, error)

type CreateResult

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

func Create

func Create(client *golangsdk.ServiceClient, opts CreateRdsBuilder) (r CreateResult)

func CreateReplica

func CreateReplica(client *golangsdk.ServiceClient, opts CreateReplicaBuilder) (r CreateResult)

func (CreateResult) Extract

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

type Datastore

type Datastore struct {
	Type    string `json:"type" required:"true"`
	Version string `json:"version" required:"true"`
}

type DbErrorlogBuilder

type DbErrorlogBuilder interface {
	DbErrorlogQuery() (string, error)
}

type DbErrorlogOpts

type DbErrorlogOpts struct {
	StartDate string `q:"start_date"`
	EndDate   string `q:"end_date"`
	Offset    string `q:"offset"`
	Limit     string `q:"limit"`
	Level     string `q:"level"`
}

func (DbErrorlogOpts) DbErrorlogQuery

func (opts DbErrorlogOpts) DbErrorlogQuery() (string, error)

type DbSlowLogBuilder

type DbSlowLogBuilder interface {
	ToDbSlowLogListQuery() (string, error)
}

type DbSlowLogOpts

type DbSlowLogOpts struct {
	StartDate string `q:"start_date"`
	EndDate   string `q:"end_date"`
	Offset    string `q:"offset"`
	Limit     string `q:"limit"`
	Level     string `q:"level"`
}

func (DbSlowLogOpts) ToDbSlowLogListQuery

func (opts DbSlowLogOpts) ToDbSlowLogListQuery() (string, error)

type DeleteInstance

type DeleteInstance struct {
	InstanceId string `json:"instance_id" required:"true"`
}

func (DeleteInstance) ToInstancesDeleteMap

func (opts DeleteInstance) ToInstancesDeleteMap() (map[string]interface{}, error)

type DeleteInstanceBuilder

type DeleteInstanceBuilder interface {
	ToInstancesDeleteMap() (map[string]interface{}, error)
}

type DeleteInstanceRdsResponse

type DeleteInstanceRdsResponse struct {
	JobId string `json:"job_id"`
}

type DeleteInstanceRdsResult

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

func Delete

func Delete(client *golangsdk.ServiceClient, instanceId string) (r DeleteInstanceRdsResult)

func (DeleteInstanceRdsResult) Extract

type EnlargeVolumeBuilder

type EnlargeVolumeBuilder interface {
	ToEnlargeVolumeMap() (map[string]interface{}, error)
}

type EnlargeVolumeRdsOpts

type EnlargeVolumeRdsOpts struct {
	EnlargeVolume *EnlargeVolumeSize `json:"enlarge_volume" required:"true"`
}

func (EnlargeVolumeRdsOpts) ToEnlargeVolumeMap

func (opts EnlargeVolumeRdsOpts) ToEnlargeVolumeMap() (map[string]interface{}, error)

type EnlargeVolumeResp

type EnlargeVolumeResp struct {
	JobId string `json:"job_id"`
}

type EnlargeVolumeResult

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

func EnlargeVolume

func EnlargeVolume(client *golangsdk.ServiceClient, opts EnlargeVolumeBuilder, instanceId string) (r EnlargeVolumeResult)

func (EnlargeVolumeResult) Extract

type EnlargeVolumeSize

type EnlargeVolumeSize struct {
	Size int `json:"size" required:"true"`
}

type ErrorLogPage

type ErrorLogPage struct {
	pagination.SinglePageBase
}

func (ErrorLogPage) IsEmpty

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

IsEmpty returns true if a ListResult contains no services.

type ErrorLogResp

type ErrorLogResp struct {
	ErrorLogList []Errorlog `json:"error_log_list"`
	TotalRecord  int        `json:"total_record"`
}

func ExtractErrorLog

func ExtractErrorLog(r pagination.Page) (ErrorLogResp, error)

type ErrorLogResult

type ErrorLogResult struct {
	golangsdk.Result
}

type Errorlog

type Errorlog struct {
	Time    string `json:"time"`
	Level   string `json:"level"`
	Content string `json:"content"`
}

type Ha

type Ha struct {
	Mode            string `json:"mode" required:"true"`
	ReplicationMode string `json:"replication_mode,omitempty"`
}

type Instance

type Instance struct {
	Id                  string         `json:"id"`
	Name                string         `json:"name"`
	Status              string         `json:"status"`
	Datastore           Datastore      `json:"datastore"`
	Ha                  Ha             `json:"ha"`
	ConfigurationId     string         `json:"configuration_id"`
	Port                string         `json:"port"`
	BackupStrategy      BackupStrategy `json:"backup_strategy"`
	EnterpriseProjectId string         `json:"enterprise_project_id"`
	DiskEncryptionId    string         `json:"disk_encryption_id"`
	FlavorRef           string         `json:"flavor_ref"`
	Volume              Volume         `json:"volume"`
	Region              string         `json:"region"`
	AvailabilityZone    string         `json:"availability_zone"`
	VpcId               string         `json:"vpc_id"`
	SubnetId            string         `json:"subnet_id"`
	SecurityGroupId     string         `json:"security_group_id"`
	ChargeInfo          ChargeInfo     `json:"charge_info"`
}

type ListOpts added in v0.5.11

type ListOpts struct {
	Id            string `q:"id"`
	Name          string `q:"name"`
	Type          string `q:"type"`
	DataStoreType string `q:"datastore_type"`
	VpcId         string `q:"vpc_id"`
	SubnetId      string `q:"subnet_id"`
	Offset        int    `q:"offset"`
	Limit         int    `q:"limit"`
}

func (ListOpts) ToRdsListDetailQuery added in v0.5.11

func (opts ListOpts) ToRdsListDetailQuery() (string, error)

type ListRdsBuilder

type ListRdsBuilder interface {
	ToRdsListDetailQuery() (string, error)
}

type ListRdsInstanceOpts

type ListRdsInstanceOpts struct {
	Id            string `q:"id"`
	Name          string `q:"name"`
	Type          string `q:"type"`
	DataStoreType string `q:"datastore_type"`
	VpcId         string `q:"vpc_id"`
	SubnetId      string `q:"subnet_id"`
	Offset        int    `q:"offset"`
	Limit         int    `q:"limit"`
}

func (ListRdsInstanceOpts) ToRdsListDetailQuery

func (opts ListRdsInstanceOpts) ToRdsListDetailQuery() (string, error)

type ListRdsResponse

type ListRdsResponse struct {
	Instances  []RdsInstanceResponse `json:"instances"`
	TotalCount int                   `json:"total_count"`
}

func ExtractRdsInstances

func ExtractRdsInstances(r pagination.Page) (ListRdsResponse, error)

ExtractCloudServers is a function that takes a ListResult and returns the services' information.

type ListRdsResult

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

type Nodes

type Nodes struct {
	Id               string `json:"id"`
	Name             string `json:"name"`
	Role             string `json:"role"`
	Status           string `json:"status"`
	AvailabilityZone string `json:"availability_zone"`
}

type RdsInstanceResponse

type RdsInstanceResponse struct {
	Id                  string            `json:"id"`
	Name                string            `json:"name"`
	Status              string            `json:"status"`
	PrivateIps          []string          `json:"private_ips"`
	PublicIps           []string          `json:"public_ips"`
	Port                int               `json:"port"`
	Type                string            `json:"type"`
	Ha                  Ha                `json:"ha"`
	Region              string            `json:"region"`
	DataStore           Datastore         `json:"datastore"`
	Created             string            `json:"created"`
	Updated             string            `json:"updated"`
	DbUserName          string            `json:"db_user_name"`
	VpcId               string            `json:"vpc_id"`
	SubnetId            string            `json:"subnet_id"`
	SecurityGroupId     string            `json:"security_group_id"`
	FlavorRef           string            `json:"flavor_ref"`
	Volume              Volume            `json:"volume"`
	SwitchStrategy      string            `json:"switch_strategy"`
	BackupStrategy      BackupStrategy    `json:"backup_strategy"`
	MaintenanceWindow   string            `json:"maintenance_window"`
	Nodes               []Nodes           `json:"nodes"`
	RelatedInstance     []RelatedInstance `json:"related_instance"`
	DiskEncryptionId    string            `json:"disk_encryption_id"`
	EnterpriseProjectId string            `json:"enterprise_project_id"`
	TimeZone            string            `json:"time_zone"`

	Tags []tags.ResourceTag `json:"tags"`
}

type RdsPage

type RdsPage struct {
	pagination.SinglePageBase
}

func (RdsPage) IsEmpty

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

type RelatedInstance

type RelatedInstance struct {
	Id   string `json:"id"`
	Type string `json:"type"`
}

type ResizeFlavor

type ResizeFlavor struct {
	JobId string `json:"job_id"`
}

type ResizeFlavorBuilder

type ResizeFlavorBuilder interface {
	ResizeFlavorMap() (map[string]interface{}, error)
}

type ResizeFlavorOpts

type ResizeFlavorOpts struct {
	ResizeFlavor *SpecCode `json:"resize_flavor" required:"true"`
}

func (ResizeFlavorOpts) ResizeFlavorMap

func (opts ResizeFlavorOpts) ResizeFlavorMap() (map[string]interface{}, error)

type ResizeFlavorResult

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

func Resize

func Resize(client *golangsdk.ServiceClient, opts ResizeFlavorBuilder, instanceId string) (r ResizeFlavorResult)

func (ResizeFlavorResult) Extract

func (r ResizeFlavorResult) Extract() (*ResizeFlavor, error)

type RestartRdsInstanceBuilder

type RestartRdsInstanceBuilder interface {
	ToRestartRdsInstanceMap() (map[string]interface{}, error)
}

type RestartRdsInstanceOpts

type RestartRdsInstanceOpts struct {
	Restart struct{} `json:"restart"`
}

func (RestartRdsInstanceOpts) ToRestartRdsInstanceMap

func (opts RestartRdsInstanceOpts) ToRestartRdsInstanceMap() (map[string]interface{}, error)

type RestartRdsInstanceResult

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

func Restart

func Restart(client *golangsdk.ServiceClient, opts RestartRdsInstanceBuilder, instanceId string) (r RestartRdsInstanceResult)

func (RestartRdsInstanceResult) Extract

type RestartRdsResponse

type RestartRdsResponse struct {
	JobId string `json:"job_id"`
}

type SingleToHaRds

type SingleToHaRds struct {
	AzCodeNewNode string `json:"az_code_new_node" required:"true"`
	Password      string `json:"password,omitempty"`
}

type SingleToHaRdsInstanceResult

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

func SingleToHa

func SingleToHa(client *golangsdk.ServiceClient, opts SingleToRdsHaBuilder, instanceId string) (r SingleToHaRdsInstanceResult)

func (SingleToHaRdsInstanceResult) Extract

type SingleToHaRdsOpts

type SingleToHaRdsOpts struct {
	SingleToHa *SingleToHaRds `json:"single_to_ha" required:"true"`
}

func (SingleToHaRdsOpts) ToSingleToRdsHaMap

func (opts SingleToHaRdsOpts) ToSingleToRdsHaMap() (map[string]interface{}, error)

type SingleToHaResponse

type SingleToHaResponse struct {
	JobId string `json:"job_id"`
}

type SingleToRdsHaBuilder

type SingleToRdsHaBuilder interface {
	ToSingleToRdsHaMap() (map[string]interface{}, error)
}

type SlowLogPage

type SlowLogPage struct {
	pagination.SinglePageBase
}

func (SlowLogPage) IsEmpty

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

IsEmpty returns true if a ListResult contains no services.

type SlowLogResp

type SlowLogResp struct {
	Slowloglist []Slowloglist `json:"slow_log_list"`
	TotalRecord int           `json:"total_record"`
}

func ExtractSlowLog

func ExtractSlowLog(r pagination.Page) (SlowLogResp, error)

ExtractCloudServers is a function that takes a ListResult and returns the services' information.

type Slowloglist

type Slowloglist struct {
	Count        string `json:"count"`
	Time         string `json:"time"`
	Locktime     string `json:"lock_time"`
	Rowssent     string `json:"rows_sent"`
	Rowsexamined string `json:"rows_examined"`
	Database     string `json:"database"`
	Users        string `json:"users"`
	QuerySample  string `json:"query_sample"`
	Type         string `json:"type"`
}

type SpecCode

type SpecCode struct {
	Speccode string `json:"spec_code" required:"true"`
}

type UpdateConfigurationResponse added in v0.5.1

type UpdateConfigurationResponse struct {
	RestartRequired bool `json:"restart_required"`
}

type UpdateConfigurationResult added in v0.5.1

type UpdateConfigurationResult struct {
	golangsdk.Result
}

func UpdateInstanceConfigurationParameters added in v0.5.1

func UpdateInstanceConfigurationParameters(client *golangsdk.ServiceClient, instanceID string, opts UpdateInstanceConfigurationOptsBuilder) (r UpdateConfigurationResult)

func (UpdateConfigurationResult) Extract added in v0.5.1

type UpdateInstanceConfigurationOpts added in v0.5.1

type UpdateInstanceConfigurationOpts struct {
	Values map[string]interface{} `json:"values"`
}

func (UpdateInstanceConfigurationOpts) ToUpdateInstanceConfigurationMap added in v0.5.1

func (opts UpdateInstanceConfigurationOpts) ToUpdateInstanceConfigurationMap() (map[string]interface{}, error)

type UpdateInstanceConfigurationOptsBuilder added in v0.5.1

type UpdateInstanceConfigurationOptsBuilder interface {
	ToUpdateInstanceConfigurationMap() (map[string]interface{}, error)
}

type Volume

type Volume struct {
	Type string `json:"type" required:"true"`
	Size int    `json:"size,omitempty"`
}

Jump to

Keyboard shortcuts

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