instances

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListErrorLog

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

func ListSlowLog

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

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 ChargeInfoMode added in v1.0.19

type ChargeInfoMode struct {
	ChargeMode string `json:"charge_mode"`
}

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           `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 *gophercloud.ServiceClient, opts CreateRdsBuilder) (r CreateResult)

func CreateReplica

func CreateReplica(client *gophercloud.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"`
	Type      string `q:"type"`
}

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 *gophercloud.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 *gophercloud.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.Offset
}

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 {
	gophercloud.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 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"`
	ChargeInfo          ChargeInfoMode    `json:"charge_info"`
}

type RdsPage

type RdsPage struct {
	pagination.Offset
}

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 *gophercloud.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 string `json:"restart" required:"true"`
}

func (RestartRdsInstanceOpts) ToRestartRdsInstanceMap

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

type RestartRdsInstanceResult

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

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 *gophercloud.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.Offset
}

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" `
	StartTime    string `json:"start_time" `
	ClientIp     string `json:"client_ip" `
}

type SpecCode

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

type Volume

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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